blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 132 | path stringlengths 3 236 | src_encoding stringclasses 29
values | length_bytes int64 8 7.94M | score float64 2.52 5.72 | int_score int64 3 5 | detected_licenses listlengths 0 142 | license_type stringclasses 2
values | text stringlengths 8 7.94M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
99dcd052e9fe759324b7a8162366fbd9ef4cafaf | JavaScript | BJZeta/superhero-dojo | /src/components/CharacterInfoModal.js | UTF-8 | 5,606 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import {
Button,
Modal,
Col,
Container,
Image,
Row,
OverlayTrigger,
Tooltip,
} from "react-bootstrap";
const CharacterInfoModal = (props) => {
const [character, setCharacter] = useState({});
const [loading, setIsLoading] = useState(false);
const... | true |
64ecf9ca1b45530d8f9c9558fc1a2cff34accc84 | JavaScript | kvdy/erp-sys | /schoolerp/WebContent/js/reportcommentsscript.js | UTF-8 | 2,057 | 2.578125 | 3 | [] | no_license | function createRequest(){
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}else{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
return xmlhttp;
}
function addReportCommentButtonClicked(rId){
//ale... | true |
233964e78231724087d1d6dfa64a9abe4ee46e14 | JavaScript | Dudunaitor/Serratec-2k21 | /Logica de programação/Algoritimos para Entrega/Aula 3/Aula3Ex17.js | UTF-8 | 539 | 4.03125 | 4 | [] | no_license | //O sistema “Faço parte” vai te mostrar um histórico da trajetória de nossa cidade. O resultado apresentado na tela será: “Teresópolis tem x anos. Desses, foram y antes de mim. Mas nos últimos z anos ela conta comigo!”. Cada letra maiúscula do texto será uma variável, sendo que “x” e “z” são valores fixos, e “y” irá co... | true |
ce5bbef711d221f02da9973cd5f142f64697370d | JavaScript | BogdanLyamzin/27-nodejs | /lesson-15/book-shop/src/components/CategoryList/CategoryList.jsx | UTF-8 | 1,165 | 2.71875 | 3 | [] | no_license | import {useState, useEffect} from "react";
import axios from "axios";
import styles from "./CategoryList.module.css";
const CategoryList = () => {
const [categories, setCategories] = useState([]);
const [page, setPage] = useState(1);
useEffect(async ()=> {
try {
const {data} = await axi... | true |
292f1e9e9063bba51f134ad827d3da9f09f33792 | JavaScript | dpere316/Katas | /HackerRanks/easys/modifyArray.js | UTF-8 | 930 | 4.25 | 4 | [] | no_license | function modifyArray(nums) {
let mod = []
for(let i = 0; i < nums.length; i++)
{
if(nums[i] % 2 == 0)
{
nums[i] = nums[i] * 2
mod.push(nums[i])
}
else{
nums[i] = nums[i] * 3
mod.push(nums[i])
}
}
return mod
... | true |
d1f73fbecf9aef680acad551771f816855c280de | JavaScript | Paul-Ukaegbu/tip-calculator | /tipcalculator.js | UTF-8 | 448 | 3.25 | 3 | [] | no_license | const tipCalculator = (quality, total) =>{
let qual = quality.toLowerCase()
if(qual === 'bad'){
return 0.05 * total + '$'
}
else if(qual === 'ok'){
return 0.15 * total + '$'
}
else if(qual === 'good'){
return 0.20 * total + '$'
}
else if(qual === 'excellent'){
ret... | true |
f635ba0dc5462752cb7ec553f851887ce6225321 | JavaScript | AlexanderKruk/learn.javascript.ru | /part1/4/getSecondToday.js | UTF-8 | 178 | 3.15625 | 3 | [] | no_license | console.log(getSecondToday())
function getSecondToday(){
var curDate = new Date();
return curDate.getHours() * 3600 + curDate.getMinutes() * 60 + curDate.getSeconds();
} | true |
50ebfc8cda2ebba49acfca7fe7dbd2b611c25727 | JavaScript | zamd/mobile-to-websso-sample | /sample-webapp/refreshTokens.js | UTF-8 | 3,202 | 2.578125 | 3 | [] | no_license | const debug = require('debug')(process.env.APP_NAME);
const rp = require('request-promise');
const Boom = require('boom');
async function refreshTokens(refreshToken) {
const options = {
uri: `https://${process.env.AUTH0_DOMAIN}/oauth/token`,
method: "POST",
json: {
grant_type: "... | true |
9911673129939fd85fd6215738a486da4de12036 | JavaScript | cyprianngolah/WMIS | /WMIS/js/VueModules/wmis.tools.resetherdpopulation.js | UTF-8 | 3,293 | 2.515625 | 3 | [] | no_license | /**/
new Vue({
el: "#app",
name: "ResetHerd",
data: {
busy: false,
message: {
text: '',
class: ''
},
wb: {},
sheets: [],
fileSelected: false,
showTable: false,
headers: [],
sheetData: [],
selections: {... | true |
557752d7d179945e90a308e88775c26a4a232e6b | JavaScript | denisoncorbal/gama-Landing-Page | /scripts/main.js | UTF-8 | 838 | 2.671875 | 3 | [] | no_license | const form = document.getElementById('form');
form.addEventListener('submit', (e)=>{
e.preventDefault();
let nome = document.getElementById('name').value;
let email = document.getElementById('mail').value;
let data = {nome, email};
let convertData = JSON.stringify(data);
let content = document... | true |
6fe86a2408d17bfae7528edadf5f314b542bd49b | JavaScript | colemanrpatrick/maitaiCatamaranCart | /participantHandler.js | UTF-8 | 3,406 | 3.203125 | 3 | [] | no_license | console.log("participantHandler.js ready");
var container = document.getElementById("participants-names-ages"),
participant = document.getElementsByClassName("participant"),
carrier = document.getElementById("carrierInput");
var participantsValue,
participantsArr,
num;
function getParticipants() {
... | true |
1819cdf7e471cfcf8a03836b3a7aa9acd7c04334 | JavaScript | sstovall19/fcs | /www/js/phoneScan.js | UTF-8 | 4,758 | 2.515625 | 3 | [
"MIT"
] | permissive | //get the phone order details and
//populate in a json for posting in the db
function getPhoneDetails(){
var json = {};
json['scanned_phones'] = {};
$(".server_section").each(function(){
var serverId = $(this).attr("id");
json['scanned_phones'][serverId] = {};//add the server id
if(typeof serv... | true |
a6b6d2a77080ca6d62bc0d3ae49f9c227597566b | JavaScript | samuelcomputacao/leaflet | /src/microrregioes.js | UTF-8 | 798 | 2.75 | 3 | [] | no_license | var microrregioesLayer = L.geoJSON();
const getMicrorregioesLayer = () => {
microrregioesLayer = L.geoJSON([]);
const urlMicrorregioes = 'http://localhost:8000/microrregioes';
fetch(urlMicrorregioes, {
method: 'get',
mode: 'cors'
}).then(function (response) {
response.json().the... | true |
3facd983ee7dd39a6b5f9fc80c5ca4c21a12f5a8 | JavaScript | NCIOCPL/wcms-front-end | /CancerGov/_src/Scripts/NCI/UX/AppModuleSpecific/BasicCTS/Common/select2-intervention-initializer.js | UTF-8 | 8,046 | 2.609375 | 3 | [] | no_license | // What is the purpose of this file???
// -----------------------------------
// We have implemented our own fetch methods to get results back from the CTAPI. Therefore, we cannot use the default ajax method.
// Luckily, Select2 has a system for implementing data adapters that allow use to create our own ways of fetch... | true |
ff004873a019741a524ab4f975b9b7e646ae73df | JavaScript | hoanghiep2402/graphql-react | /src/components/MainTable/FormData/FormData.js | UTF-8 | 2,904 | 2.734375 | 3 | [] | no_license | import React, {Component} from 'react';
class FormData extends Component {
state={
id:0,
name:'',
age:0,
gender:"Male",
isEditing:false
};
componentDidMount() {
if(this.props.user){
const {user}=this.props;
this.setState({
... | true |
c8c36698bc2b69f8c1e37f057a4f2aff5e55b4ee | JavaScript | semaph0re/Snooful | /src/commands/btc.js | UTF-8 | 482 | 2.734375 | 3 | [] | no_license | const btcValue = require('btc-value');
module.exports = {
arguments: [{
description: "Get the current BTC Price",
key: "query",
type: "string",
}],
description: "Get the current BTC Price",
handler: args => {
// Print the current value as a decimal number if `isDecimal` is `true`
btcValue({ isDec... | true |
541e43faeff44b68d40e9b02efcc506c4d7d37ab | JavaScript | freewayz/crud-wire | /webapp/src/js/model/QuestionModel.js | UTF-8 | 502 | 3.1875 | 3 | [] | no_license | /**
* Created by peter on 8/24/15.
*/
var Question = function (question_id ,question_text, question_answer) {
this.question_id = question_id;
this.question_text = question_text;
this.question_answer = question_answer;
};
/**
* Overiding the object to string method
* @returns {string}
*/
Question.... | true |
fb0119c24f18fbf0b48e68ab186be3f97893d01c | JavaScript | emperorkrosis/jelow | /samples/crandra/fountainscene.js | UTF-8 | 9,077 | 2.59375 | 3 | [] | no_license | var advent = advent || {};
/**
* The fountain scene.
* @constructor
*/
advent.FountainScene = function(parent) {
/**
* Global context.
* @type {advent.Game}
*/
this.game_ = parent;
/**
* The scene name.
* @type {string}
*/
this.name = 'fountain';
/**
* The scene background image.
... | true |
39960dd5b31ccba20c609f5bbbd5ea4d4c3cb373 | JavaScript | BirdmanTunes/project_tictac | /src/main/resources/static/script.js | UTF-8 | 10,927 | 3.140625 | 3 | [] | no_license | const canvas_a = document.getElementById("canvas_a");
const canvas_b = document.getElementById("canvas_b");
const canvas_c = document.getElementById("canvas_c");
const canvas_d = document.getElementById("canvas_d");
const canvas_e = document.getElementById("canvas_e");
const canvas_f = document.getElementById("canvas_f... | true |
7b1d41df8401f5361bc889b3a3ba83222af28842 | JavaScript | PinkPoint/pinkpoint-ng2 | /src/pinkPointBackend.es6 | UTF-8 | 587 | 2.53125 | 3 | [] | no_license | //const baseUrl = 'http://projectpinkpoint.azurewebsites.net';
export class Routes {
constructor(baseUrl) {
this.baseUrl = baseUrl;
}
all() {
var url = `${this.baseUrl}/routes`;
return fetch(url).then(res => { return res.json(); });
}
create(route:any) {
var url = ... | true |
920be53f98b20dcf069af1c2f99b61d80b4f5915 | JavaScript | aly162/Evans_Alastair_WebTech2_Coursework2 | /js/fadeOUTPUT.js | UTF-8 | 558 | 2.546875 | 3 | [] | no_license | var FD = document.getElementById("output_area");
function fadein() {
fade = setInterval(function()
{
if (parseFloat(FD.style.opacity) < 1)
{
FD.style.opacity = parseFloat(FD.style.opacity) + 0.002;
}
}
);
}
// Citation
// Guidance for C... | true |
705cefb78f432b7ee05ccfd05084e8a1f428029b | JavaScript | succli/backoffice-legacy | /app/services/ticket.js | UTF-8 | 1,127 | 3.265625 | 3 | [] | no_license | // Load modules
import moment from 'moment';
// Load date service
import { diffInMinutes } from './date';
/**
* Calculate ticket's logged time from logs
* @param {Object[]} logs
* @returns {String}
*/
export const getTicketLoggedTime = logs => {
const dataTime = { hours: 0, minutes: 0};
for (let log of logs... | true |
e360772a430964de6fdc6e7edb7bd34c86bb3ef2 | JavaScript | fernandocesarsp/Javascript_do_Iniciante_ao_Mestre | /8.Eventos/aula7/js/main.js | UTF-8 | 451 | 2.71875 | 3 | [] | no_license | (function() {
'use strict';
var $form = document.querySelector('form');
var $txtUser = document.getElementById('txtUser');
var $txtPass = document.getElementById('txtPass');
var $btn = document.getElementById('btn');
$form.addEventListener('submit', function(e) {
if(!$txtUser.value || !... | true |
5932711ef7fcee425747687d2a02e1fc12b5e2f3 | JavaScript | jmblontoc/Likha-Capstone | /capstone/configurations/static/configurations/js/interventions.js | UTF-8 | 1,980 | 2.59375 | 3 | [] | no_license | $(function() {
const modal = $("#intervention-modal");
const saveBtn = $(".save");
var html = "<div class='m-2'>" +
"<input class='form-control intervention-input' placeholder='Enter intervention'>" +
"</div>";
modal.on('show.bs.modal', function(e) {
const but... | true |
a15a26174bd95a2e30a5c2abd2878ac43a92b75f | JavaScript | 0x300/fetch-images-node | /fetch-images.js | UTF-8 | 1,102 | 2.953125 | 3 | [] | no_license | const fs = require("fs");
const https = require("https");
const imageUrls = JSON.parse(fs.readFileSync("images.json"));
const baseUrl = "https://static.wixstatic.com/";
imageUrls.map(relUrl => {
let fileName = relUrl.split("/")[1];
fetchImage(relUrl, fileName);
});
function fetchImage(relUrl, fileName) {
... | true |
818b8ee85f24aada1beeff5be44098269f297543 | JavaScript | luca16/tesi_magistrale | /sitoWeb/intelligence.js | UTF-8 | 5,034 | 2.6875 | 3 | [] | no_license | var intelligence = []
var categoryDate = [];
// set the dimensions and margins of the graph
var marginintel = { top: 20, right: 30, bottom: 40, left: 300 },
widthintel = 1250 - marginintel.left - marginintel.right,
heightintel = 750 - marginintel.top - marginintel.bottom;
newHeightintel = heightintel - 50
... | true |
9772c04ae31398b899cf6530d812357ff31eba70 | JavaScript | alexcrhdz/ajax_test | /app.js | UTF-8 | 2,942 | 2.703125 | 3 | [] | no_license | $(document).ready(function () {
let edit = false;
$('#task_result').hide();
list_tasks();
$('#search').keyup(function (e) {
if ($('#search').val()) {
let search = $('#search').val();
$.ajax({
url: 'task_search.php',
type: 'post',
... | true |
2d368b9f0a84d464f277733bbda673a8094c0f24 | JavaScript | ccerv012/CECS544 | /ReusableJavascript/Cookies.js | UTF-8 | 745 | 2.984375 | 3 | [] | no_license | function setCookie(cookieName, cookieValue, maxDays){
var date = new Date();
date.setTime(date.getTime() + (maxDays*24*60*60*1000));
var expires = "expires="+date.toUTCString();
document.cookie = cookieName + "=" + cookieValue + "; " + expires + ";domain=;path=/";
}
function getCookie(cookieName... | true |
bbd019f95ad2e96043a0d2ce752de484a0d0b2b6 | JavaScript | tianshaojun/shundian | /js/login.js | UTF-8 | 3,371 | 2.703125 | 3 | [
"MIT"
] | permissive | window.onload=function(){
//关闭广告条
var advertist=document.getElementById("advertist");
var close=advertist.children[1];
close.onclick=function(){
advertist.style.display="none";
}
//验证用户名
var txt1=document.getElementById("txt1");
//获得焦点事件
txt1.onfocus=... | true |
20fcf732c98611aef4b8d6c92d999d392084199f | JavaScript | nesterov1X3/gromcod | /JS/lesson22/hw10/index.js | UTF-8 | 4,671 | 3.171875 | 3 | [] | no_license | // const tasks = [
// { text: "Buy milk", done: false },
// { text: "Pick up Tom from airport", done: false },
// { text: "Visit party", done: false },
// { text: "Visit doctor", done: true },
// { text: "Buy meat", done: true },
// ];
// const renderListItems = (listItems) => {
// const ... | true |
1a9ec1b8327b2623e9d693fe3e781dad0972c6f0 | JavaScript | youngcm2/mongo-indexes | /src/sync.js | UTF-8 | 5,130 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | const mongoist = require('mongoist');
const _ = require('underscore');
const extend = require('extend');
const async = require('async');
const collectIndexDetailsFromDatabase = require('./collectIndexDetailsFromDatabase');
const collectIndexDetailsFromFile = require('./collectIndexDetailsFromFile');
const indexUpdate... | true |
c3fde2e88e865dae71bc20fa1ece8f7794d85028 | JavaScript | PeteSalcedo/CodeWars | /stepsinrimes.js | UTF-8 | 371 | 3.171875 | 3 | [
"MIT"
] | permissive | let isPrime = function(n){
if(n % 2 === 0 || n < 2) { return false; }
if(n===2) { return true;}
for(let i = 3; i <= Math.sqrt(n); i+=2){
if(n % i === 0) { return false; }
}
return true;
}
let step = function(g, m, n){
for(let i = m, idx = 0; i <= n; i++){
if(isPrime(i) && isPrim... | true |
a63db84505f67eefb510de051e33c099e35540c1 | JavaScript | sainihal/masai-sprint-3 | /JS API Project/history.js | UTF-8 | 7,266 | 3.3125 | 3 | [] | no_license | document.getElementById("home").addEventListener("click", navToHome)
var historyURL = "https://api.spacexdata.com/v3/info"
var apiInfoURL = "https://api.spacexdata.com/v3"
var historicalEventsURL = "https://api.spacexdata.com/v3/history"
var getHistoricEventByID = "https://api.spacexdata.com/v3/history"
docume... | true |
d7629c1391932e1d2a3d59a6e5566887e4c5889b | JavaScript | anagha-ravinarayan/spock-rock-game | /script.js | UTF-8 | 4,964 | 3.0625 | 3 | [] | no_license | import { startConfetti, removeConfetti } from "./confetti.js";
const playerScoreEl = document.getElementById('player-score');
const playerChoiceEl = document.getElementById('player-choice');
const computerScoreEl = document.getElementById('computer-score');
const computerChoiceEl = document.getElementById('computer-ch... | true |
1a675b92e41d8573b1431b24a646c6903cd647b5 | JavaScript | VisheshSingh/npm_app | /index.js | UTF-8 | 138 | 2.65625 | 3 | [] | no_license | const _ = require('lodash');
const numbers = [72,52,0,4,52,26,5,12,42];
_.each(numbers, function(number, i){
console.log(number);
}); | true |
cdd9f0fd1c8ade434527a01d2451fdf9e9e851b0 | JavaScript | tao159/node_study | /10nodejs回调和事件驱动/model/getMimefromfile_callback.js | UTF-8 | 207 | 2.53125 | 3 | [] | no_license | exports.getMime = function(fs, extname, callback) {
var data = fs.readFileSync('./mime.json');
var mime = JSON.parse(data.toString());
var res = mime[extname] || 'text/html';
callback(res);
} | true |
2508a087bebb55120932006ad1c7afff47eb5e8f | JavaScript | Kanakr1/toy-problems-2 | /problems/linkedListReversal/src/linkedListReversal.js | UTF-8 | 411 | 3.875 | 4 | [] | no_license | /**
* Implement a linked list. Once you've done that, write a function that
* performs an in-place reversal on your linked list.
*
* Extra credit: Rewrite your linked list and reversal function in CoffeeScript.
*/
var createLinkedList = function() {
var linkedList = {};
// Your supporting code/methods here
... | true |
204eabb5c00310f26c7c0b935c9be50afdc672c8 | JavaScript | lshiffer/elevatorSim | /src/Floor.js | UTF-8 | 1,049 | 3.109375 | 3 | [] | no_license |
class Floor {
constructor(level) {
this.level = level;
this.buttonUp = new Button(Button.Direction.Up);
if (level > ElevatorController.MIN_FLOORS)
this.buttonDown = new Button(Button.Direction.Down);
this.makeGui();
this.listenForEvents();
}
makeGui() {
var html = "<div id=\"floor"+this.level+"\"... | true |
786e5beb9241fcd11759e25bad4f008a2bc1c848 | JavaScript | andredo11/snake | /script.js | UTF-8 | 5,103 | 2.859375 | 3 | [] | no_license | var cx, cy, grow, snakePos, dir, canvas;
var decPos = [];
var sq = 25;
var sqPerc = 0.8;
var cHeight = 30,
cWidth = 50;
var gameOver = false;
var foodx, foody;
function addFood() {
while (true) {
foodx = Math.floor(Math.random() * cWidth);
foody = Math.floor(Math.random() * cHeight);
va... | true |
bb5e4d489090f46cd7d708d494b9fac5534159a9 | JavaScript | erikAlon/React-II | /instagram/src/components/PostContainer/PostContainer.js | UTF-8 | 2,267 | 2.6875 | 3 | [] | no_license | import React, { Component } from 'react';
import CommentSection from '../CommentSection/CommentSection'
import PropTypes from 'prop-types';
class PostContainer extends Component {
constructor (props) {
super(props);
this.state = {
commentPostsArray: this.props.thing.comments,
}
... | true |
c021fc947f6ff447336be3051b19fed88abab8d7 | JavaScript | gauravkdeshmukh/google-codejam | /2017/1B/B/Solution.js | UTF-8 | 4,373 | 3.015625 | 3 | [
"MIT"
] | permissive | // node Solution.js < B-small-practice.in > B-small.out
// node Solution.js < B-large-practice.in > B-large.out
// O(?)
function main() {
var testCases = nextInt();
for (var testCase = 1; testCase <= testCases; ++testCase) {
var N = nextInt();
var unis = [];
var mapping = ["R", "O", "Y", "G", "B", "V"... | true |
d7a7bdab46c5a398a079deab563594c8dd90ab55 | JavaScript | PlaThyme/PlaThyme | /client/src/components/ToolTip.js | UTF-8 | 937 | 2.640625 | 3 | [
"MIT"
] | permissive | import React from "react";
/**
* Tooltip generates a text popup based upon the
* @param {JSX} children -
* @param {String} text -
*
* @return this function returns a tooltip.
* */
const ToolTip = ({ children, text }) => {
const ttRef = React.createRef();
const mouseEnter = () => {
ttRef.curre... | true |
be275c51a65d60c78a9a8a1844a61a20a633456d | JavaScript | zakbain/coverMyMeds1 | /script.js | UTF-8 | 973 | 3.75 | 4 | [] | no_license | window.onload = function() {
var indeces = [0, 1, 2, 3, 4]
var friends = ['Ray', 'Oscar', 'Gwen', 'Bob', 'Marie'];
var colors = ['red', 'orange', 'green', 'blue', 'magenta'];
var contrastingColors = ['green', 'black', 'red', 'yellow', 'green'];
printGreetings(friends, colors, contrastingColors, indeces);
}
functi... | true |
06871c29db3117a8501340562aa4343b1fb5f741 | JavaScript | prabhat1284/ecommerce | /src/components/Contact.js | UTF-8 | 4,041 | 2.765625 | 3 | [] | no_license | import React, { useState } from "react";
import axios from "axios";
function Contact() {
const [enteredName, setEnteredName] = useState("");
const [enteredEmail, setEnteredEmail] = useState("");
const [enteredPhone, setEnteredPhone] = useState("");
const [enteredMessage, setEnteredMessage] = useState("");
c... | true |
90a815a6c7c1ebf671e0a9094d3834f088edf539 | JavaScript | sketchdev/wrestler | /lib/strategy.js | UTF-8 | 1,235 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
const UnknownError = require('./errors').UnknownError;
class Context {
constructor() {
this.advance = true;
this.error = undefined;
}
stop(error) {
this.advance = false;
this.error = error;
}
hasError() {
return !!this.error;
}
shouldStop() {
return !this.advanc... | true |
c477d6cf5a7bab3f6045a205477ddc07e48941f3 | JavaScript | DannyMcwaves/learn-es6 | /docs/prototype.js | UTF-8 | 2,840 | 4.375 | 4 | [
"BSD-3-Clause"
] | permissive | // P R O T O T Y P E W I T H J S
/*
JavaScript prototyping is method of inheritance implememted by JavaScript.
inheritance is a way of gaining properties defined on another Object.
By inheritance, we can get methods and properties defined
on other objects.
LET US SEE THIS IN PRACTICE WIT AN EXAMPLE.
you should kno... | true |
0ea6da78e90dc4cccfbad6eaf5c4ff9b291d1264 | JavaScript | ivernaloo/estate-analysis | /example/fullstack/project/spider/pool.js | UTF-8 | 3,010 | 2.8125 | 3 | [] | no_license | /*
直接爬取并出现错误
*/
//用mongodb实现并行爬取
//
//
var request = require('request');
var fs = require('fs');
//
var Mongo = require('./../mongo');
var poolCount = 20;
var timeout = 100;
/*
* addresses
* source {Array} properties code array
* */
function Pool(source){
this.source = source;
this.reset();
this.init();
}
... | true |
32b6907d88a2001722e3dbb70bb09a86bb07610f | JavaScript | Lightman3/bseries-t9 | /app/assets/javascripts/components/login.jsx | UTF-8 | 3,083 | 2.796875 | 3 | [] | no_license | class Login extends React.Component {
constructor(props) {
super(props);
this.state = {
email: '',
password: '',
showError: false,
sending: false
};
this.handleChangeEmail = this.handleChangeEmail.bind(this);
this.handleChangePass = this.handleChangePass.bind(this);
t... | true |
77e098c32771fe6f6984711f46163ceba0d40fa7 | JavaScript | Tauqeer1/node-course | /notes-app/app.js | UTF-8 | 265 | 2.578125 | 3 | [] | no_license | const fs = require('fs');
const addFunction = require('./utils');
const getNotes = require('./notes');
// fs.writeFileSync('notes.txt', 'Test file 1');
// fs.appendFileSync('notes.txt', 'append the text');
console.log(addFunction(2, 3));
console.log(getNotes());
| true |
76c372b819b486b6499c7a7a584a30879abf5a85 | JavaScript | aga-github/task-14.6 | /js/counter.js | UTF-8 | 1,222 | 2.796875 | 3 | [] | no_license | var Counter = React.createClass({
propTypes: {
obj: React.PropTypes.object.isRequired,
},
componentDidMount() {
console.log('This method is a good place to set up any subscriptions');
},
componentWillUnmount() {
console.log('If you set up subscription, dont forget to unsubs... | true |
ee1ae241357bcddb0afe1a3aadb5fea4110e897d | JavaScript | terequell/diploma | /backend/controllers/AuthController.js | UTF-8 | 3,498 | 2.671875 | 3 | [] | no_license | import bcrypt from 'bcrypt';
import AuthService from '../services/AuthService.js';
import { checkRegisterFieldsValid } from '../helpers/auth.js';
import { STATUS_CODES } from '../constants/statusCodes.js';
const SALT_ROUNDS = 10;
class AuthController {
async register(request, response) {
try {
... | true |
c7acaded342d556da8ab70295f03e464b3953a5c | JavaScript | nabs-grg/codewars | /7kyu/Find_The_Capitals.js | UTF-8 | 196 | 3.171875 | 3 | [] | no_license | var capitals = function (word) {
var newArray = [];
for(var i = 0; i < word.length; i++){
if(word[i] == word[i].toUpperCase()){
newArray.push(i);
}
}
return newArray;
}; | true |
1021841952ede430a134c5606cd8385ee4cbf969 | JavaScript | youchief/questionme | /app/webroot/js/game.js | UTF-8 | 1,022 | 2.53125 | 3 | [] | no_license | $(window).ready(function(){
setTimeout(function(){
var qImg = document.querySelector('img.question_media')
if(qImg !== null){
var qImgWidth = document.querySelector('img.question_media').naturalWidth;
if(qImgWidth > $('img.question_media').... | true |
0ebd548df4841369c2020c683ef99ae345c6ca11 | JavaScript | maximumayo/lf-practice | /practice21/answer.js | UTF-8 | 172 | 3.15625 | 3 | [] | no_license | answer.js
function bipolar(){
for (var i = 0, j = 0; i <= 100, j >= -100; i++, j--){
console.log('i is: ' + i + ' and ' + 'j is: ' + j);
}
}
bipolar(); | true |
75e362df05c4738ac3671d99c253cdb9404a888e | JavaScript | OmaymaMajid/Social-Network | /Backend/Routes/API/posts.js | UTF-8 | 1,899 | 2.515625 | 3 | [] | no_license | const express = require('express');
const mongoose = require('mongoose');
const router = express.Router();
const Post = require('../../Models/PostModel');
//@route Get api/posts/
//@desc get all posts
//@access public
router.get("/", (req,res)=>{
Post.find({},async(err,data)=>{
if(err){
await ... | true |
b7445390633c214408ee4afb131c56b2264892a2 | JavaScript | maslhiro/Sharing_Context_Redux | /src/example/redux_tookit/index.js | UTF-8 | 1,680 | 2.5625 | 3 | [] | no_license | import React, { useState } from "react";
import { createStore } from "redux";
import { Provider, useDispatch, useSelector, shallowEqual } from "react-redux";
import { createSlice } from "@reduxjs/toolkit";
const initialState = { num: 0 };
const counterSlice = createSlice({
name: "counter",
initialState,
reducer... | true |
ebd6b4a109b35a09c4f7e10634dfbd0765ac9433 | JavaScript | keidrun/basic-algo-js | /test/BinarySearchTree-test.js | UTF-8 | 4,597 | 3.390625 | 3 | [
"MIT"
] | permissive | const expect = require('chai').expect;
const BinarySearchTree = require('../src/BinarySearchTree');
const prepareBST = () => {
let bst = new BinarySearchTree(50);
bst.insert(30);
bst.insert(70);
bst.insert(100);
bst.insert(60);
bst.insert(59);
bst.insert(20);
bst.insert(45);
bst.insert(35);
bst.ins... | true |
19c7fbe6208bc6a3d654d7025f065e4c5da48474 | JavaScript | benbaba2525/TriviaGame | /assets/javascript/app.js | UTF-8 | 9,179 | 3.46875 | 3 | [] | no_license | $(document).ready(function () {
var triviaGame;
var correct;
var incorrect;
var unanswered;
var randomTrivia;
var computerPick;
var userAnswer;
var timer; // Interval Demonstration , Set our time counter to 15.
var running;
var intervalId; // Variable that will hold our interval ID when we execute , the "run" funct... | true |
c10c31d4e052783fdd0345dbff51bf5cca15a54b | JavaScript | dantetam/twitterServerAuth | /routes/twitter/twitterStoreDatabase.js | UTF-8 | 5,427 | 2.828125 | 3 | [
"MIT"
] | permissive | /**
Methods for the Twitter endpoint/routing middleware that deal specifically with mongoDB interfacing and storage,
i.e. creating or retrieving tweets, and using the Tweet/TwitterUser schema.
*/
var async = require("async");
var textUtil = require("./textanalysis/textUtil.js");
var UniqueTweet = require("../../mode... | true |
b2f94bb6a9cba05c5f42c900149042c185939f40 | JavaScript | irisaim/Apple-World---E-commerce-website | /src/ui.js | UTF-8 | 5,867 | 2.859375 | 3 | [] | no_license | import { addProductsInLocalStorage, updateQuantityInLocalStorage, getElementFromLocalStorage, removeElementFromLocalStorage } from './localStorage.js';
class UI {
constructor() {
this.productsDiv = document.getElementById('products');
this.detailsDiv = document.getElementById('products-details');
... | true |
3835b601d25146c38d5999e7c09f5ddf9c592427 | JavaScript | konaraddi/interview-prep | /old_interview_prep/src/leetcode/002/02.js | UTF-8 | 851 | 3.546875 | 4 | [] | no_license | /**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} l1
* @param {ListNode} l2
* @return {ListNode}
*/
var addTwoNumbers = function (l1, l2) {
let p1 = l1
let p2 = l2
const dummyHead = { val: null, next: null }
... | true |
a10ef0c12fdfab1ab5d2096f26d5f71c8ea1dccd | JavaScript | gamkedo-la/we_must_prepare | /js/Items.js | UTF-8 | 11,961 | 2.59375 | 3 | [] | no_license | const WATERCAN_START_VOLUME = 100;
const WATERCAN_CAPACITY = 100;
const WATERCAN_USE_RATE = 5;
const WATERCAN_FILL_RATE = 20;
let itemTrackingArray = [];
let ItemCode = Object.freeze({
NOTHING: 0,
METAL: 1,
STONE: 2,
WOOD: 3,
AXE: 4,
WATERCAN: 5,
HOE: 6,
PICKAXE: 7,
SEED_CORN: 8,
... | true |
36da2d7417a4fa613cc13f3b56e2761b3e0db988 | JavaScript | PhantomBlade18/Employee-Access-Portal | /EAP/validation.js | UTF-8 | 364 | 2.875 | 3 | [] | no_license | submitButton = document.getElementById("submitButton").addEventListener("click",passwordMatch)
function passwordMatch(e)
{
let f1 = document.getElementById("pass").value;
let f2 = document.getElementById("cpass").value;
if(f1 != f2 )
{
alert("Passwords do not match");
... | true |
a999040ef700dc84ab66cbb040ebc7a534aed82e | JavaScript | FalahHAbbas/Research-Helper | /content.js | UTF-8 | 6,956 | 2.71875 | 3 | [
"MIT"
] | permissive | function sendMessage(message) {
return new Promise((resolve, reject) => {
try {
chrome.runtime.sendMessage(message, resolve);
} catch (err) {
reject(err);
}
});
}
// window.addEventListener('state-changed', function (e) {
// if (document.title.includes('watch... | true |
aad92d923e47f1dc5b7cf9ad77c0207d874e3d00 | JavaScript | saracarlile/More-JavaScript | /closure.js | UTF-8 | 245 | 4.03125 | 4 | [] | no_license | //Another closure example
function multiply(number1) {
return function(number2) {
return number1 * number2;
};
}
var threeTimes = multiply(3);
console.log(threeTimes(6));
//18 -- 3 * 6
console.log(threeTimes(4));
//12 -- 3 * 4
| true |
8939363795566645241e042af901ef7f235a5726 | JavaScript | Francesco-Rizzi/Learning-and-Courses | /d3/joins/d3-joins.js | UTF-8 | 1,446 | 3.125 | 3 | [] | no_license | (async () => {
const width = '300';
const svg = d3.select('body')
.append('svg')
.attr("width", width)
.attr("height", 33)
.attr("viewBox", `0 -20 ${width} 33`)
const wait = async (time) => await new Promise((r) => setTimeout(r, time));
const randomLetters = () => {
... | true |
3a211a081547de815e46cf13a5bbeb27d1883e00 | JavaScript | allen3680/oceal-linebot | /src/helper/reply-helper.js | UTF-8 | 2,157 | 2.71875 | 3 | [] | no_license | 'use strict';
const questionList = require('./question-list');
function reply(event) {
var userId = event.source.userId;
var replyMsg = `${event.message.text}`;
if (replyMsg == '請問') {
event.reply(questionList.questionList);
return;
}
if (/pdf/i.test(replyMsg)) {
event.reply('pdf')... | true |
ca31742f563b51d429269af0a33a0665d2d109a5 | JavaScript | GuilhermeTafelli/ranking-pro | /src/app/controllers/GamificationController.js | UTF-8 | 893 | 2.515625 | 3 | [] | no_license | const GamificationService = require("../services/GamificationService")
const ExceptionHandler = require("../exceptions/ExceptionHandler")
class GamificationController{
async create(req, res){
try {
if(!req.roles.includes("ADMIN")) throw new Exception(ErrorCode.PERMISSION_DENIED)
... | true |
57d565ddb4ab0f1bd18a71d6327335d9a068d647 | JavaScript | jurijkos/racunalna-grafika | /lab3/main2.js | UTF-8 | 7,509 | 3.03125 | 3 | [] | no_license | const WIDTH = 700
const HEIGHT = 600
const PI = Math.PI
let count = true
let difficulty
let requestId
let stoped = false
let canvas, ctx, keystate, menu, winText
let player, ai, ball
let aiResult = 0,
playerResult = 0
keystate = {
up: false,
down: false,
}
player = {
x: null,
y: null,
width: 20,
height: ... | true |
8474cbf90854137973c49bd588cc0930d4e0486b | JavaScript | strawberry-grace/ToDo-app | /Desktop/Atom/eloquent-js/ch2.js | UTF-8 | 2,038 | 4.84375 | 5 | [] | no_license | //Exercise 1:
//Write a loop that makes seven calls to console.log to output the following triangle:
//#
//##
//###
//####
//#####
//######
//#######
//
//My Solution:
function triangle() {
let string = "";
for (let i = 0; i < 7; i++) {
string += '#';
console.log(string);
}
}
//Exercise 2:
//Write a pr... | true |
a2419c8ef6fea4f4e2486b68b39b6cec0fb6f460 | JavaScript | IanSavchenko/AdventOfCode2018 | /17/task.js | UTF-8 | 2,759 | 3.09375 | 3 | [
"MIT"
] | permissive | let _ = require('lodash');
let fs = require('fs');
let util = require('../util');
// INPUT PROCESSING
let map = util.arr2dInit(2000, 2000, '.');
let data = fs.readFileSync(__dirname + '/input.txt', 'utf8').trim();
let min = Number.MAX_SAFE_INTEGER;
let max = 0;
util.splitLines(data).map(line => {
if (line[0] === '... | true |
f194b7d2c005854ffcc3da565b9d6bf790fdf5d5 | JavaScript | divawth/validator | /test/test.js | UTF-8 | 3,559 | 2.8125 | 3 | [] | no_license | var assert = require('assert');
const Validator = require('../index').Validator
const validator = new Validator(
function (rule, value, errorType, rule) {
return errorType
}
)
describe('validate', function() {
it('int', function() {
let errors = validator.validate(
{
age1: 10,
ag... | true |
1cfe5824510bb1939d34d264e5640ccd5ae5e125 | JavaScript | ChloeLiang/goal-tracker | /models/user.js | UTF-8 | 1,061 | 2.71875 | 3 | [
"MIT"
] | permissive | var sha256 = require('js-sha256');
module.exports = (pool) => {
const create = (user) => {
return new Promise((resolve, reject) => {
const hashedValue = sha256(user.password);
const queryString = 'INSERT INTO users (name, password) VALUES ($1, $2) RETURNING *';
const values = [
user.nam... | true |
fc3cb5e36fac8424123c8df293a7480b887de163 | JavaScript | mostafa-dci/fbw5 | /recursion/app.js | UTF-8 | 1,269 | 4.09375 | 4 | [] | no_license | // let sorage = 0;
// for (let i = 0; i < arr.length; i++) {
// if (typeof arr[i] == "object") {
// for (let j = 0; j < arr[i].length; j++) {
// if (typeof arr[i][j] == "object") {
// for (let k = 0; k < arr[i][j].length; k++) {
// sorage += arr[i][j][k]
// ... | true |
6b109851808ab069082b7c2fb87ab813c3820fd3 | JavaScript | frontend-park-mail-ru/2017_1_StepFight | /src/js/support/element-creator/ElementCreator.js | UTF-8 | 1,806 | 3.359375 | 3 | [
"MIT"
] | permissive | /**
* Created by Denis on 21.05.2017.
*/
export default class ElementCreator {
/**
* Получить массив элементов
* @param elements - инструкции по созданию
* @private
*/
static getElems(elements) {
return elements.map(data => {
let elem = document.createElement(data.typ... | true |
8c639badcd6dfc6a72ea3aa761ea075f9e4e90dd | JavaScript | macmac2197/site-app-ui | /src/redux/reducers/posts.js | UTF-8 | 2,134 | 2.59375 | 3 | [] | no_license | import { POSTS_ACTIONS_TYPE } from '../actions/posts';
const IPostState = {
posts: [],
post: null,
currentPage: 1,
numberOfPages: 1,
isLoading: true
}
export const posts = (state = IPostState, action) => {
switch (action.type) {
case POSTS_ACTIONS_TYPE.START_LOADING:
return ... | true |
91a17b68e6896c4fb73915ff6c9e11b196877317 | JavaScript | hucaihongranbow/juhui | /js/hotsale.js | UTF-8 | 6,769 | 2.609375 | 3 | [
"MIT"
] | permissive | window.onload=function (){
// 封装获取模版
var Util={
// 获取模版内容
tpl:function (id)
{
return document.getElementById(id).innerHTML;
}
};
// 组建模版
// 第一开模块
var Index_;
var home=Vue.extend({
template: Util.tpl('home'),
data:function ()
{
return {
banner:"",
adt:"",
... | true |
364492f6d3760a4b6d632d77a6e41dd65dee3b9b | JavaScript | darianelski/nelski-jsforms | /js/check-comment.js | UTF-8 | 1,499 | 2.859375 | 3 | [] | no_license | $(document).ready(function(){
(function(){
var commentFormCheck = {
isValid: true,
init: function() {
//вызов внутренних функций
this._setUpListeners(); //прослушка событий
},
_setUpListeners: function() {
$('#comment-form').on('submit', commentFormCheck._validateForm).on('submit', commen... | true |
0ea447a51121819d3af316fd121e92708039c03b | JavaScript | glenstaes/google-kick-start | /2021/Round G/2-staying-hydrated/staying-hydrated.js | UTF-8 | 1,676 | 3.25 | 3 | [] | no_license | // 18:07
const fs = require('fs');
const input = fs.readFileSync('./stayingHydrated.sample1.txt', 'utf8').trim().split('\n');
let currentLine = 0;
function readLine() {
return input[currentLine++]
}
console.time('solve');
let T = readLine();
for (let i = 1; i <= T; i++) {
const [x, y] = solve(i);
consol... | true |
6afe4f30dc5190cdcbd01f7f151c29f80487af73 | JavaScript | VyomDave/selfie2 | /main.js | UTF-8 | 952 | 2.78125 | 3 | [] | no_license | var SpeechRecognition = window.webkitSpeechRecognition ;
var recognizer = new SpeechRecognition ;
function start(){
document.getElementById("textbox").innerHTML="";
recognizer.start()
}
recognizer.onresult=function getresults(event){
console.log(event)
var content = event.results[0][0].transcr... | true |
7d0c0deaa77e56d5980a7263b5e0fb8df2c7449f | JavaScript | mintutu/react_sample | /public/note.js | UTF-8 | 2,008 | 2.921875 | 3 | [] | no_license | var list;
var Note = React.createClass({
getInitialState() {
return {onEdited: false};
},
editNote() {
this.setState({onEdited: true});
},
submitNote() {
var note = this;
$.post("/edit-note", {id: this.props.id, value: this.refs.text.value},
function(data){
list.setState({array: dat... | true |
e29b7043454e15df2ad884f6dce1b60f6fc1c77f | JavaScript | liz282907/leetcode | /code/hash table/ Isomorphic Strings.js | UTF-8 | 1,070 | 3.734375 | 4 | [] | no_license | /**
* Given two strings s and t, determine if they are isomorphic.
Two strings are isomorphic if the characters in s can be replaced to get t.
All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character but a charact... | true |
8625a1ce94ae92f42a86b204f3f7d280cf5ef046 | JavaScript | ColdKoto/algorithms | /7/average.js | UTF-8 | 134 | 3.265625 | 3 | [] | no_license | function average(arr){
let sum = arr[0];
for(let i = 1; i < arr.length; i++){
sum += arr[i];
}
return sum / arr.length;
}
| true |
8ba35e5afe001e8adcbd2a57c45f58712bca11a4 | JavaScript | hatasaki/flatris | /web/reducers/cur-user.js | UTF-8 | 597 | 2.6875 | 3 | [
"MIT"
] | permissive | // @flow
import type { User, State } from 'shared/types/state';
import type { Action } from 'shared/types/actions';
const initialState = null;
export function curUserReducer(
state: ?User = initialState,
action: Action
): ?User {
switch (action.type) {
case 'AUTH': {
const { user } = action.payload;
... | true |
9d71d9a31ab79f7faaab32b89c5aeecf5112481c | JavaScript | Nalipp/cs_concepts | /hacker_rank/algorithms/strings/easy/hacker_rank_in_a_string.js | UTF-8 | 315 | 3.84375 | 4 | [] | no_license | // Input
// 'hereiamstackerrank'
// 'hackerworld'
// Output
// YES
// NO
// var s = 'hereiamstackerrank';
var s = 'hackerworld';
let word = 'hackerrank'
let count = 0;
for (let i = 0; i < s.length; i++) {
if (s[i] === word[count]) count += 1;
}
console.log((count === word.length) ? 'YES' : 'NO');
| true |
601c4c1ab9bbbde445def7a2c0d5088875136a9e | JavaScript | chengsieuly/Ufree | /reducers/auth_reducer.js | UTF-8 | 2,769 | 3.046875 | 3 | [] | no_license | import {
FACEBOOK_LOGIN_SUCCESS,
FACEBOOK_LOGIN_FAIL,
FACEBOOK_FETCH_DATA,
ADD_FRIEND,
FACEBOOK_LOGOUT,
DEL_FRIEND,
UPDATE_AVAIL,
FETCH_FRIENDS
} from '../actions/types';
import firebase from 'firebase';
import _ from 'lodash';
const INITIAL_STATE = {token:null}
export default function(state=INITIA... | true |
8782c1300949c62823333b222f8abbb7c618a5af | JavaScript | AShariff0786/Fantasy_Website | /routes/database.js | UTF-8 | 50,090 | 2.5625 | 3 | [
"MIT"
] | permissive | const express = require('express');
const mongoose = require('mongoose');
const Team = require('../models/teams');
const Player = require('../models/players');
const SeasonAvg = require('../models/seasonavgs');
const SeasonStats = require('../models/seasonstats');
const SeasonStatsTotal = require('../models/seasonstats... | true |
d93a2f6d693a66d18d1163e0b1be51ce28a41aef | JavaScript | mcanthony/xeoengine | /src/rendering/layer.js | UTF-8 | 8,221 | 3.5 | 4 | [
"MIT"
] | permissive | /**
A **Layer** specifies the render order of {{#crossLink "GameObject"}}GameObjects{{/crossLink}} within their {{#crossLink "Stage"}}Stages{{/crossLink}}.
## Overview
<ul>
<li>When xeoEngine renders a {{#crossLink "Scene"}}Scene{{/crossLink}}, each {{#crossLink "Stage"}}Stage{{/crossLink}} within that will rende... | true |
b27b0ca3e696225a6ab7a1f7a5728a28593cc475 | JavaScript | marco-carrillo/google-books | /routes/api/googleAPI.js | UTF-8 | 1,479 | 2.6875 | 3 | [] | no_license | //******************************************************************************************/
// This file will manage the call to the google API. In a way, it is an API that */
// makes an API call. The reason for doing so in the server rather than directly from */
// the browser is not to expose the A... | true |
0af6f97ef7cd12c153fd99069de91128a86ebcc4 | JavaScript | ilieionutcosmin/dell-challenge | /DellChallenge/DellChallenge.D3.React/src/components/editproduct.js | UTF-8 | 3,403 | 2.53125 | 3 | [] | no_license | import React, { Component } from "react";
import Validation from "../validation";
class EditProduct extends Component {
constructor(props) {
super(props);
this.state = {
Name: props.location.state.name,
Category: props.location.state.name,
Id: props.location.sta... | true |
ae4b7a2b629d3ec0246821f085f58e569274fa2c | JavaScript | DanielaDominguez/JavaScript-Avanzado | /15-fetch.js | UTF-8 | 349 | 3.578125 | 4 | [] | no_license | /* Fetch nos permite hacer peticiones http desde JavaScript */
/* Accedemos a un recurso de un servidor */
/* JSON = javascript object notation */
const peticion = fetch('https://jsonplaceholder.typicode.com/todos/1')
.then(resp => resp.json()).then(data => {
console.log(data);
}) .catch(e => {
console.log(e);... | true |
1aca8edd63cc323d192008c1a803ab983d1285cc | JavaScript | Arielgmv/master_javascript | /hola-mundo/js/22-ambito.js | UTF-8 | 309 | 3.71875 | 4 | [] | no_license | 'use strict'
function holaMundo(texto) {
//variable local dentro de la función
var hola_mundo='Texto dentro de función';
console.log(texto);
console.log(typeof numero.toString());
console.log(hola_mundo);
}
var numero=12;
var texto='Hola mundo soy una variable global';
holaMundo(texto); | true |
bed4639533fc73ec1fbe6feb7f380cf59eb75d6d | JavaScript | anurag-saran/APIsand3Scale | /RestAPI-Testing/walmart.js | UTF-8 | 1,039 | 3.015625 | 3 | [] | no_license | // Demonstrates the API Managemement traffic managament capabilities
// Rate Limiting policy
// Uses the Walmart Search API which has Rate limiting set to 5 calls/second
var request = require('request')
// Please register on https://developer.walmartlabs.com to get an API key
// Substitute the key here to try out
var ... | true |
9ca8011140253a23996667ad5607fb2ae51b625b | JavaScript | shmanzar/data-structures | /weekly-assignment-02/app.js | UTF-8 | 1,042 | 2.953125 | 3 | [] | no_license | // npm install cheerio
var fs = require('fs');
var cheerio = require('cheerio');
// load the thesis text file into a variable, `content`
// this is the file that we created in the starter code from last week
let filename = 'data/m04'
var content = fs.readFileSync(filename + '.txt');
// load `content` into a cheerio ... | true |
9016f114e00d9554541ef4e4a7cf5fda76b3db59 | JavaScript | avani26/pro-28 | /Mango.js | UTF-8 | 592 | 2.65625 | 3 | [] | no_license | class Mango{
constructor(x,y,r){
var options={
isStatic:true,
restitution:0.0,
friction:1,
}
this.r=r;
this.body= Matter.Bodies.circle(x,y,r,options);
this.image=loadImage("mango.png");
World.add(world,this.body);
}
... | true |
5148d2b4ae48e74d6b279b5ff215dfa174abd67c | JavaScript | flashdesignory/javascript | /algorithms/string/string.keypad.js | UTF-8 | 962 | 3.40625 | 3 | [] | no_license | /*
* @title: Keypad combinations
* @description: find all number keypad combinations of input
* @author: Thorsten Kober
* @email: info@flashdesignory.com
*/
const chars = ['', '', 'abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz'];
function createKeypadWords(arr) {
const result = [];
function create(... | true |
6a8c7d99471a213a624492cb72bd5a8bd5f22f9c | JavaScript | philbrookes/DungeonMMO | /client-code/Engine/Render/Scene.js | UTF-8 | 1,686 | 2.5625 | 3 | [] | no_license | Engine.Render.scene = function(){
this.camera = {};
this.clearColor = "#000000";
this.layers = [];
};
Engine.Render.scene.prototype = {
addRenderItem: function addRenderItem(item, layer){
if(typeof this.layers[layer] == 'undefined'){
this.layers[layer] = {
RenderItem... | true |
66821fefec2259f45e40c77231dfb6456f80f201 | JavaScript | ShawnOakley/wec | /src/spec/components/productDisplay/productDisplay.test.js | UTF-8 | 8,964 | 2.53125 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import { shallow, mount, render, configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import ProductDisplay from '../../../components/productDisplay';
configure({ adapter: new Adapter() });
// test file
let productDisplay;
const initi... | true |
b80f90b55aa9546cb1bd693ec08e71b79cddcb21 | JavaScript | kube-HPC/parsers.hkube | /lib/helpers.js | UTF-8 | 6,848 | 2.546875 | 3 | [] | no_license | const objectPath = require('object-path');
const flatten = require('flat');
const RELATIONS = require('./const/relations');
const INPUTS_TO_RELATIONS = require('./const/inputs-to-relations');
const INPUTS = require('./const/inputs');
const storageParser = require('./storage-parser');
const DEFAULT_GET_PATH_VALUE = 'DEF... | true |
1fe19b2d68579ad52c2b2b13c36b2b885a5636e3 | JavaScript | lucaslencinas-zz/react-node-mongo-template | /src/components/GameForm/GameForm.js | UTF-8 | 3,642 | 2.578125 | 3 | [
"MIT"
] | permissive | import React from 'react';
import PropTypes from 'prop-types';
import styles from './GameForm.css';
function getSlugFrom(name) {
if (!name) return '';
let slug = name.trim();
slug = slug.replace(/ /g, '_');
return slug.toLowerCase();
}
class GameForm extends React.Component {
constructor(props) {
super(... | true |