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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5a41c29056514b418d45c77bb80485001eeb84e2 | JavaScript | austindryden/pets-SQL | /models/owners.js | UTF-8 | 641 | 2.546875 | 3 | [] | no_license | const db = require('./connection');
const bcrypt = require('bcryptjs');
function createHash(password){
const salt = bcrypt.genSaltSync(10);
return bcrypt.hashSync(password, salt);
}
function create(username, password){
const hash = createHash(password);
}
async function login(username, password){
con... | true |
4a57c58fb532b6abfb4b9e04337717a437faa10a | JavaScript | zomaish/data_structures | /sort_and_search/interpolation_sort.js | UTF-8 | 575 | 3.828125 | 4 | [] | no_license |
function interpolationSort(arr) {
let lo = 0;
let hi = arr.length-1;
const x = 42
while (lo <= hi && x >= arr[lo] && x <= arr[hi]) {
console.log(((hi-lo) / (arr[hi]-arr[lo])), (x - arr[lo]))
let pos = lo + (((hi-lo) / (arr[hi]-arr[lo]))*(x - arr[lo])) |0;
console.log("pos", pos);
if (arr[po... | true |
8f65bb2aa1bdece7643f3f3e0a09f2a4bdf13186 | JavaScript | tunghtran/cmpe172-midterm | /midterm.js | UTF-8 | 5,622 | 2.8125 | 3 | [] | no_license | var req = require('request');
const repl = require('repl');
var _ = require('underscore');
var csv = require('csv');
var generate = require('csv-generate');
var fs = require('fs');
var CSVFILE_DEFAULT = "coinbase.csv";
var orders = {};
var market = {
exchange_rates: {}
};
//Request data from website
re... | true |
0ecc17a77a7864d5d16b00f945b7b1c8c8173364 | JavaScript | ledminh/voting-app | /routes/routes.js | UTF-8 | 5,154 | 2.578125 | 3 | [] | no_license | var data = require('../data/data.js');
module.exports = (app, express, passport) => {
//=========================
//MAIN ENTRANCE
//=========================
app.get('/', (req, res) => {
res.render('index');
});
//=========================
//ASSETS
//=========================
app.use(express.sta... | true |
4299e643432774107cfe328e7812ed48a32bd5fd | JavaScript | yanchapanta/teacherWeb404 | /JAVASCRIPT/01 Estructura Secuencial/js/problema05.js | UTF-8 | 1,255 | 3.578125 | 4 | [] | no_license | 'use strict'
const c=console.log;
const container=document.querySelector(".container");
const divHTML=`
<input type="text" id="num1" placeholder="Ingrese base" ><br><br>
<input type="text" id="num2" placeholder="Ingrese raiz" ><br><br>
<input class="boton" type="submit" value="Resolver">
<span class="resultado" >... | true |
b544b51c1aa35f53e214979c67cd25a015f1e8db | JavaScript | LuanCSV/DH-exercicios | /Ex1/7/index.js | UTF-8 | 389 | 3.328125 | 3 | [] | no_license |
const botaoConverter7 = document.getElementById('converterCtoF');
const inputF7 = document.getElementById('FarenheitEx7');
const inputC7 = document.getElementById('CelsiusEx7');
const converterCtoF = () => {
const valorCelsius = inputC7.value;
let result = valorCelsius * 1.8 + 32;
inputF7.value = res... | true |
aebab4b487cd54ca442f6d1e8133e727ec8ca42d | JavaScript | lumigoxi/chat-api | /components/message/msgRepository.js | UTF-8 | 903 | 2.515625 | 3 | [] | no_license | const msgModel = require("./msgModel");
const save = async (message) => {
try {
const Message = new msgModel(message);
const result = await Message.save();
return result;
} catch (error) {
return error;
}
};
const list = async (query) => {
try {
const Messages = await msgModel.find(query);... | true |
ae245d807d45394d1469b074b79fc88b5fda1803 | JavaScript | glenadamson1984/NextJS-Course-API-Routes | /pages/index.js | UTF-8 | 1,616 | 2.734375 | 3 | [] | no_license | import Head from "next/head";
import styles from "../styles/Home.module.css";
import { useRef, useState } from "react";
export default function Home() {
const [feebbackItems, setFeedbackItems] = useState([]);
const emailInputRef = useRef();
const feedbackInputRef = useRef();
const submitHandler = (event) => ... | true |
52cbdcc5b236db58ad3e0604178990bf4f0df6cc | JavaScript | sadathshariff/CLI-QuizApp | /final.js | UTF-8 | 1,223 | 3.625 | 4 | [] | no_license | var readlineSync = require("readline-sync");
var score = 0;
var userName = readlineSync.question("Enter your name ");
console.log("Welcome "+ userName + " Let's see if you know sadath ?");
var highScores =[
{
name :"Sadath",
score: 5,
}
]
function play(question,answer){
var userAnswer = readlineSync... | true |
88c16a6fe158f2c33468f237165e3cd0c5eb7d1c | JavaScript | gys-management/smb-automatedTesting | /features/step-definitions/product.js | UTF-8 | 1,431 | 2.546875 | 3 | [
"MIT"
] | permissive | const { Given, When, Then } = require('cucumber');
const userData = require('../../support/userData');
const fs = require('fs');
const yaml = require('js-yaml');
let ul;
let fileContents = fs.readFileSync('support/url.yml', 'utf8');
let data = yaml.safeLoad(fileContents);
Given(/^I open the (.*) and login with (.*) i... | true |
0d4a4bd50d5036be4644463868bab8d832ed4da6 | JavaScript | HujYuj/auto_test2 | /lib_service/static/js/plugin/rf.chart.js | UTF-8 | 2,541 | 2.734375 | 3 | [] | no_license | function RfLineChart(pChartCanvasId, pLabel, pBorderColor, pIsLabelAutoIncrease, pDataSizeLimit) {
this._chartCanvasId = pChartCanvasId;
this._label = pLabel;
this._borderColor = pBorderColor
this._labelAutoIncreaseStart = null;
if (pIsLabelAutoIncrease && pIsLabelAutoIncrease == true) {
thi... | true |
dafc84bc23715e3f7bb47a6da2cca29f49c3ba5b | JavaScript | pmbrent/Ready | /app/assets/javascripts/components/users/user.js.jsx | UTF-8 | 796 | 2.546875 | 3 | [] | no_license | window.User = React.createClass({
removeFriend: function() {
FriendUtil.destroyFriendship(this.props.user.id);
},
addFriend: function() {
FriendUtil.createFriendship(this.props.user.id);
},
friendButton: function() {
if (this.props.isFriend) {
return <button className="friending button" o... | true |
77824dea35a207a8ab16a233e2a6a4556b078df3 | JavaScript | betula/uniq | /index.js | UTF-8 | 542 | 2.75 | 3 | [] | no_license | var crypto = require('crypto');
var uniq = module.exports = function() {
return uniq.chars64(24)
};
uniq.bytes = function(len) {
var ret;
if (len < 10) {
ret = crypto.randomBytes(len);
}
else {
var ms = Date.now();
var b = new Buffer(8);
b.writeDoubleBE(ms, 0);
ret = Buffer.concat([b, cr... | true |
4bd5c5a221d05a39476e73cdca9fd5c75cb1a086 | JavaScript | 1337-ishaan/MERN-JWT-AND-ROLE-AUTH | /frontend/src/reducers/customerlistReducer.js | UTF-8 | 1,200 | 2.515625 | 3 | [] | no_license | import { GET_CUSTOMER_LIST, DELETE_CUSTOMER, GET_SPECIFIC_CUSTOMER, UPDATE_CUSTOMER } from "../actions/types";
const INITIAL_STATE = {
isFound:false,
isRetrieved:false,
deleted:false,
isUpdated:false,
user:[],
customer:{},
};
export default (state = INITIAL_STATE, action) => {
switch (... | true |
2c7ba0ef1e4786c81d9025a9a5c53e1c3f17f862 | JavaScript | sdgdsffdsfff/threecss | /threecss-c/src/mvc/ViewManager.js | UTF-8 | 3,520 | 2.734375 | 3 | [
"MIT"
] | permissive | function ViewManager() {
this.observerMap = [];
this.viewMap = [];
/**
* 注册监听函数
*/
this.registerObserver = function (notificationName, observer) {
if (notificationName == null || observer == null) {
alert("注册消息或控制器为空,请检查");
return;
}
v... | true |
96785b2cd176fe42aa596a90275990baf3c60193 | JavaScript | trongthaonh/rails-react-demo | /app/assets/frontend/stores/TweetStore.jsx | UTF-8 | 1,033 | 2.75 | 3 | [] | no_license | import AppDispatcher from "../dispatcher"
import ActionTypes from "../constants"
import { EventEmitter } from "events";
let _tweets = [];
const CHANGE_EVENT = "CHANGE";
class TweetEventEmitter extends EventEmitter {
getAll() {
return _tweets;
}
emitChange() {
this.emit(CHANGE_EVENT);
}
// The view ... | true |
8fa8a93ed6a6a546f7cc682a2da1a52603c53058 | JavaScript | fernandoporazzi/todo-app | /app/public/src/js/components/Todo.js | UTF-8 | 1,600 | 2.609375 | 3 | [] | no_license | import React from 'react';
import Ajax from '../utils/Ajax';
export default class Todo extends React.Component {
constructor(props) {
super(props);
this.state = {
id: this.props.data._id,
name: this.props.data.name,
description: this.props.data.description,
is_completed: this.props.d... | true |
3a06b2632f7d1d01e9bbe14396d645e608c81588 | JavaScript | ElvisUpUp/js-game-demo | /planeWar/scene/main/plane.js | UTF-8 | 1,905 | 3.03125 | 3 | [] | no_license | class Plane {
constructor(game) {
this.game = game
this.init()
}
init() {
this.textture = this.game.texttureByName('player')
this.w = this.textture.width
this.h = this.textture.height
this.x = (this.game.canvas.width - this.w) / 2
this.y = this.game.ca... | true |
f4a71f476edb4dd073e52e1eb9357882f7a4be91 | JavaScript | elizabethslash/Dynamic-Web-Development | /assignment-3/main.js | UTF-8 | 1,196 | 2.828125 | 3 | [] | no_license | window.addEventListener('DOMContentLoaded', async() => {
const myURL = "https://api.nytimes.com/svc/search/v2/articlesearch.json?q=black+women&api-key=G8GMlJGQtqD0NbaYRs1CnQQqJA0yY5wp&begin_date=19600101&end_date=19691231";
const apiOptions = { method: "GET" };
const response = await fetch(myURL, apiOption... | true |
b348f745885ebcdd4959bc5ca7e0017040935932 | JavaScript | XoopsThemes25xArchive-3col/maitsco_classic | /maitsco_classic/js/animations.js | ISO-8859-1 | 1,927 | 2.59375 | 3 | [] | no_license | $(document).ready(function() {
//Pour changer la direction haut/bas et gauche/droit, placez seulement
//le caractre "-" devant la valeur de la proprit top/left
//Coulissement vertical
$('.boxgrid.slidedown').hover(function() {
$(".cover", this).stop().animate({top:'-260px'},{queue:false,durat... | true |
32c729b39973e91bc461ac5a50b7c98ebd68f984 | JavaScript | thanhdanh111/solution1 | /src/App.js | UTF-8 | 2,002 | 2.5625 | 3 | [] | no_license |
import './App.css';
import React, {useEffect, useState} from 'react'
import LoginForm from './components/LoginForm';
import Afterlogin from './data/Afterlogin';
import {Switch , Route } from 'react-router-dom'
const key = "v3YvEB7MQAmosLDjPHKa3LWyfEikMU5GVzZqNLF77lFP2hsKuQ"
const secret = "91BEGtP8Iv5UcmGpEljgKTzYCmN... | true |
37fe7b42d6858fd1bed4b92389daf6f5014fc494 | JavaScript | Jeff1811-no/Examen_1 | /utils/utils.js | UTF-8 | 680 | 2.796875 | 3 | [] | no_license |
const numero=async(data)=>{
const n=[];
const imgrl=[];
let i=0;
let a=1;
while(n.length<3){
if(n.length==0){
n.push(data[data.length-1].albumId)
imgrl.push(data[data.length-1].url)
imgrl.push(data[data.length-2].url)
}
if(n[i]===dat... | true |
fff4936ca37a86ceace050036ed35f3ff27bd9da | JavaScript | BNV99/HW1 | /SRC/ifElse/task4.js | UTF-8 | 214 | 2.859375 | 3 | [] | no_license | "use strict"
var a=6;
var b=54;
var c=2;
var res;
var m=Number(a)*Number(b)*Number(c);
var n=Number(a)+Number(b)+Number(c);
if (m>n) {
res=m+3;
}
else {
res=n+3;
}
console.log (res);
| true |
198d4f8af7dc958018b82d070d7844517fe7a2f4 | JavaScript | sqchenxiyuan/leetcode | /[100-199]/[160-169]/168.excel-sheet-column-title/168.excel-sheet-column-title.js | UTF-8 | 605 | 3.734375 | 4 | [] | no_license | /*
* @lc app=leetcode id=168 lang=javascript
*
* [168] Excel Sheet Column Title
*/
/**
* @param {number} n
* @return {string}
*/
let convertToTitle = function(n) {
let arr = []
while (n > 0){
n-- //如果是1-27可以刚好满足, 把每一次进位多计算的一个去掉
arr.push(n % 26 + 65)
n = parseInt(n / 26)
}
... | true |
6919bfad5802ac1184a7b244309c6cce4a613eb1 | JavaScript | gpwltl/ICT_web_project | /gcloud_fe/src/components/games/Wordchain.js | UTF-8 | 2,182 | 3.0625 | 3 | [] | no_license | import React, { Component } from "react";
import "../../scss/WordChain.scss";
class WordChain extends Component {
state = {
word: "클라우드",
value: "",
correct: "",
wrong: "",
words: [],
count: 0,
};
onSubmitForm = (e) => {
e.preventDefault();
if (this.state.word[this.state.word.len... | true |
9ae620f8b414412f39e4d2d4ac11e84dc1fb30dc | JavaScript | adrianopaladini/Node-iOS-Push | /OldVersion/libs/fcm.js | UTF-8 | 1,582 | 2.65625 | 3 | [] | no_license | class FCM {
constructor(options) {
this.key = options.key;
}
send(notifications) {
if (!Array.isArray(notifications)) {
return this._sendToFcm(notifications);
}
var promises = notifications.map((notification) => this._sendToFcm(notification).catch((err) => err));... | true |
01d2c17a4083492da8a4bcb53f59f90c44a31bf8 | JavaScript | SalloxWave/UniversityPortfolio | /Web Programmering and Interactivity/website3826/public/scripts/helper.js | UTF-8 | 280 | 3.09375 | 3 | [
"MIT"
] | permissive | function addHTMLMessage(elementId, message, color) {
var element = document.getElementById(elementId);
element.style.color = color;
element.innerHTML = message;
}
function removeHTMLMessage(elementId) {
document.getElementById(elementId).innerHTML = "";
} | true |
21359012b284d13be32ef8ba87fdc4e690e50125 | JavaScript | jbalke/filemetadata | /src/client/app.js | UTF-8 | 1,006 | 2.96875 | 3 | [] | no_license | (function() {
var submit = document.getElementById('submit-upload');
var fileInput = document.getElementById('file-input');
//var resultOutput = document.getElementById('result');
var body = document.getElementById('content');
submit.addEventListener('click', function() {
if (fileInput.file... | true |
f79a88946147705be9687cb3d1fb346e7b391086 | JavaScript | Jdonggit/slot | /js/firework.js | UTF-8 | 2,936 | 3.328125 | 3 | [
"BSD-3-Clause"
] | permissive | var firework;
var gctx; // Graphic context
var fireworks = []; // Each firework will be an element of this array
window.addEventListener("load", function() {
firework = document.getElementById("firework");
// If firework is supported
if(firework.getContext) {
firework.width = 2000;
firework.height... | true |
c6c3a321f745bf504ca5f918120ce12e4666e9f5 | JavaScript | neeravp/Samay | /mixins/Difference.js | UTF-8 | 3,219 | 3.0625 | 3 | [
"MIT"
] | permissive | import Util from "@/utils/Util";
export default {
/**
* Get the difference in milliseconds of the calling Samay instance from the Samay instance passed as argument.
* @param samay
* @return Number milliseconds
*/
diffInMilliseconds(samay){
if(!samay) samay = Samay.now();
... | true |
185ea071f7811d265091a2a16a23346a1c43988c | JavaScript | andrzejkrzywda/jchess | /javascripts/app.js | UTF-8 | 1,904 | 2.546875 | 3 | [] | no_license | jQuery(document).ready(function() {
// Uncomment one at a time to see the examples
var chess1 = jQuery('#board1').chess();
var chess2 = jQuery('#board2').chess({fen : "rnbqkbnr/pp1ppppp/8/2p5/4P3/5N2/PPPP1PPP/RNBQKB1R b KQkq - 1 2"});
var chess3 = jQuery('#board3').chess({pgn : jQuery('#pgn-fischer-spassky').ht... | true |
53c10b3f976563a78a3fccac37a15df50f6d282b | JavaScript | niklasvh/css-values | /src/color/hexcolor.js | UTF-8 | 807 | 2.859375 | 3 | [] | no_license | var CSSColor = require('./csscolor');
function HexColor(r, g, b, a) {
this.r = r;
this.g = g;
this.b = b;
this.a = a === undefined ? 255 : a;
this.defaultStringifier = 'hex';
}
HexColor.prototype = Object.create(CSSColor.prototype);
HexColor.prototype.toRGB = function() {
return new (require(... | true |
476c93a37e40b72ff69aecb4d35fe1e43fefaf20 | JavaScript | gwezerek/quizup | /js/main.js | UTF-8 | 901 | 2.75 | 3 | [] | no_license | /*jshint -W099 */
/*jslint browser: true, sub: true */
// GLOBALS
// =============================================
var pymChild = new pym.Child();
// HELPERS
// =============================================
function goodGuess(container) {
container.addClass("viz-choice-correct");
container.siblings(".viz-choice").a... | true |
3fcadc63449d9f679c4cbf18d49ff8b8aaf87deb | JavaScript | umang64-web/devsnest-tha | /tha-5/js.js | UTF-8 | 700 | 3.28125 | 3 | [] | no_license | var screen=document.querySelector('input');
var buttons=document.querySelectorAll('button');
var result= "";
buttons.forEach(button => {
button.addEventListener('click', (e, err) => {
if(button.innerText=='AC')
{
result="";
screen.value= "";
}
else if(butto... | true |
6d3d30ab5bb48605e760872712eb8eb8a28d7ed7 | JavaScript | dstrickl7/portfolio | /scripts-v3.js | UTF-8 | 2,256 | 3.078125 | 3 | [] | no_license | /*Navigation menu */
const navbar = document.querySelector(".navbar").classList;
const close = document.getElementById("close");
const hamburger = document.getElementById("hamburger");
hamburger.addEventListener("click", () => {
navbar.toggle("active");
close.classList.toggle("active");
hamburger.classList.toggl... | true |
822f663725ec6b49225ff1ea4f4f4a5e1f375f2b | JavaScript | henafufa/MalBekta | /script.js | UTF-8 | 3,336 | 3.671875 | 4 | [] | no_license | // variables declaration
let questionNumber = 0;
let score = 0;
// get elements from Ui template
const questionElement = document.getElementById('question_item');
const questionnaires = document.getElementById('questionnaires');
const a_choiceElement = document.getElementById('a_choice');
const b_choiceElement = docu... | true |
664ed9d84458ff357af5f679d66a340c6df567d3 | JavaScript | baochuang/MReact | /src/react-reconciler/src/ReactFiberLazyComponent.js | UTF-8 | 466 | 2.546875 | 3 | [
"MIT"
] | permissive | export function resolveDefaultProps(Component, baseProps) {
if (Component && Component.defaultProps) {
// Resolve default props. Taken from ReactElement
const props = Object.assign({}, baseProps)
const defaultProps = Component.defaultProps
for (let propName in defaultProps) {
if (pro... | true |
c0a3ba0baae52f153db41e9df934625382687c2f | JavaScript | julia-rudenko/IT-Step | /js/hw16_11_02/4.js | UTF-8 | 155 | 2.953125 | 3 | [] | no_license | let timerId = setInterval (counter, 1000);
function counter () {
a += 10;
console.log(a+'%');
if (a >= 100) {
clearInterval(timerId);
}
}
let a = 0; | true |
a6ffcde4610138ced55816888f6e5a394a622719 | JavaScript | Tonyio83/CV_numerique | /assets/js/script.js | UTF-8 | 645 | 2.96875 | 3 | [] | no_license | var navActive = document.querySelectorAll('.nav-link');//déclare une variable pour récupérer les liens de la navbar
for (var i = 0; i < navActive.length; i++) {//crée une boucle avec les liens de la navbar
navActive[i].addEventListener('mouseover', function(){//appel d'une fonction au placement de la souris sur le ... | true |
3ff5b141ee4d18924ff25f9b0f0fd2421edb1312 | JavaScript | ryanbmarx/chicago-public-schools-sexual-abuse-database | /js/src/app.js | UTF-8 | 5,269 | 2.578125 | 3 | [] | no_license | import 'awesomplete';
import clickTrack from "./click-track.js";
// import getJSDateFromExcel from './get-js-date-from-excel.js';
// import {timeFormat} from 'd3-time-format';
import formatDate from "./format-date.js";
const pym = require('pym.js');
// Listen for the loaded event then run the pym stuff.
window.addEve... | true |
3d92e9d8710f83d8dbb19d29366225c23b89c320 | JavaScript | betmakh/ps5checkerbot | /src/utils.js | UTF-8 | 570 | 2.5625 | 3 | [] | no_license | const fetch = require("node-fetch");
const CHAT_ID = process.env.CHAT_ID;
const BOT_TOKEN = process.env.BOT_TOKEN;
const URL = `https://api.telegram.org/bot${BOT_TOKEN}/sendMessage`;
if (!CHAT_ID || !BOT_TOKEN) {
throw new Error("Token or chat ID is missing: " + CHAT_ID + " " + BOT_TOKEN);
}
const sendUpdate = (da... | true |
3c5c57a777d02af0a47bed35c54575f291b751df | JavaScript | sunwenpeng/Project1 | /src/button.js | UTF-8 | 870 | 3.25 | 3 | [] | no_license | function btn_click() {
document.getElementById('txt1').style.display = 'inline';
var random_number = random_num();
console.log(random_number);
localStorage.setItem("random_number", random_number);
}
var times=0;
function btn_click_1() {
times++;
var random_number = JSON.parse(localStorage.getIt... | true |
6f8428d17694465bcddffa04b3d283ee8ae93dda | JavaScript | clevertonh/azure-fn-itau-web-crawler | /itau-get-past-transactions/itau-web-crawler/src/transactions.js | UTF-8 | 3,759 | 3.109375 | 3 | [] | no_license | /* Data sctructure to save and manipule transactions
*/
const moment = require('moment');
const { DATE_FORMAT, money } = require('./utils');
const crypto = require('crypto');
class Transaction {
constructor ({date, value, result, description, origin}, raw) {
this.date = date;
this.value = value;
... | true |
80f7828f3b7495878c56289507e8c794d112baa2 | JavaScript | RavenSam/dust | /src/components/shared/ChartLine.js | UTF-8 | 1,124 | 2.53125 | 3 | [] | no_license | import moment from "moment"
import { Chart, Geom, Axis } from "bizcharts"
const data = [
{ date: "20200228", value: "60" },
{ date: "20200229", value: "80" },
{ date: "20200301", value: "99" },
{ date: "20200302", value: "89" },
{ date: "20200303", value: "79" },
{ date: "20200304", value:... | true |
25524789af2f2c1e90e22460ece53e10c99dc86a | JavaScript | mtintes/booth | /listener.js | UTF-8 | 562 | 2.859375 | 3 | [] | no_license | 'use strict'
module.exports = class Listener {
constructor(robot, matcher, callback){
console.log("loading listener");
this.robot = robot
this.matcher = matcher
this.callback = callback
if(this.robot == null){
throw new Error("You didn't give me a robot.")
}
i... | true |
63c44d1658776f21713d8df5176469f984f1ad4f | JavaScript | remaley5/whilesingle | /starter/client/src/components/User.js | UTF-8 | 501 | 2.53125 | 3 | [] | no_license | import React, { useRef } from 'react';
function User({user}) {
// console.log(user)
const wrapper = useRef()
const handleRemoveMatch = (e) => {
wrapper.current.classList.add('match-wrapper-hidden')
}
return (
<div className='match-wrapper' ref={wrapper}>
<p className='... | true |
89b11b58d02f98b4933bbbd1d12bfcf740e9e4ce | JavaScript | cam-shotter/NZ-SPCA-Scraper | /lib/getAnimals.js | UTF-8 | 1,400 | 2.671875 | 3 | [] | no_license | const request = require('superagent')
const SPCA_API = "https://www.wellingtonspca.org.nz/CDF_Core/Product/GetProductsInfiniteScroll/"
let animals = []
getAnimals = (amount) => {
request
.post(SPCA_API)
// SPCAs wonky way of accessing the site
// Skip amount is essentially an index.
// eg; 2 will r... | true |
fee17380d0b971918db6a00dfa73c337bb701c77 | JavaScript | chrismeeky/amona | /src/utils/processImage.js | UTF-8 | 3,153 | 3.109375 | 3 | [] | no_license | import states from '../constants/states';
/**
* @class ProcessImage
* @description Processes uploaded images
*/
class ImageProcessor {
/**
* @param {string} information - contains license plate information
* @return {string} - license number
* @memberof ProcessImage
*/
static async extractLicenseNumber(in... | true |
6a69f2072e7dc3d481a5eaa319eac2d4c7f3df24 | JavaScript | DohanKim/HCI_TeamOldBoy | /Project/js/footer.js | UTF-8 | 1,113 | 2.625 | 3 | [] | no_license | if (document.URL == "file:///Users/zprime/HCI_DP/Project/photo_window.html") {
$("#photo-btn").css("background-color", "#0176C3");
} else if (document.URL == "file:///Users/zprime/HCI_DP/Project/message_list.html") {
$("#message-btn").css("background-color", "#0176C3");
}
$(function() {
$('#upload-btn').click(fu... | true |
8f6649dd7fb85a5ca90c1c77bf0ff92d69853e97 | JavaScript | Evermenot/node--demo | /05.node服务器/05.node结合art-template渲染动态页面.js | UTF-8 | 899 | 3.15625 | 3 | [] | no_license | //1.导入http模块
const http = require('http');
const template = require('art-template')
const path = require('path')
//2.创建服务器模块
const server = http.createServer();
//3.绑定事件
server.on('request', (req, res) => {
const person = {
name: 'leon',
age: 18,
gender: 'man',
hobby: ['吃饭', '睡觉', '打... | true |
35e33637aff672e7c9bb913aa6225c921fa29a02 | JavaScript | jlmack13/codechallenges | /singleNumber/test.js | UTF-8 | 415 | 2.890625 | 3 | [] | no_license | const singleNumber = require('./index.js');
test('singleNumber function exists', () => {
expect(typeof singleNumber).toEqual('function')
});
test('Test should return 1 with input: [1, 2, 4, 4, 2]', () => {
expect(singleNumber([1, 2, 4, 4, 2])).toEqual(1)
});
test('Test should return 5 with input: [1, 6, 3, 3... | true |
b2b8616e3cec7b40a7edfdc392068aadb8950e97 | JavaScript | Ellorex/qpuc | /static/js/main.js | UTF-8 | 6,324 | 2.640625 | 3 | [] | no_license | var socket = io("/play", { transports: ['websocket'], upgrade: false });
var questionTitle = document.getElementById('questionTitle');
var answersList = document.getElementById('answersList');
var playerName = null;
var listPlayer = document.getElementById('listPlayer');
var submitAnswer = document.getElementById('subm... | true |
b399fd477ceda98cf4bf783383634067521b1a01 | JavaScript | ScraggyDuck/training | /exercise-1/src/reducers/compare.js | UTF-8 | 617 | 2.734375 | 3 | [] | no_license | import * as types from "../constants/actionTypes";
import { findIndex } from "lodash";
var initialState = [];
const compare = (state = initialState, action) => {
switch (action.type) {
case types.ADD_TO_COMPARE:
let newCompareAdd = [...state];
newCompareAdd.push(action.product);
return newComp... | true |
221f862f91f5bef2e85932dd8af104c1e94febd3 | JavaScript | Linciya/src | /WebContent/js/DFWValidator.js | ISO-8859-1 | 28,036 | 2.671875 | 3 | [] | no_license | function isIndContainsApril(indicatorName){
var aprilValue=indicatorName.indexOf("1st April");
if(aprilValue!=-1){
var month=document.getElementById('month').value;
if(month!=3){// Month 3 denotes April
return true;
}
}
return false;
}
function validateIndicatorLevel(indicatorName,generalType,generalName... | true |
296ea2dc559b1b24645d0b3d7f78ff4c6e333fb5 | JavaScript | BJCreslin/backend4 | /src/redux/users-reducer.js | UTF-8 | 4,289 | 2.765625 | 3 | [] | no_license | import {CreateNewUser, Usersapi} from "../api/api";
const SET_USERS = "SET_USERS";
const SET_ALL_USERS = "SET_ALL_USERS";
const SET_TOTAL_COUNT = "SET_TOTAL_COUNT";
const SET_CURRENT_PAGE = "SET_CURRENT_PAGE";
const TOGGLE_IS_FETCHING = "TOGGLE_IS_FETCHING";
const SET_FIRST_PAGE = "SET_FIRST_PAGE";
const SET_LAST_PAGE... | true |
1e88cae0db0fd72156ca1be34e2b9a5e50d7e818 | JavaScript | CJAllen056/code-tests | /hackajob-phone-book-2/controllers/entriesController.js | UTF-8 | 1,529 | 2.671875 | 3 | [] | no_license | var entries = require("../data/entries.js");
function entriesIndex(req, res) {
res.render("entries/index", { entries : entries });
}
function entriesNew(req, res) {
res.render("entries/new");
}
function entriesCreate(req, res) {
var entry = req.body.entry;
entry.id = entries.length;
entry.address = req.bod... | true |
3008ea64889e2d2853cb5b4fd72f6072b08d0b63 | JavaScript | Toxantron/scrumonline | /src/js/gitlab-plugin.js | UTF-8 | 1,307 | 2.515625 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | /*globals scrum */
// Add a plugin for github integration
scrum.sources.push({
// Fixed properties and methods
name: "Gitlab",
position: 4,
view: "templates/gitlab_source.html",
feedback: false,
// Feedback call for completed poll
completed: function(result) {
},
// Custom properties and methods
... | true |
48778a66b92932003b61ab17c86ce70db838ada2 | JavaScript | njtan142/Chain-Reaction | /gameLogic/app.js | UTF-8 | 10,436 | 3.25 | 3 | [] | no_license | const boxes = document.querySelectorAll(".box");
var array = [];
array.length = 81;
var rowObject = {};
var columnObject = {};
var color = 'red';
var playerNumbers = 2;
var startingNum = 1;
var previousColor = 'red';
boxes.forEach(function(box){
box.style.color = 'black';
})
for (let i = 0; i < boxes.length; i++) {... | true |
777e739f8ffea9cb09fe26472d3acb2e898e215b | JavaScript | jklgit/Bookmarklets | /src/vidfinder.js | UTF-8 | 4,804 | 2.6875 | 3 | [] | no_license | (function () {
var linklists = [{
name : 'HTML5 Video Sources',
links : getSourcesByTagName('video')
}, {
name : 'Absolute Links',
links : getMatches(/((http|https|ftp):)?\/\/[^\s"']+?\.(mp4|flv|webm|avi|mpg|mpeg|wmv)(\?[^\s"']+)?/g)
}, {
name : 'Absolute Encoded Links Decoded',
links : getMatch... | true |
cbfd555c792df059686b8cc348d297a992777c04 | JavaScript | clairemoo/Algos | /AlgoExpert/NodeDepths.js | UTF-8 | 998 | 3.34375 | 3 | [] | no_license | function nodeDepths(root) {
let totalSums = [0];
calculateSum(root, 0, totalSums);
return totalSums[0];
}
function calculateSum(node, currentDepth, total) {
if (!node) {
return
};
total[0] = total[0] + currentDepth;
if (!node.right && !node.left) {r... | true |
88ff7a3773141c0d8f95e2972903c6300468d6f9 | JavaScript | bogdanhener/WeatherApp | /js/weather.js | UTF-8 | 1,404 | 3.203125 | 3 | [] | no_license | $(document).ready(function(){
$(document).on('keypress',function(e) {
if(e.which == 13) {
displayCity();
}
});
$('#submitCity').click(function(){
displayCity();
});
});
function displayCity(){
let city = $('#city').val();
if(city != ""){
$... | true |
fca744c7257d3307fe1d2964a2369410660dcee4 | JavaScript | mikesch803/todo-app | /src/App.js | UTF-8 | 1,806 | 2.640625 | 3 | [] | no_license | import { Button, TextField } from '@material-ui/core'
import { useEffect } from 'react';
import { useState } from 'react';
import './App.css';
import { db } from './firebaseConfig';
import firebase from 'firebase'
import { TodoListItem } from './Todo';
function App() {
const [todo, setTodo] = useState('')
const [tod... | true |
8ab9db12885335f49f3c9c18773eca184c4443bf | JavaScript | pmslin/hmedu | /web/static-dist/app/js/page/page-content.js | UTF-8 | 1,029 | 2.59375 | 3 | [] | no_license | $(document).ready(function(){
$("#bishi").mouseover(function (){
$("#bmsj").html("报名时间 9月5日左右");
$("#zkzdy").html("准考证打印 考前一周");
$("#kssj").html("笔试时间 2018.11.3");
$("#cjcx").html("成绩查询 &nbs... | true |
69f5224150d346a67d1b01fabc01edc3d990bf4a | JavaScript | ShawnOakley/Asteroids | /asteroid.js | UTF-8 | 1,337 | 2.765625 | 3 | [] | no_license | (function(root){
var Asteroids = root.Asteroids = (root.Asteroids || {});
Function.prototype.inherits = function(superclass){
function Surrogate () {};
Surrogate.prototype = superclass.prototype;
this.prototype = new Surrogate();
}
var Asteroid = Asteroids.Asteroid = function(pos, vel) {
t... | true |
8c3f5821fb4c179711fefc11a2294cc5f4c69964 | JavaScript | cj857173226/dz | /common/helper.js | UTF-8 | 4,853 | 2.84375 | 3 | [] | no_license | // 城市数据
import provinceData from '../common/city-data/province.js'
import cityData from '../common/city-data/city.js'
import areaData from '../common/city-data/area.js'
// 检测是否登录
const isLogin = function() {
const token = uni.getStorageSync('dz_token');
if (!token) {
setTimeout(function() {
uni.reLaunch({
... | true |
ed466ba43c91ab09fd7cf42c52b81eb5b7f994c5 | JavaScript | alexoah/JSPlayground | /W3School-JSExercises/JS-StringMethods/jsStringMethodsE2.js | UTF-8 | 353 | 4.03125 | 4 | [] | no_license | /**
* from JavaScript String Methods: Exercise 2 ( https://www.w3schools.com/js/exercise_js.asp?filename=exercise_js_string_methods2 )
*
* question:
* Use the slice method to return the word "bananas".
*
* var txt = "I can eat bananas all day";
* var x = txt.slice(__, __);
*
*/
var txt = "I can eat bananas all... | true |
7355c33d9b3612b7b5b0d3136478412af374eacc | JavaScript | brunohams/landing-page-kabum | /template/js/geral.js | UTF-8 | 1,639 | 2.671875 | 3 | [] | no_license | $(function ()
{
/**
* jQuery validator
*/
// validate signup form on keyup and submit
$("form").validate(
{
rules:
{
email:
{
required: true,
email: true
},
topic:
{
requ... | true |
f90f8674fbd2aa1beb7c5f5c7ae232ae4e6c48b4 | JavaScript | lhaena3/p4d | /HW4/player.js | UTF-8 | 457 | 2.984375 | 3 | [] | no_license | class Player
{
constructor()
{
this.w = 80;
this.h = 144;
this.x = floor(width/2 - this.w/2);
this.y = floor((3 * height/4) - this.h/2);
}
show()
{
image(im_car_red, this.x, this.y);
}
turnLeft()
{
this.x -= 5;
this.x = constrain(this... | true |
079b633869667c30b88769c3c36386a5bb248f96 | JavaScript | ruthmesfun/beliH-client | /src/pages/CourseDashboard.js | UTF-8 | 1,632 | 2.546875 | 3 | [] | no_license | import React, { Component } from 'react';
import {connect} from 'react-redux'
//Containers
import LessonInfo from '../containers/LessonInfo'
import NavBar from '../containers/NavBar';
//Components
import Unit from '../components/Unit'
//Actions
import { selectUnit } from '../actions'
const UNIT_URL = 'http://local... | true |
8954bf830550879c733a8354f066e1585d9c0aca | JavaScript | neverminderer1/homework5 | /home.spec.js | UTF-8 | 3,925 | 3.265625 | 3 | [] | no_license | "use strict";
const home = require('./home');
const assert = require('assert');
const brackets = home.brackets,
identical = home.identical,
maxThreeNumbersComposition = home.maxThreeNumbersComposition,
workOpn = home.workOpn;
... | true |
8baf344edf9595fe5097be89d25d409a474c3872 | JavaScript | jasleendh/TicTacToe | /script.js | UTF-8 | 3,972 | 3.875 | 4 | [] | no_license | /*
* Tic Tac Toe scripts, January 2017
* Version 2
* Jasleen Dhillon
*/
// select td all elements
var board = document.getElementsByTagName("td");
// assuming we index the 9 tic tac toe cells from left to right, top to
// bottom, as 0-8, these would be all of the winning combinations:
var winSets = [[0, 1, 2], [3, 4,... | true |
61bade240790cda33d21223ad7b844d1f6d0a646 | JavaScript | abdelselouane/ES6 | /Part1/Hoisting.js | UTF-8 | 224 | 3.703125 | 4 | [] | no_license | /** You have to declare variables before using them */
/*** Old Syntax ***/
age = 12
console.log(12)
var age
/*** New Syntax ***/
/***
* This will fail if you are using the new syntax
***/
age = 12
console.log(12)
let age | true |
f42c871c801393100b3bc41bad6de79b60421692 | JavaScript | ARenatM/Delivery | /js/script.js | UTF-8 | 5,876 | 3.4375 | 3 | [] | no_license | /* Просто получаею все нужные элементы и засовываю в переменные */
const popup = document.querySelector(".popup");
const popupBody = document.querySelector(".popup__body");
const popupList = document.querySelector(".popup__shopping-list");
const popupCost = document.querySelector(".popup__cost");
const body = document.... | true |
996ab52672e55fb9bdb6d09eb2186b29b0eb72bd | JavaScript | cv-net/Unit-Testing-JavaScript-Activity | /src/ATM.js | UTF-8 | 624 | 3 | 3 | [] | no_license |
class ATM {
constructor() {
// this.balance = balance;
}
getCurrentBalance() {
return 100;
}
}
// var myAccount = new ATM(100);
// function getCurrentBalance() {
// return myAccount.balance;
// }
// console.log(myAccount.balance);
// console.log(getCurrentBalance())
module.expo... | true |
4c1f91ade6b8d7cd7a5dd6f0373a2e26cc7403ab | JavaScript | iamkjw77/JS_practice | /Algorithm/Q11.js | UTF-8 | 275 | 3.234375 | 3 | [] | no_license | function checkPalindrom(str) {
return [...str].join('') === [...str].reverse().join('');
}
console.log(checkPalindrom('dad')); // true
console.log(checkPalindrom('mom')); // true
console.log(checkPalindrom('palindrom')); // false
console.log(checkPalindrom('s')); // true
| true |
fbdc58cdd40a90c03a93c800f5a3347e61b93b0b | JavaScript | aalsher/CodingProgression | /MEAN/Mongoose/login_and_registration/server/models/user.js | UTF-8 | 3,430 | 2.734375 | 3 | [] | no_license | let mongoose = require("mongoose");
let Schema = mongoose.Schema;
let bcrypt = require('bcrypt');
// SALT_WORK_FACTOR= 10;
var uniqueValidator = require('mongoose-unique-validator');
let UserSchema = new Schema({
email:{
type:String,
required:[true,"Email is required."],
unique: [true, ... | true |
71659f69e5ef50cc310413750f10c07e1686e8ce | JavaScript | rkkmkkfx/netology.ru-hj-homeworks | /websocket/counter/js/counter.js | UTF-8 | 514 | 2.71875 | 3 | [] | no_license | 'use strict';
const connection = new WebSocket('wss://neto-api.herokuapp.com/counter'),
connections = document.querySelector('.counter'),
errors = document.querySelector('output.errors');
function getInfo(event) {
const data = JSON.parse(event.data);
connections.innerText = data.connections;
errors.i... | true |
3c4c83842f8b85ae68ee573508f0d92e5f3be9ca | JavaScript | NJIT-CS490-SP21/project2-kwp5 | /src/Login.js | UTF-8 | 1,230 | 2.6875 | 3 | [] | no_license | import React, { useRef } from 'react';
import io from 'socket.io-client';
import './Board.css';
import ReactDOM from 'react-dom';
import App from './App';
const socket = io();
export default function Login() {
const inputRef = useRef(null);
let username = '';
function enterUser() {
if (inputRef != null) {
... | true |
64f995ca692dd066e5d41c07cb2a0e8a4ced57d1 | JavaScript | ydj199620/save | /web/nodeJS/7.10/express.js | UTF-8 | 3,068 | 2.65625 | 3 | [] | no_license | var express = require('express');
var a = express();
a.use('/b',function(req,res){
var c = [];
for(var i =0;i<10;i++){
c[i]=i;
}
res.send(c);
})
a.use('/d',function(req,res){
res.end('俞彭威跪着唱忐忑');
res.send('张泰山跪着唱征服');
})
a.listen(8080);
/* 1xx:信息响应类,表示接收到请求并且继续处理
2xx:处理成功响应类,表示动作被成功接收... | true |
3bdc22f9b66b846061ea20896b5eb0e5391a604c | JavaScript | rafalgiemza/Wawrzynowe_slajdy | /app/assets/js/app/hello/gui.module.js | UTF-8 | 1,085 | 2.640625 | 3 | [] | no_license | define(['require', 'jquery', 'handlebars'], function (require, $, Handlebars) {
var Gui = (function() {
function Gui(eventBus) {
window.gui_id++;
this.eventBus = eventBus;
this.gui_id = window.gui_id;
this.getInitialState();
}
Gui.prototype.getInitialState = function() {
this.state = {
name... | true |
80bed5ad5caa8470636f9bfcbfe2624186c1ead3 | JavaScript | borisbokan/daynight | /script.js | UTF-8 | 3,312 | 3.640625 | 4 | [] | no_license | 'use strict';
/**
* @author Boris Bokan, borisbokan@gmail.com; v1
*
*/
function Thermostat() {
this.currentTime = 6; //change the data as you wish
this.switched = true; // if temp < 8 must be true and if > 16 must be false
this.currentTemp = 3; //change the data as you wish
this.dailyTemperature = 27; //Dal... | true |
27392fba4e9ea94806d3da9744396c8769438c54 | JavaScript | ave-llan/grammar-builder | /src/app/shared/utils/order-grammar.js | UTF-8 | 1,201 | 3.390625 | 3 | [] | no_license | /**
* @param {GrammarGraph} grammarGraph
* @param {string} startSymbol - a symbol in the graph from which to start
*/
function orderGrammar (grammarGraph, startSymbol) {
var orderedGrammar = []; // array of vertex symbols in order of reachability from start Symbol
var unproc... | true |
ec1cf33df43bc8e892a7ae69ea8682f763e7a1e3 | JavaScript | mazhy/react-o2o | /app/reducers/stores.js | UTF-8 | 936 | 2.84375 | 3 | [] | no_license | import * as actionTypes from '../constants/stores'
const initialState = []
export default function stores (state = initialState, action){
switch (action.type){
case actionTypes.STORE_UPDATE:
return action.data
case actionTypes.STORE_ADD:
state.unshift(action.data)
... | true |
acba56e5ed8be3ae4bbfe58a8e9bdca699f49d9a | JavaScript | tiluser/bloc-chat-angular | /app/scripts/services/Room.js | UTF-8 | 1,341 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | (function () {
function Room($firebaseArray) {
var Room = {};
var ref = firebase.database().ref().child("rooms");
var rooms = $firebaseArray(ref);
Room.ph = "Enter room name here";
Room.newName = "New room";
Room.all = rooms;
/*
Room.add = function () ... | true |
2e82d50a1b04c16631c40f1f393669d17176fd38 | JavaScript | kandksoftware/eval-app | /js/src/engine/interpreter/build-in-functions.js | UTF-8 | 2,793 | 2.640625 | 3 | [] | no_license | 'use strict'
class BuildInFunctions{
constructor(config = null,variables = null){
this._config = config
this._variables = variables
}
static rond(arg){
switch(arg){
case 0:
case 90:
case 180:
case 270:
case 360:
return arg - 0.001
break
}
return ... | true |
cde7a9329eb057e75bcde00c92528d02975e384d | JavaScript | GeorgeMathioudakis/GeorgeRepo | /finalproject/js/war.js | UTF-8 | 6,718 | 3.15625 | 3 | [] | no_license | /// George mathioudakis
/// December 12,2020
/// This is a javascript file used for listening button presses for the iuser to start the round of war for the user and then send inforamtion
///to php file to insert or update user info in highscore table and tell the user what happend.
$(document).ready(function... | true |
7b085d6e79f5c75b6924e9af958d75ca0aa53eb5 | JavaScript | Diogo-Ferreira/TheaterCrawler | /index.js | UTF-8 | 2,643 | 2.671875 | 3 | [] | no_license |
import { crawl } from './crawler'
import _ from 'lodash'
import moment from 'moment';
import { onNewMovies } from './bot';
import { timeout } from './utils';
import SDC from 'statsd-client'
import os from 'os'
export const sdc = new SDC({
host: process.env.STATSD_HOST || 'localhost',
port: process.env.STATSD_POR... | true |
0b65bceec8b83fcd358b9054e341f300058f9c60 | JavaScript | panickspa/pst-kudus-electron | /src/database.js | UTF-8 | 1,868 | 2.53125 | 3 | [] | no_license | /* eslint-disable */
const sqlite3 = require('sqlite3'),
Parser= require('json2csv'),
userDB = new sqlite3.Database("./user1.db",
sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE,
(err) => {
// do your thing
});
function SurveyData(){
this.db = userDB
}
SurveyData.prototyp... | true |
bf7d634d9dc90f120c4ab13e37428afe78034cc3 | JavaScript | weiq/antui-admin | /src/utils/check.js | UTF-8 | 414 | 3.34375 | 3 | [
"MIT"
] | permissive | /**
* 判断是否为函数
*/
export function isFunction(obj) {
return typeof obj === 'function';
}
/**
* 判断是否为数组
*/
export function isArray(arr) {
return Array.isArray(arr);
}
/**
* 判断是否为object
*/
export function isObject(obj) {
return obj === Object(obj);
};
/**
* 判断是否为数字
*/
export function isNumeric(n) {
retur... | true |
976978082faea8550007e2cab2f7ca2def03e75d | JavaScript | pandyatama17/camrent_siska | /public/jplist/src/addons/start-rating-control/js/star-rating-view.js | UTF-8 | 1,586 | 2.515625 | 3 | [
"MIT"
] | permissive | (function(){//+
'use strict';
/**
* render control
* @param {Object} context
*/
var render = function(context){
var html = '';
if(context.controlOptions && jQuery.isFunction(context.controlOptions.render)){
//render html
html = context.controlOptions.render({
total: context.params.tota... | true |
7f8621c12e077b82397c25021f763b44fdb4fa94 | JavaScript | mduesterhoeft/epages-docs | /assets/javascript/utils.js | UTF-8 | 392 | 2.859375 | 3 | [
"CC-BY-4.0",
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | (function () {
'use strict';
var getParameter = function (name, defaultValue) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == name) {
return pair[1];
}
}
... | true |
1afcc2db2b9520356e3a432d7e6f06ad360a0f29 | JavaScript | tae-lim/interviewprep | /LeetCode/movZeroes.js | UTF-8 | 633 | 3.703125 | 4 | [] | no_license | //Extra memory, O(n) time
var moveZeroes = function(nums) {
var result = [];
var count = 0;
for (var i = 0; i < nums.length; i++) {
if (nums[i] === 0) {
count++;
} else {
result.push(nums[i]);
}
}
while (count > 0) {
result.push(0);
count--;
}
return result;
};
//In-... | true |
521eaac789ca5d8778bf78859ac29c14a29a355b | JavaScript | dhyey35/freeCodeCamp-Projects | /wikipediaViewer/wikipediaViewer.js | UTF-8 | 2,970 | 2.71875 | 3 | [] | no_license | $(document).ready(function(){
// building the loading gif with pure js
var opts = {
lines: 13 // The number of lines to draw
, length: 14 // The length of each line
, width: 7 // The line thickness
, radius: 19 // The radius of the inner circle
, scale: 1 // Scales overall size of the spinner
, corners: 1 // ... | true |
3e8304907c15120b4f12b8cd5f8feb6f218429fe | JavaScript | dartist21/find-closest-city | /main.js | UTF-8 | 1,824 | 3.5625 | 4 | [] | no_license | const API_KEY = 'AIzaSyDWg8lbhZTAze4eMTw8c0nT3HY0HQRcyv8';
const cities = [
'Kolomiya',
'Otynia',
'Horodenka',
'Sniatyn',
'Palianucya',
'Yasina',
'Nadvirna',
'Deliatyn',
];
async function fetchLatLng(cities) {
return cities.reduce(async (savedResult, city) => {
const result = await savedResult;
... | true |
c816d50cc899b7a813e51c026fe0d11949c9b0bf | JavaScript | green-fox-academy/Alex880627 | /week6/day4/matreview.js | UTF-8 | 622 | 2.703125 | 3 | [] | no_license | 'use strict';
/* nmp init -y
npm install express
code package.json
code .gitignore
code server.json
npm install nodemon
you can start server from diferent folder: (path.join(__dirname + '/server.html')*/
const express = require('express');
const app = express();
const PORT = 3000;
const path = require('path');
app.... | true |
93a2d26dfc8f6792d93c5589a0ef7b0e285c608c | JavaScript | rjricken/proxy-observe | /src/observe.js | UTF-8 | 2,002 | 2.75 | 3 | [] | no_license | 'use strict';
/*
TODO: keep track of each observer in an Object to make it possible to unobserve later
*/
function observe(object, callback, acceptList) {
acceptList = acceptList || ['add', 'update', 'delete', 'reconfigure', 'setPrototype', 'preventExtensions'];
//TODO: improve how we dispatch the stream of... | true |
f21296fdcce0baad916edb2eccc5203677d74dab | JavaScript | WilliamSilveiraF/JavaScript-Algorithms | /basicDataStructures/checkIfAnObjectHasAProperty.js | UTF-8 | 863 | 4.3125 | 4 | [] | no_license | //Checar se um objeto possui certa proiedade
let users = {
Alan: {
age: 27,
online: true
},
Jeff: {
age: 32,
online: true
},
Sarah: {
age: 48,
online: true
},
Ryan: {
age: 19,
online: true
}
};
console.log(users.hasOwnProperty('Ryan'));
c... | true |
6d9cc5fa5766b4d4e98bc222bc1ee8406d31f456 | JavaScript | Sema-qq/git.javascript | /ajax_error_handler.js | UTF-8 | 958 | 3.046875 | 3 | [] | no_license |
// параметры ajax'а
success: function (data) {
var message = data.result == 0
? 'Задание на обзвон успешно создано'
: 'Произошла ошибка при создании обзвона: ' + errorMessage(data.message);
alert(message);
},
... | true |
4e1a2f18b04658bebd6426f23bb793874490bb66 | JavaScript | jw-devs/TalkTimer | /components/Timer/index.js | UTF-8 | 1,825 | 2.5625 | 3 | [] | no_license | import "./index.css";
import React, { Component } from "react";
import SimplePeer from "simple-peer";
import Clock from "../Clock"
import cookie from 'react-cookie';
let drone = new ScaleDrone('hEEcTJ0uLuROW3Wt');
export default class Timer extends Component {
constructor(props) {
super(props);
this.state = {
... | true |
206bb1229ad871abba02c96ffb87f0d89f223567 | JavaScript | 8bit-echo/CU-Ind-Study-ADV-JS | /NodeJS/Lynda/spawn.js | UTF-8 | 372 | 2.5625 | 3 | [] | no_license | /* jshint esversion: 6 */
var spawn = require('child_process').spawn;
var child = spawn("node", ["alwaysTalking"]);
child.stdout.on('data', function(data){
console.log(`STDOUT: ${data.toString()}`);
});
child.on('close', function() {
console.log("Child Process ended.");
process.exit();
});
setTimeout(fun... | true |