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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f9feaa9db24f84b00358247ded7c9695f79f7f5a | JavaScript | Rachel2308/locate-a-loo | /assets/js/email.js | UTF-8 | 1,089 | 2.90625 | 3 | [] | no_license | /* Code to send email through contact form */
function sendMail(contactForm) {
emailjs.send("service_ui3w5sr", "locate-a-loo", {
"from_name": contactForm.name.value,
"from_email": contactForm.emailaddress.value,
"subject": contactForm.subject.value,
"reason": contact... | true |
c757f8baf6e281321aaf18cc639663d4d72ac92a | JavaScript | cdot18/sims | /quantum-scattering/sketch.js | UTF-8 | 6,719 | 3 | 3 | [] | no_license | var xspacing = 1 //Why?
var Re //Store values of REAL part of wavefunction
var Im //Store values of IMAGINARY part of wavefunction
var p //Store values of Mag(Psi)^2
var theta // theta = wt (intialized to zero when init() function is called)
var wavelength1 //Wavelength depends on E-V
var wavelength2 //Wavelength2 shou... | true |
1c06ddbe3216adf61f3956d0ceca85b7d9baae79 | JavaScript | rrweil/PersonListerReact | /HW4.14.21/ClientApp/src/PeopleTable.js | UTF-8 | 2,439 | 3.015625 | 3 | [] | no_license | import React from 'react';
import PersonForm from './PersonForm';
import PersonRow from './PersonRow';
class PeopleTable extends React.Component {
state = {
person: { firstName: '', lastName: '', age: ''},
people: []
}
onFirstNameChange = e => {
this.setState({
person... | true |
ec5f12c3fc344b51e74886b6cd97354505e14d0a | JavaScript | qwertyssss/scillbox | /script.js | UTF-8 | 1,401 | 2.765625 | 3 | [] | no_license |
// В Javascript
let button=document.querySelectorAll('.btn-order');
let popup=document.querySelector('.popup');
for (var i = 0; i < button.length; i++) {
button[i].addEventListener('click' , function () {
popup.classList.add('_is-shown');
});
}
function checkParams... | true |
291b135c1a93669d236b3ec8960c1dc006928ae1 | JavaScript | wesbishop/week11-node-exercises | /read-a-file/index.js | UTF-8 | 417 | 2.8125 | 3 | [] | no_license | const fs = require("fs");
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
})
rl.question('filename: ', (fname) => {
rl.close();
console.log(`Your file name is: ${filename}`)
fs.readFile(fname, 'utf8', (err, data) => {
if (err) {
... | true |
8e75d103b9b54b840cb74236be1f39f9a50501d6 | JavaScript | atillabaspinar/retail24_transaction_check | /build/utils/transaction-helper.js | UTF-8 | 6,594 | 2.8125 | 3 | [] | no_license | "use strict";
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySy... | true |
8b303bfd770e2286e1edea70b28e9e223abda93a | JavaScript | Xieanhui/saiving.com | /User_no/Lib/class_liandong.js | GB18030 | 1,466 | 2.796875 | 3 | [] | no_license | //˵ʵ֡
function CLASS_LIANDONG_YAO(array) {
//飬Դ
this.array = array;
this.indexName = '';
this.obj = '';
//SELECT
// ǰonchangeSELECT IDҪõSELECT ID
this.subSelectChange = function(selectName1, selectName2) {
//try
//{
var obj1 = document.all[selectName1];
var obj2 = document.all[selectName2];
var objName... | true |
b9fcf02030d042b14af48e661886c583b0896191 | JavaScript | ScottDavey/Honey-Bear | /scripts/utilities/button.js | UTF-8 | 1,979 | 3.53125 | 4 | [] | no_license | /*******************************************
************** BUTTON CLASS **************
*******************************************/
class Button {
constructor(imgPath, pos, size) {
this.img = new Image(imgPath, new Vector2(pos.x, pos.y), new Vector2(size.x, size.y));
this.pos = this.img.GetPos()... | true |
80493e5e90fe30a995f07971691c2f579f37ebf3 | JavaScript | jkaeuffer/konami-code-lab-bootcamp-prep-000 | /konami_code.js | UTF-8 | 456 | 3.046875 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const code = [38, 38, 40, 40, 37, 39, 37, 39, 66, 65];
let correctKeys = 0;
function init() {
const target = document.body
target.addEventListener('keydown', function(key) {
let keyPressed = parseInt(key.which || key.detail);
if (keyPressed === code[correctKeys]) {
correctKeys++;
if (correctK... | true |
e0a64625c42aaf480af98f70708666a1f401406d | JavaScript | hubgit/hubmed | /vendor/jquery.pluralise.js | UTF-8 | 319 | 2.9375 | 3 | [
"MIT"
] | permissive | (function($){
var numberWithCommas = function(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
$.pluralise = function(count, single, plural) {
plural = plural || single + "s";
var suffix = Number(count) === 1 ? single : plural;
return numberWithCommas(count) + " " + suffix;
};
})(jQuery); | true |
355b72afe3056668448fe17dd60c2535b953af22 | JavaScript | axe-z/socketio | /node-Todo-User/playground/utils/utils.test.js | UTF-8 | 1,766 | 3.453125 | 3 | [] | no_license | const utils = require('./utils.js');
const expect = require('expect');
describe("add", () => {
it("should be 44", () => {
let res = utils.add(11, 33);
// if(res === 44) {
// console.log('bravo')
// };
expect(res).toBe(44)
});
it('square', () => {
let res = utils.square(3)
// if(res !... | true |
5adf6626b72f98a91727466502e4aa3293f45f79 | JavaScript | khellytaguinod/My-Hashtag-Generator | /HashTagGenerator-Refratored/js/function.js | UTF-8 | 1,067 | 3.484375 | 3 | [] | no_license | let removePunctuations = function(input) {
return input.replace(/[&\/\\#,+()$~%.'":;*?<>{}\^\@\-\=\`\!]/g, '');
}
let generateHashtag = function(message) {
let input = document.getElementById("message").value.trim();
let cleanString = removePunctuations(input);
let words = cleanString.s... | true |
055ed67ec1878f07a6e401f22f14865f7c48d306 | JavaScript | dysha88/MyProjects | /Slot/public_html/js/betLevelButtons.js | UTF-8 | 4,867 | 2.53125 | 3 | [] | no_license | function BetLevelButtons() {
var me = this;
var i;
this.lastSettings = {};
var rootContainer = new PIXI.Container;
rootContainer.position.x = 0;
rootContainer.position.y = 0;
var betLevelBars = [];
this.getSettings = function (settings) {
me.lastSettings = settings;
};
... | true |
d56d86d99abd3dba67d3ff8a7c98048d7cca03c5 | JavaScript | LizKamugisha/Coding-Practice | /Refactory-Catalyst-Course/Assignments/array_classnotes.js | UTF-8 | 504 | 4.3125 | 4 | [] | no_license | // Multi-dimentional array below
var myNum = [10,20,30,[50,60,[70,80]]];
// Check the length of an array with .length
// The computer will print 4, because it counts the arrays within (on index 3) as one
console.log(myNum.length);
// The 2nd array is in position 3,
// and the 3rd array is in position 2,
// and the ... | true |
bf4969a74898cc75d996936c43945aee14c3a237 | JavaScript | matiaszanolli/kuan | /server/static/js/canvex/camera.js | UTF-8 | 4,739 | 3.046875 | 3 | [] | no_license | var Camera = function(){
// position of eye
this.x = 0;
this.y = 0;
this.z = 0;
// viewing direction (unit vector)
this.dx = 0;
this.dy = 0;
this.dh = 0; // vertical view offset
this.s = null; // current sector
this.t = 0; // current time (seconds since start of game)
};
Camera.proto... | true |
f4d61eb283a091b264f3896ecbf78f7c5d2e47fc | JavaScript | dimapositiva/abramyan-programming-task-book | /begin/begin-3.js | UTF-8 | 300 | 3.59375 | 4 | [
"MIT"
] | permissive | //Даны стороны прямоугольника a и b. Найти его площадь S = a*b и периметр P = 2(a + b).
const getPerimAndAquare = (a, b) => {
let perim = 2*(a + b);
let square = a * b;
console.log('Perimeter is: ' + perim + '\n' + 'square is: ' + square);
};
| true |
27612f3401bddb7e6af74bfd6866d3d0b5bf85a8 | JavaScript | logan-y/Code_Challenges | /mealCount.js | UTF-8 | 1,255 | 3.59375 | 4 | [] | no_license | var list1 = [
{ firstName: 'Noah', lastName: 'M.', country: 'Switzerland', continent: 'Europe', age: 19, language: 'C',
meal: 'vegetarian' },
{ firstName: 'Anna', lastName: 'R.', country: 'Liechtenstein', continent: 'Europe', age: 52, language: 'JavaScript',
meal: 'standard' },
{ firstName: ... | true |
88eaa7b14fb7bdb2936145675f6537274219c866 | JavaScript | JHouck1230/group-sorter | /main.js | UTF-8 | 1,601 | 3 | 3 | [] | no_license | 'use strict';
$(document).ready(init);
function init() {
var $container = $('#container');
$('#entryField').on('click', '#submit', submitData);
$container.on('dblclick', '.close', removeElement); // 'click' doesn't work for some reason
$('.list').on('click', '.record', clickRecord);
$container.on('click', '.list... | true |
2fb12c164d7b86c3c0427617ae7b9c3cce7fca91 | JavaScript | ShravyaHub/JavaScript-Practice-Problems | /If And Else/HeadsOrTails.js | UTF-8 | 132 | 3.09375 | 3 | [] | no_license | let coinFlip = Math.floor(Math.random() * 10) % 2;
if(coinFlip == 1) {
console.log("Heads")
} else {
console.log("Tails");
} | true |
0551199281ba0c71c147d1bfb9b00c89218b7ee2 | JavaScript | BackStreetSoy/theater_challenge | /app/assets/javascripts/showing.js | UTF-8 | 614 | 2.875 | 3 | [] | no_license | // updates the price of the purchase
// creates a button to purchase tickets ONLY if a value appears, this prevents the purchase of 0 tickets
$(document).ready(function(){
$(".number_of_tickets").change(function(sel){
value = parseInt(sel.target.value)
price = 7.30 * value
showing_id = $(... | true |
a4acdda596723a69c88f1442bdc262a21d17dce8 | JavaScript | minimalweb/text.sugar-for-Espresso | /text.sugar/Support/Scripts/duplicate_selection.js | UTF-8 | 1,103 | 2.921875 | 3 | [
"MIT"
] | permissive | // Duplicates the current selection or line
var textContext = require('text_action_context').textContext;
var TextRecipe = require('text_recipe').TextRecipe;
var Range = require('range').Range;
// exports.main is your primary function, run automatically by Spice
exports.main = function() {
// save the current cursor... | true |
8c0c261a2b930707c81cad93609708edd6b134aa | JavaScript | MicroKiss/Szakdolgozat | /src/server/objects/Portal.js | UTF-8 | 7,061 | 2.625 | 3 | [] | no_license | const engine = require('../engine.js');
const Ball = require('./Ball.js');
const global = require('../globals.js');
const Wall = require('./Wall.js');
class Portal extends Wall {
constructor(x, y, w, playerID, color) {
super(x, y, w, w);
this.playerID = playerID;
this.color = color;
... | true |
d225eb64f4cdf06dea0c5b44fdb095bfa3a26d67 | JavaScript | shuishiyuan/aoapc-bac2nd | /ch2/ch2-pg16-exer4.js | UTF-8 | 731 | 3.328125 | 3 | [] | no_license | console.log("Subsequence");
const readLine = require("readline");
const rl = readLine.createInterface({
input: process.stdin
});
rl.on('close', () => {
process.exit()
});
let counter = 1;
let n = 0;
let m = 0;
const processLine = async () => {
for await (let input of rl) {
if (input == 0) {
... | true |
3c18bf968b8ac54fa0c327ec4e21167f069a3108 | JavaScript | K-Zama/trello-beautiful-dnd | /src/Components/Form/Form.jsx | UTF-8 | 1,328 | 2.59375 | 3 | [] | no_license | import React from 'react';
import './Form.scss';
const Form = (props) => {
const handleChange = (e) => {
props.setInputText(e.target.value);
}
const addElement = (e) => {
e.preventDefault();
props.elements.lists[0].items.push({id:`element-${Math.random() * 1000}`, text:... | true |
3ff2719acd97e48b67b60b1b976275e72592107e | JavaScript | brunorcajo/boilerplate-observable-rxjs | /src/store/users.js | UTF-8 | 1,008 | 2.515625 | 3 | [] | no_license | const TYPES = {
FETCH_USERS_REQUEST: "FETCH_USERS_REQUEST",
FETCH_USERS_SUCCESS: "FETCH_USERS_SUCCESS",
FETCH_USERS_FAILURE: "FETCH_USERS_FAILURE",
};
const initialState = {
isFetching: false,
status: null,
error: "",
users: [],
};
const reducer = (state = initialState, action) => {
switch (action.typ... | true |
ba924b7525bcf790577d0e0bd10bd7e30978348c | JavaScript | hephaestic/NodeSchool | /learnyounode/http-json-api-server.js | UTF-8 | 1,083 | 2.984375 | 3 | [] | no_license | var port = process.argv[2];
var http = require('http');
var url = require('url');
var server = http.createServer(function (req, res){
var info = url.parse(req.url, true);
var date = new Date(info.query.iso);
var ans;
if(info.pathname === '/api/parsetime'){
ans = parsetime(date);
}else if(info.path... | true |
f4e140bfe6ff3a669fd90bb1c6de3a9b474fd14e | JavaScript | Shery11/firebasecloudfunctions | /functions/index.js | UTF-8 | 8,297 | 2.5625 | 3 | [] | no_license | const functions = require('firebase-functions');
const admin = require('firebase-admin');
var Q = require('q');
admin.initializeApp(functions.config().firebase);
exports.playerPoints = functions.database
.ref('days/{week}/games/{day}/score').onWrite(event => {
const data = event.data.val();
const... | true |
fc765b89a13c7eab31b64edacbefb9a75f8cf1a8 | JavaScript | segalrh/hebrew-keyboard | /Index.js | UTF-8 | 1,319 | 2.640625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import KeyBoard from "./KeyBoard";
import Button from "@material-ui/core/Button";
import "./App.css";
import TextField from "@material-ui/core/TextField";
function App({}) {
const [results, setResults] = useState([]);
const [keyBoard, setKeyBoard] = useState(fals... | true |
fc1dd531be6d1b738e94831b16ae2c702801fa90 | JavaScript | lubomirv999/JS-Core-SoftUni-2016-Sept---Dec | /JavaScript-Fundamentals/7.1 Arrays And Matrices Exercises/7.1 Arrays and Matrices Exercises/05. Extract Increasing Subsequence from Array.js | UTF-8 | 399 | 3.0625 | 3 | [] | no_license | function extractIncSubseqFromArr(input) {
input = input.map(Number);
let arrSize = input.length;
let currentBiggestNum = Number.NEGATIVE_INFINITY;
for(let i=0; i < arrSize; i++) {
let currentNum = input.shift();
if(currentNum >= currentBiggestNum) {
currentBiggestN... | true |
a194654ac5c302b8099be5f50e1924c81f6ce5f5 | JavaScript | dewfall123/Diary | /leetcode/17.letter-combinations-of-a-phone-number.js | UTF-8 | 1,507 | 3.78125 | 4 | [] | no_license | /*
* @lc app=leetcode id=17 lang=javascript
*
* [17] Letter Combinations of a Phone Number
*
* https://leetcode.com/problems/letter-combinations-of-a-phone-number/description/
*
* algorithms
* Medium (44.81%)
* Likes: 3294
* Dislikes: 374
* Total Accepted: 542.6K
* Total Submissions: 1.2M
* Testcase ... | true |
04ba790f012cb7cd21c948b080c0a6d807839c36 | JavaScript | camsong/localStorage-info | /src/index.js | UTF-8 | 3,265 | 3 | 3 | [
"MIT"
] | permissive | /* global localStorage */
function readablizeBytes(bytes) {
const time = Date.now();
if (bytes === 0) { return '0 bytes'; }
const s = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'];
const e = Math.floor(Math.log(bytes) / Math.log(1024));
const result = (bytes / Math.pow(1024, e)).toFixed(2) + ' ' + s[e];
console.... | true |
aa84d144b39c8248ed52fbca03fc88daa92b44fd | JavaScript | acdvorak/rquirejs | /lib/compiler/file.js | UTF-8 | 5,879 | 2.578125 | 3 | [
"MIT"
] | permissive | var fs = require('fs')
, path = require('path')
;
var rRequireSingleQuote = /require\s*\(\s*'(\.[^']+?)'\s*\)/g
, rRequireDoubleQuote = /require\s*\(\s*"(\.[^"]+?)"\s*\)/g
, rBlockComment = new RegExp('/\\*[\\s\\S]*?\\*/', 'g')
, rLineComment = new RegExp('//.*', 'g')
, rJSExt = /\.js$/
, rWinDirSep = /... | true |
67d35b9971b801f0c25f739ab6bcb4d536fda6be | JavaScript | deejayvee/WeighInAPILambdas | /src/deejayvee.WeighIn/deejayvee.WeighIn.Alexa.Skill/index.js | UTF-8 | 6,122 | 2.546875 | 3 | [] | no_license | const Alexa = require('ask-sdk');
const API_URL = '2c6b4q2jn6.execute-api.ap-northeast-1.amazonaws.com';
async function getUser(userId, firstName) {
return new Promise((resolve) => {
var options = {
host: API_URL,
port: 443,
path: '/Prod/user/' + userId + '/' + firstNam... | true |
02b8ce5bf6a738ecd0358ceabb69f8ed1cc9a2ea | JavaScript | zirri/academy-js19 | /Uke 7/demo-testing/test/grades_test.js | UTF-8 | 1,113 | 2.8125 | 3 | [] | no_license | const assert = require('chai').assert;
const grades = require('../grades');
//No need to require mocha
//the strings as first argument output when running tests
describe('grades', ()=>{
describe('foo',()=>{
it('should return bar', () => {
let foo = grades.foo();
assert.equal(foo, 'b... | true |
134136a6f4ff05c371ee73c3419c18a063b427d1 | JavaScript | Xingwei726/dvia-2019 | /3.mapping-space/project/Final/diagram.js | UTF-8 | 7,190 | 2.984375 | 3 | [] | no_license | var day = [];
var hour = [];
var mag =[];
var depth =[];
var myColor;
var tooltip;
var format = d3.format(".4n");
var margin = { top: 100, right: 50, bottom: 200, left: 50 },
width = 1440 - margin.left - margin.right,
height = 920 - margin.top - margin.bottom;
var svg = d3.select('#myDiagram')
.a... | true |
085466bc0c4aff523dd4bd3da2cdef3012c7d7f1 | JavaScript | alzatin/JSxCAD | /algorithm/shape/buildGeodesicSphere.js | UTF-8 | 548 | 2.703125 | 3 | [
"MIT"
] | permissive | import { buildRegularIcosahedron } from './buildRegularIcosahedron';
import { subdivideTriangularMesh } from './subdivideTriangularMesh';
import { unit } from '@jsxcad/math-vec3';
/**
*
* Builds a sphere with at least the number of faces requested, and less than
* four times the number of faces requested.
*/
exp... | true |
7a86b122c9d6b311cfa19c7edee24985374b0bf0 | JavaScript | gussalvarez07/cajero | /funcion.js | UTF-8 | 1,969 | 4.03125 | 4 | [] | no_license | function movimiento(cuenta, operacion = "credito") {
let action;
let valor1;
if (operacion == "credito") {
action = "ingresar";
} else {
action = "debitar";
}
const monto = prompt(`Monto a ${operacion}`);
if (cuenta == "567") {
valor1 = 10000;
} else {
va... | true |
62baee49c1f2fc621d4c36a92a7a2888b036bcad | JavaScript | Nongchaozhe/LeetCode | /215 KthLargestElementInAnArray.js | UTF-8 | 729 | 3.390625 | 3 | [] | no_license | /**
* @param {number[]} nums
* @param {number} k
* @return {number}
*/
var findKthLargest = function(nums, k) {
QSort(nums, 0, nums.length - 1);
if (k >= 1 && k <= nums.length) {
return nums[nums.length - k];
}
};
function QSort(nums, l, r) {
if (l > r) {
return;
}
let i = l... | true |
1b3d2977b9badafd13f5c853f00970af440999c6 | JavaScript | anniemcghee/angular_custom_directive_lab | /js/script.js | UTF-8 | 1,248 | 2.671875 | 3 | [] | no_license | var todoApp = angular.module('TodoApp',['ngAnimate','like-button','weather-widget']);
//the following is a good idea to do to see that the app is actually starting
//it depend on the ng-app being called in the html file body tag
todoApp.run(function(){
console.log('App started');
})
//next we need to define a contr... | true |
829b5a09075438a7e5cf8c1561fd9218f6f2daf7 | JavaScript | electricSoda/the_amigos | /game.js | UTF-8 | 1,073 | 3.203125 | 3 | [] | no_license | function start_game() {
console.log("hi there");
}
function run() {
function component(width, height, color, x, y) {
this.width = width;
this.height = height;
this.speedX = 0;
this.speedY = 0;
this.x = x;
this.y = y;
this.update = function() {
ctx = myGameArea.contex... | true |
c830996735c136ff1e1d4e6941051eda4e2d9f3e | JavaScript | Ajith-Pandian/Maps | /redux/location/locationDidUpdate.js | UTF-8 | 635 | 2.578125 | 3 | [] | no_license | import createObservableFromDeviceEventEmitter$ from './createObservableFromDeviceEmitter';
/**
* Creates an Observable to listen to `locationUpdated` event
* dispatched by Location (react-native-location)
*/
export default locationDidUpdate$ = (delay=1000) => {
return createObservableFromDeviceEventEmitter$('l... | true |
7b20643d39ffedc37bd3f58be6a235daa30dca9a | JavaScript | FranMusco/Franco | /nose.js | UTF-8 | 430 | 4 | 4 | [] | no_license |
edad = 18;
if (edad >= 18) {
// Block scope (si hay una llave)
let mas10 = edad + 10;
console.log(En 10 años tendras $(mas10)años.);
}
// Esto tira error porque mas10 no existe fuera del "if"
// console.log("Total es", mas10);
// -------- CONST --------
// Constante -> 3.14
// Block scope, al igual q let, ... | true |
06d34aaebaf0811ba70e24f68863e8bd92d91628 | JavaScript | kmikitin/wdi-10-tic-tac-toe-lab | /Kait/js/app.js | UTF-8 | 5,950 | 3.328125 | 3 | [] | no_license | console.log('Linked.')
let $theBoard = $('#board');
let toggle = true;
let xScore = 0;
let oScore = 0;
let xWon = false;
let oWon = false
// MAX ROUND SHOULD BE 3
let round = 0;
let xSquares = [];
let oSquares = [];
// THIS FUNCTION WAS MOVED INTO THE SET BOARD FUNCTION
// function showX(evt){
// // console.log(e.... | true |
e9a1d021097879bc11c8e0fe3b8789f868c9e035 | JavaScript | EgeOnder/carvbot-discord | /src/commands/stop.js | UTF-8 | 1,249 | 2.5625 | 3 | [
"MIT"
] | permissive | const { play } = require('../functions/playFunction');
const { MessageEmbed } = require('discord.js');
module.exports.run = async (client, message, args, url, searchString, queue, serverQueue) => {
if (!message.member.voice.channel) {
const voiceChannelEmbed = new MessageEmbed()
.setColor('#ff0000')
.setTitle... | true |
4fe56049d5bca8013f26e4bdcf9286650a7bb420 | JavaScript | wfWebDever/js_base | /InterView/promise/try-catch-promise.js | UTF-8 | 325 | 2.796875 | 3 | [] | no_license | ;(async () => {
try {
let pro = await new Promise((res, rej) => {
rej('error')
})
} catch (e) {
console.log('get the catch:', e)
}
})()
const a = { name: 'a' }
const b = { name: 'b' }
function fun1() {
console.log(this.name)
}
const fun2 = fun1.bind(a)
const fun3 = fun2.bind(b)
fun3()
fun2.cal... | true |
2dff7bac3114873f413c32e577655656b4bdc386 | JavaScript | Shizbriz/Kisame | /src/App.js | UTF-8 | 2,330 | 2.625 | 3 | [] | no_license | import './App.css';
import React from 'react';
let Nav =()=>
<div className="nav">
<div className="left">
<a href="#home">Home</a>
</div>
<form className="searchbar">
<input type="text" placeholder=" Search ..."></input>
<button className="btn" type="submit">Search </button>
</form>
<div className="right">
<... | true |
e7826ef768309188958db6acb171929bc9d9e1e9 | JavaScript | Fire-Breathing-Rubber-Duckies-1/Group-Project | /assets/goingOutMovie.js | UTF-8 | 9,467 | 2.734375 | 3 | [] | no_license | var showtime, theaters, movies, filteredShowtimes = []
var theatersObj = {},
moviesObj = {}
function handleGoingOutClick(e) {
e.preventDefault();
console.log(e)
var userCity = $("#citySearch").val();
var encodedCity = encodeURIComponent(userCity);
let CitiesEndpointCall = "https://api.in... | true |
6307372f597f440ae4297ee1766f233a2ed33167 | JavaScript | ricardotulio/mikrotikadmin | /target/mikrotikadmin/assets/js/pages/faturas.js | UTF-8 | 561 | 2.546875 | 3 | [] | no_license | $(".btn-cancelar-fatura").click(
function() {
var id = $(this).data("id");
bootbox.confirm(
"Tem certeza que deseja alterar o status da fatura?",
function(result) {
if (result)
window.location.href = id + "/cancelar";
});
});
$(".btn-pagar-fatura").click(
function() {
var ... | true |
473517517d13c455c2447f7e11a6e61dcb5521a0 | JavaScript | dandydanny/imgview | /imgview.js | UTF-8 | 1,257 | 3.4375 | 3 | [] | no_license | // Steps
// -----
// Look inside div with class "md"
// Underneath, loop inside p tags
// If it's an image link
// insert img src tag
// Do this for all image links.
// Updated Steps
// -------------
// Better method, won't ruin surprise:
// On mouse over img link, display image
// Ideas
// -------------
//
... | true |
25067ec4d213068ffb8a01013d25c38ae0193e52 | JavaScript | alucardpetrovich/goit-lessons | /bc15/auth_example/app/question/question.controller.js | UTF-8 | 2,000 | 2.796875 | 3 | [] | no_license | const questionModel = require("./question.model");
const Validator = require("node-validator");
class QuestionController {
get createQuestion() {
return this._createQuestion.bind(this);
}
get getQuestions() {
return this._getQuestions.bind(this);
}
get getQuestionById() {
return this._getQuestion... | true |
1ee1c991d0bc80c06e81751da0c7cc710f515c59 | JavaScript | jackosx/kyoku | /divops.js | UTF-8 | 1,301 | 2.859375 | 3 | [
"MIT",
"CC-BY-3.0"
] | permissive |
const getStyle = (el,styleProp) => {
var x = el;
var y = "";
if (x.currentStyle)
y = x.currentStyle[styleProp];
else if (window.getComputedStyle) {
var style = document.defaultView.getComputedStyle(x,null);
y = style[styleProp];
}
return y;
}
const countLines = (target)... | true |
1a874502ca27ef3d534edd71b4897e0dab04abdf | JavaScript | kcates81/Codeup-Web-Exercises | /public/js/js-examples.js | UTF-8 | 1,973 | 3.65625 | 4 | [] | no_license | (function() {
"use strict";
var favoriteMovies = ['The Shawshank Redemption', 'The Color Purple', 'Coming to America', 'Zoolander', "It's Complicated", 'The Breakfast Club', 'Pootie Tang', 'Star Wars: A New Hope', 'Interstellar', 'The Hunt for Red October'];
function logMovies(movieArray) {
console.... | true |
6bc9dfbf815403eda8d8ea4c260a4b7f757dd424 | JavaScript | planttheidea/utilities | /src/sort.js | UTF-8 | 574 | 2.65625 | 3 | [
"MIT"
] | permissive | // external dependencies
import {curry} from 'curriable';
// utils
import {
getKeys,
onMatchType
} from './_utils';
export const sortArray = (fn, array) => [...array].sort(fn);
export const sortObject = (fn, object) => {
const keys = getKeys(object);
keys.sort((keyA, keyB) => fn(object[keyA], object[keyB]))... | true |
15f04d5cfe74c3e9b32beab166bcd31422b23f29 | JavaScript | chrisgreeff/ph-tt | /src/entities/customer-note/db/getters.js | UTF-8 | 1,294 | 2.640625 | 3 | [] | no_license | // This file implements the customer note database fetch functions.
//
import { forEach } from 'lodash'
import { errorService } from 'services'
import { knex } from 'db'
class CustomerNoteGetterActions {
async getCustomerNotes () {
try {
const customerNotes = await knex('customer_notes')
.select()
... | true |
7efad21974c7f5081b999107e89c49493af2d978 | JavaScript | jackhwl/nodejs-d3-chart | /NodeJs_Testing_Strategies/rocket-shop/lib/subscriptions/processes/review.js | UTF-8 | 1,728 | 2.75 | 3 | [] | no_license | var async = require("async");
var assert = require("assert");
var ReviewProcess = function(args){
assert(args.application, "Need an application to review");
var app = args.application;
// make sure the app is valid
this.ensureAppValid = function(next){
if (app.isValid()) {
next(nul... | true |
0235251f9c9ea3178bde9aeb806436e51bb8e1b3 | JavaScript | kpucci/mysite | /project_files/battleship/static/battleship_functions.js | UTF-8 | 36,757 | 3.21875 | 3 | [] | no_license | // THIS CODE IS A DISASTER TO READ THROUGH.. I AM SO SORRY!
// A:a3-a7;b:b3-b6;s:c3-c5
// A:b3-b7;b:c3-c6;s:d3-d5
var name1;
var name2;
var ships1;
var ships2;
var aircraft1;
var aircraft2;
var battleship1;
var battleship2;
var submarine1;
var submarine2;
var currentPlayer = 1;
var lockedIn = null;
var missedHits1 = ... | true |
49cf3dae51d56cd40058986253bb49a4cff4b7a2 | JavaScript | MyProjects2/JS-task4 | /script.js | UTF-8 | 1,019 | 3.640625 | 4 | [] | no_license | 'use strict'
function randomDiap(n,m) {
return Math.floor(Math.random()*(m-n+1))+n;
}
function mood(colorsCount) {
var colors=[ '', 'красный', 'оранжевый', 'жёлтый', 'зелёный', 'голубой', 'синий', 'фиолетовый' ];
var obj = {};
console.log( 'цветов: ' + colorsCount );
for ( var i=1; i<=colorsCount; ... | true |
345cde8d3fe83db9c70925558b38a7ca53da772c | JavaScript | herobaby71/buddymapapp | /app/data/location/reducer.js | UTF-8 | 610 | 2.5625 | 3 | [] | no_license | import { POSTING, SUCCESS, FAILURE } from './constants'
const initialState = {
coords: {},
isPosting: false,
error: false
}
export default function locationReducer (state = initialState, action) {
switch (action.type) {
case POSTING:
return {
...state,
coords: {},
isPosting: ... | true |
3b38407df1ce8b0e2d4a431ecc85a382ebdcf9f9 | JavaScript | juliajohari/javascript-exercises | /fibonacci/fibonacci.js | UTF-8 | 386 | 3.59375 | 4 | [] | no_license | const fibonacci = function(numberInput) {
let fibonacciArray = [1, 1];
let reply = 1;
if (parseInt(numberInput) <= 0) {
return "OOPS"
}//end guard clause
for (let i = 3; i <= parseInt(numberInput); i++) {
reply += fibonacciArray[i-3];
fibonacciArray.push(reply);
}//end lo... | true |
c9273cec2110d14a4b885a1989c6b4674cf998eb | JavaScript | Patryczeqq/zineV1-najnowsze | /cmds/giveaway.js | UTF-8 | 3,810 | 2.71875 | 3 | [] | no_license | const ms = require("ms")
module.exports = {
name: "giveaway",
description: "Tworzy nowy giveaway.",
aliases: ["gcreate", "gstart"],
category: "Przydatne",
usage: "<czas, np. 3h> [kanał] <nagroda>",
async run(message, args, client) {
if (!message.member.hasPermission("MANAGE_GUI... | true |
794e2bd614b978e901e7e0bb365f5cddd6e52e6a | JavaScript | mikey-roberts/Thermostat-JS | /src/interface.js | UTF-8 | 2,555 | 3.390625 | 3 | [
"MIT"
] | permissive | document.addEventListener("DOMContentLoaded", () => {
const updateTemperature = () => {
document.querySelector('#temperature').innerText = thermostat.temperature;
document.querySelector('#temperature').className = thermostat.energyUsage();
}
const thermostat = new Thermostat();
updateTemperature();
... | true |
c25c052684a2ef41a38e95c35a6d2afd309573b4 | JavaScript | th7/programming-challenges | /slow-double/public/javascripts/SlowDouble.js | UTF-8 | 575 | 3.484375 | 3 | [] | no_license | var logger = function(x) {
console.log(x)
}
var slowDouble = function(x, callback) {
console.log('slowDouble')
setTimeout(function() {
callback(x * 2);
}, 500);
}
function slowDoubleNTimes(n, x, callback) {
if(n === 0) {
callback(x)
return
}
slowDouble(x, function(x) {
slowDoubleNTimes(... | true |
0cf746bf842f6290095d0e09a47b9f76e5afa003 | JavaScript | lcc677/javaScript-demo | /对象其余方法/hasOwnProperty.js | UTF-8 | 1,383 | 3.328125 | 3 | [] | no_license |
let a = {
key1:"key1"
}
Object.prototype.key2 = "key2"
console.log(Object.getPrototypeOf(a))
console.log(a.prototype)
let values1 = Symbol('values1')
let b = {
value1:"value1",
[values1]:"value1"
}
Object.defineProperty(b,'value2',{value:'value2'})
Object.setPrototypeOf(b,a)
console.log(b.key1)
console.log(b.key... | true |
c1475a000e3dd095f1b276b6cd2b82c04c50feda | JavaScript | edilson14/10-Days-Of-Js | /Day 2: Conditional Statements: Switch .js | UTF-8 | 552 | 3.46875 | 3 | [] | no_license | function getLetter(s) {
var letter = '';
const caseA = 'aeiou'
const caseB = 'bcdfg'
const caseC = 'hjklm'
const caseD = 'npqrstvwxyz'
switch (true) {
case caseA.includes(s.charAt(0)):
letter = 'A'
break
case caseB.includes(s.charAt(0)):
... | true |
97b5de411048b05c530640b28e0dbfd0a9c51583 | JavaScript | ImranGreat1/abu_project | /client/src/utils/index.js | UTF-8 | 738 | 3 | 3 | [] | no_license | export const adjustDoubleSlashes = (path) => {
if (path.length === 1 && path.at(-1) === '/') {
path = '';
}
if (path.at(-1) === '/' && path.at(-2) === '/') {
path = path.substring(0, path.length - 1);
}
return path;
};
const shortMonths = [
'Jan',
'Feb',
'Mar',
'Apr',
'May',
'Jun',
'J... | true |
c0b265305e9806af8a183a55cfadd73aed02cfca | JavaScript | joyplus/statichtml | /static/js/campaign_weektime.js | UTF-8 | 3,520 | 2.734375 | 3 | [] | no_license |
//hover delete button
$("#readableWeekTime ul li").hover(
function() {
$(this).children(".del").css("display","inline");
},
function() {
$(this).children(".del").css("display","none");
}
);
//some variables
... | true |
a3f33786602a015355822290a66eb53e4ddfb29c | JavaScript | anniebart/pixelArtAuthentication | /public/art.js | UTF-8 | 591 | 3.453125 | 3 | [] | no_license |
function setup(){
createCanvas(window.innerWidth, window.innerHeight);
frameRate(2)
}
function draw() {
background(255)
for (let i=0; i < window.innerWidth; i+=20){
for (let j=0; j< window.innerHeight; j+=20){
const colors = ["#F46060", "#F49E4E", "#F... | true |
fee1fe54f07907a7a04a41b10bf038a5d3f16d19 | JavaScript | dangphong91/hamcuamang | /bai1/edit1.js | UTF-8 | 103 | 2.78125 | 3 | [] | no_license | let myColor = ["Red", "Green", "White", "Black"];
let color = myColor.join(",");
document.write(color); | true |
cb4d3b588719188bec4cfee745243467ea236bfb | JavaScript | rufriedman/planning-poker | /public/js/jquery/modules/jquery.userlist.js | UTF-8 | 1,499 | 2.671875 | 3 | [] | no_license | (function(jQuery, $) {
jQuery.fn.userlist = function(options) {
var me,
listeners;
options = jQuery.extend({}, jQuery.fn.userlist.options, options);
me = $(this);
listeners = $({});
listeners.on('userlist', function(event, message) {
jQuery.fn.userlist.update.call(me, message.data, options);
});
... | true |
cea36c9837b43f7f3e6691d5d161e2bbc3531913 | JavaScript | wjdtjq0630/project | /home/clock.js | UTF-8 | 1,313 | 3.71875 | 4 | [] | no_license | function checktime(i){ //시간이 한자리 수일 경우 앞에 0을 붙여 시간을 반환
if(i<10){
i="0"+i;
}
return i;
}
function getday(i){ //요일숫자를 실제 요일로 반환
var week = new Array('일','월','화','수','목','금','토');
return week[i];
}
function clock(){
var today = new Date(); //서버의 날짜
var year = today.getYear()-100; //년도 끝 두글자 //1900년도부터 년도... | true |
8d90c2b3de1ae3ed8e3728aaa42130374f04a4ba | JavaScript | jaharaclark/frontend-mod-1-prework-2008b | /finalProject/ceasarCipher.js | UTF-8 | 528 | 3.046875 | 3 | [] | no_license | Caesar Cipher
function cipherInput (str, num) {
// It has to be a function in order to work. This part seems basic.
var lowerCaseStr = str.toLowerCase() // This is going to convert the string to lower case text because technically captial characters and lower case characters are different, even though they're the sa... | true |
81bd9dcbc22aa8de01a128b0ff521dc0a57b99e8 | JavaScript | jaiveerbhaidasna/EE461L-Team-Project | /project/venv/frontend/src/components/projects.js | UTF-8 | 1,814 | 2.546875 | 3 | [] | no_license | import { Component } from "react";
import { Form, Button } from "react-bootstrap";
import axios from 'axios'
class Projects extends Component {
state = {
name: "",
id: "",
description: "",
};
handleChange = (e) => {
this.setState({
[e.target.name]: e.target.value,
});
};
handleSub... | true |
e5beb18072c539c745d0ff297142151ba839b4ab | JavaScript | prasanna-rkumar/bolt-fasting-react | /src/Components/RecentFasts/Bar.js | UTF-8 | 1,299 | 2.5625 | 3 | [] | no_license | import dayjs from "dayjs";
import getGoalHoursFromGoalString from '../../utils/getGoalHoursFromGoalString'
const Bars = ({ fastData, longestFastDuration, index }) => {
return (
<div key={fastData._id} style={{ width: 90, minWidth: 90 }} className="h-full flex flex-col justify-end items-center">
<div classN... | true |
7dc02b8e286df0595aae9fa46eaa96a3a57ddd7e | JavaScript | zxcnmv/SimplestWallet | /send-money.js | UTF-8 | 2,245 | 2.765625 | 3 | [
"MIT"
] | permissive | const BSV = require('bsv') //引用bsv库
const MatterCloud = require('mattercloudjs') //引用MatterCloud库
const MatterCloudAPIKey = "CeJg9E1uuVJueBoJg6fkD5f5u7jBv4k7jj4cr6mmo8UTMzuqbq8Muzp3aXYTZ6bTh" //MatterCloud API Key
const matterAPI = MatterCloud.instance({
api_key: MatterCloudAPIKey,
})
let priKeyHex = "79f5876834... | true |
e89aa0a91471d102fd8785348113305f51e3b6d6 | JavaScript | Keerthanab14/breathe | /src/reducers/login.js | UTF-8 | 518 | 3.5625 | 4 | [] | no_license | const initialState = {
loggedIn: false,
userId: '',
};
export default function userReducer(state = initialState, action) {
const { payload = {}, type } = action;
const { userId } = payload;
switch (type) {
case 'LOGIN':
return {
...state,
loggedIn: true,
... | true |
8a2cdce8d8c7e295a00f3c1c9b91f17e95ed3748 | JavaScript | BerlinPM/BerlinPM.github.io | /javascripts/dates.js | UTF-8 | 308 | 2.65625 | 3 | [] | no_license | var url = "javascripts/dates.json";
$.getJSON( url, function( data ) {
var items = [];
$.each( data, function( index, value ) {
items.push( "<li id='" + index + "'>" + value.date + "</li>" );
});
$( "<ul/>", {
"class": "date-list",
html: items.join( "" )
}).appendTo( "#dates" );
});
| true |
27b7b5042bd80e2b113a81efd15e7ab3da0f219f | JavaScript | thetimbanks/Shannon-Roman-Site | /public/javascripts/index.js | UTF-8 | 629 | 2.609375 | 3 | [] | no_license | $(function() {
var slideSpeed = 5000;
function changeImage(current) {
var nextImage = (current.next().length != 0)? current.next() : current.closest("ul").find("li:first");
current.css({zIndex: 2});
nextImage.addClass("current").css({zIndex: 1}).show();
current.removeClass("current").fadeOut(1000, fun... | true |
3175bcc135606926222e39431d805a76e5e651bc | JavaScript | pierva/travel-planner | /__tests__/api_handler.test.js | UTF-8 | 756 | 2.96875 | 3 | [] | no_license | // test apiHandler.js
import request from '../request'
jest.mock('../request')
const handleSubmit = (url, address) => {
return request(url, address).then(data => data)
}
it('should validate the url', async () => {
expect.assertions(2)
try {
await handleSubmit('xxxxxx', 'Miami')
} catch (e) {
... | true |
737524b584fecb845173a7d46acc60ce2503feff | JavaScript | rajiv2607/js-programs | /data-structure-implementation/Stack-Array.js | UTF-8 | 450 | 3.78125 | 4 | [] | no_license | class Stack {
constructor() {
this.data = [];
this.top = 0;
}
push(ele){
this.data[this.top] = ele;
this.top++;
}
peek(){
if(this.data.length>0){
this.data.pop();
top--
}
}
getSize() {
retur... | true |
f414fca3d0edcdb62310f011e9d7a0eedb0464b1 | JavaScript | antonova-elena/772485-nerds-28 | /js/main.js | UTF-8 | 1,559 | 2.625 | 3 | [] | no_license | 'use strict';
(function () {
const ESCAPE = `Escape`;
const toggleVisuallyHidden = function (evt) {
evt.preventDefault();
popupFormElement.classList.toggle(`popup-form-show`);
popupFormElement.classList.remove(`popup-form-error`);
};
const onDocumentKeyDown = function (evt) {
if (evt.key === ... | true |
0e3899c70987870e6fa144c3633921aaa731d560 | JavaScript | js-tasks-ru/jsbasic-20200903_yuriy-yupiter | /5-module/3-task/index.js | UTF-8 | 1,147 | 3.015625 | 3 | [] | no_license | function initCarousel() {
let position = 0;
let slidesAmount = 4;
let elem = document.querySelector('[data-carousel-holder]');
let carouselInnerElem = elem.querySelector('.carousel__inner');
let carouselArrowRight = elem.querySelector('.carousel__arrow_right');
let carouselArrowLeft = elem.querySelec... | true |
5f0668b0c8ca77c111d100de5e9b93a65cf7be3d | JavaScript | samarthsaxena/WebStorage | /js/local_storage.js | UTF-8 | 1,662 | 3.453125 | 3 | [
"MIT"
] | permissive | // Local storage demo js
// localStorage
// localStorage.setItem("key","value")
// localStorage.getItem("key")
// localStorage.removeItem("key")
// localStorage.length -> return length integer
"use strict";
function do_first(){
var button = document.getElementById("submit");
button.addEventListen... | true |
7043959601a4d67fe664574b5d04f87ce536c63d | JavaScript | Foivos/foivos.github.io | /src/js/effects/Stats.js | UTF-8 | 791 | 2.671875 | 3 | [] | no_license |
const defaultStats = {
quickstepRage : 1,
speed : 6,
hp : 100,
}
export class Stats {
constuctor() {
}
get(stat) {
if(typeof this[stat] !== 'undefined') {
return this[stat];
}
else if(typeof defaultStats[stat] !== 'undefined') {
this[stat] = def... | true |
16fd77be756e67609b190b662d50a9e6b21297ff | JavaScript | cjoshmartin/control-center | /user/main.js | UTF-8 | 919 | 2.640625 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$.getJSON('../data/hourlypay.json', function(data1) {
$('#hourly').text('current hourly('+data1.work.hours + 'hr) : $'+data1.work.amount);
// paycheck(12/30/2016) : $310
});
$.getJSON('../data/paycheck.json', function(data2) {
$('#paycheck').text('paycheck('+data2.paych... | true |
2aebca02ea4821ac8d79fc6401ca84aeaf7ca677 | JavaScript | czy71988/newhonr | /src/utils/custom-vue-direction.js | UTF-8 | 1,455 | 2.78125 | 3 | [] | no_license | // 自定义指令
import Vue from 'vue'
const throttle = function (fn, delay) {
let lastTime = 0
return function () {
const nowTime = Date.now()
if (nowTime - lastTime >= delay) {
fn.apply(this, arguments)
lastTime = nowTime
}
}
}
// 全局注册自定义指令,用于判断当前图片是否能够加载成功
// 加载成功则显示替换src所指向的图片,否则显示默认src的图片
/... | true |
c5ea5f4dfbc998d4bfbef153b2093c116979b330 | JavaScript | zhaoshiling1017/xiamiRun | /api/controllers/XiamiController.js | UTF-8 | 4,893 | 2.515625 | 3 | [
"MIT"
] | permissive | // jshint ignore:start
/**
* XiamiController
*
* @description :: Server-side logic for managing xiamis
* @help :: See http://links.sailsjs.org/docs/controllers
*/
var url = require('url');
var http = require('http');
var xmlreader = require('xmlreader');
var isXiamiSong = /www.xiami.com\/song\/\d+/;
var... | true |
0c1982bbbb0f32453b69be3ce4e69684f90ee1ed | JavaScript | HelenGD/Game-of-Life | /src/main/main.js | UTF-8 | 1,514 | 2.78125 | 3 | [] | no_license | import React, { useState } from 'react';
import './main.css';
import { Title } from '../title/title';
import { CreateButton } from '../create-button/create-button';
import { Card } from '../card/card';
import { isNeedLifeCard, isNeedKillLife } from '../utils';
function Main() {
const [cards, setCards] = useState([])... | true |
291e11cb824788b016cad4b8ce18baa2ddcc36e0 | JavaScript | alifathiasakina/temperature-converter | /Converter.js | UTF-8 | 1,434 | 2.84375 | 3 | [] | no_license | class Converter{
fromCelcius(selectTo, tempinput){
if (selectTo == "celcius"){
return tempinput;
}
if (selectTo == "reamur"){
return (4 / 5) * tempinput;
}
if (selectTo == "fahrenheit"){
return (9 / 5) * tempinput + 32;
}
if (selectTo == "kelvin"){
return (5 / 5) * ... | true |
f82090a00a751b20dc35cd39a270aea6198f37eb | JavaScript | bozelli/katas-codewars | /8 kyu/grasshopper-grade-book.js | UTF-8 | 328 | 3.453125 | 3 | [] | no_license | // http://www.codewars.com/kata/grasshopper-grade-book
function getGrade (...scores) {
let avg = scores.reduce((a, b) => a + b )/scores.length;
if (avg <= 100 && avg >= 90) return 'A';
if (avg < 90 && avg >= 80) return 'B';
if (avg < 80 && avg >= 70) return 'C';
if (avg < 70 && avg >= 60) return 'D';
retur... | true |
2ca6a2794e9dc237f6413bdb4c5553eddbaba562 | JavaScript | DiogoBerti/webservice_interface | /public/angular_scripts.js | UTF-8 | 1,944 | 2.546875 | 3 | [] | no_license | angular.module('todoApp', [])
.controller('TodoListController', function() {
var todoList = this;
todoList.todos = [
{text:'learn AngularJS', done:true},
{text:'build an AngularJS app', done:false}];
todoList.statusQuery = ''
todoList.addTodo = function() {
todoList.todos.push({tex... | true |
6f3ba5591c7399b8d0c4aeffbcb66f4eb141a5a7 | JavaScript | tudorbejinari/WaterMe | /src/components/DateUpdate/DateUpdate.js | UTF-8 | 923 | 2.9375 | 3 | [] | no_license | import React from 'react';
const today = new Date().toDateString();
class DateUpdate extends React.Component {
state = {
update: ''
};
handleUpdate = () => {
this.setState({ update: this.state.update + today, hasTriggered: true });
};
render() {
return (
<div>
<p ... | true |
6174fdfc546d0e0a9e6f332849456752bf663896 | JavaScript | compbio-fmach/orcae-upload | /app/webroot/js/scripts/genome_updates.js | UTF-8 | 2,690 | 3.0625 | 3 | [] | no_license | /**
* This library implements calls to genome updates api
* Implements polling functions to retrieve Orcae's update status
*/
function GenomeUpdates(options) {
// Defines internal options
var options = Object.assign({
// Genome config instance
genomeConfig: {id: ''},
// Api url
apiRoot: Defaults.... | true |
78b821ef690c671052873ec18329d56f9464d887 | JavaScript | aliask/scrapelet | /src/index.js | UTF-8 | 3,565 | 3.109375 | 3 | [
"ISC"
] | permissive | /**
* Submits data to an HTTP endpoint.
*
* Creates an IFRAME, which bypasses some CSRF protections (rather than an XHR).
*
* @param {string} data Scraped data to send the configured endpoint
*/
function crossDomainPost(data) {
if(!data) {
return;
}
function makeinput(name, data) {
... | true |
47a46f135d5cf6b10a1d940e46517c68116d0146 | JavaScript | RafaelTuccio/cinema-front-react | /src/util/comboBox.js | UTF-8 | 1,080 | 3.03125 | 3 | [] | no_license | // export const initCombo = () => {
// const comboOpen = document.getElementById("combo");
// comboOpen.classList.add("combo-show")
// }
// export const closeCombo = () => {
// const comboClose = document.getElementById("combo")
// comboClose.classList.remove("combo-show")
// }
// export const procur... | true |
e18e1fe3f7922b2b90bfbc0c27d4e13d0e8be3fe | JavaScript | bonronron/TictactoeBot | /gameobj.js | UTF-8 | 2,119 | 3.171875 | 3 | [] | no_license | class Game{
constructor(){
this.gameobj = [[0,0,0],[0,0,0],[0,0,0]];
}
//1 is X, -1 is O
terminated(){
let go = this.gameobj.toString().split(",").map((i)=>{return parseInt(i)});
if ((go[0]==go[1]&&go[1]==go[2])&&(go[0]!=0) ||
(go[3]==go[4]&&go[4]==go[5])&&... | true |
212af2b0e28a8344e6055bde13e2a26d2a129202 | JavaScript | deoxxa/setl | /lib/cursor.js | UTF-8 | 683 | 2.71875 | 3 | [] | no_license | "use strict"
var through = require("through2");
var zeros = require("zeros")
var keypress = require("keypress");
var Cursor = module.exports = function Cursor(options) {
this.x = 0;
this.y = 0;
this.data = zeros([120, 40])
this.input = through()
keypress(this.input)
var self = this
this.input.on("keypre... | true |
0004895243da68b2b465bf1c1affd065df8953a2 | JavaScript | sahil-github29/code-interview | /anagrams/anagrams.js | UTF-8 | 599 | 4.09375 | 4 | [] | no_license | /* ANAGRAMS */
/*
EXAMPLES: BOTH THE STRING MUST HAVE EXACT SAME CHRACTERS
anagrams("rail safty", "fairy tales"); --> true
anagrams("RAILS SAFTY!", "fairy tales"); --> true
anagrams("Hi There", "By There"); --> false
*/
/*
Replace anything in the string with "" except (characters, numbers, and underscore)
/[^\w]... | true |
c2f13c79a2cb76466dc76e81f5be77051a71df1c | JavaScript | Ricardop25/Ejemplo-node | /config/yargs.js | UTF-8 | 791 | 2.703125 | 3 | [] | no_license | //La utilidad de yargs es crear comandos por consola para hacer distintas a acciones o operaciones
//Documentacion: https://yargs.js.org/docs/
const argv = require('yargs')
.option('b',{
alias: 'Base',
type: 'number',
demandOption: true,
describe: "Es la base de la tabla de multiplicar"
})
.option('l'... | true |
f3e7895286da93aa99f8e95d966ed60374c65882 | JavaScript | apagan5983/final-project-website | /scripts.js | UTF-8 | 862 | 2.90625 | 3 | [] | no_license | function loadRepo(url, callback) {
const githubRequest = new XMLHttpRequest();
githubRequest.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
callback(this);
}
};
githubRequest.open("GET", url, true);
githubRequest.send();
}
function loadRepoCallback(git... | true |
dd434b007c4126924c67043c92a89172f6c233a7 | JavaScript | Ishu12/ishu_testing_github | /server.js | UTF-8 | 1,389 | 2.609375 | 3 | [] | no_license | var Cloudant = require('cloudant');
var express = require('express');
var app = express();
var bodyParser = require('body-parser')
var me = "857b6049-c234-4868-9a56-a51d617435e5-bluemix"; // Set this to your own account
var password = "78a84c4521691cb2220ba34e4b66059060851012291abad83daba07971f71d2e";
// Initialize t... | true |