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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
72dc3b4df7709e68ac929282d065037e90ae6278 | JavaScript | dchaika1990/react-learning | /src/components/Lesson/index.js | UTF-8 | 772 | 3.015625 | 3 | [] | no_license | import React, { Component } from 'react';
class lesson extends Component {
constructor(props) {
super(props);
this.state = {
name: 'Иван',
surname: 'Иванов',
};
}
getTest() {
return 'some text';
}
showMessage(item) {
console.log(thi... | true |
652216d6a43ff9dcd27f0bc8523a7b3ef6291f7d | JavaScript | matheusagnus/firestore-api | /functions/user.js | UTF-8 | 3,343 | 2.640625 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const admin = require('firebase-admin');
const serviceAcc = require("../keyfile.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAcc),
databaseURL: "https://cloud-matheusagnus.firebaseio.com"
});
const ref = admin.fir... | true |
a787f5b6f84ed61d3247eecb0c129d73a2b12af9 | JavaScript | future4code/Giovanna-Caivano | /semana6/rend-cond/ex-rend-cond/src/components/Etapa1.js | UTF-8 | 2,033 | 2.65625 | 3 | [] | no_license | import React from 'react'
import styled from 'styled-components'
import TitleH1 from './TitleH1'
import PerguntaAberta from './PerguntaAberta'
import PerguntaFechada from './PerguntaFechada'
const Form1 = styled.div`
margin: 0 auto;
width: 500px;
display: flex;
flex-direction: column;
`
class Etapa1 e... | true |
987b28040c3b0ada5b73f6dc6bdd7b07520bd62f | JavaScript | Freeport-Metrics/bikeday | /src/js/geocoder.js | UTF-8 | 361 | 3.0625 | 3 | [
"MIT"
] | permissive | function geocode(address, callback) {
var geocoder = new google.maps.Geocoder();
geocoder.geocode({ 'address': address, region: 'PL'}, function (results, status) {
if (status == google.maps.GeocoderStatus.OK && results.length) {
callback(results[0].geometry.location);
} else {
alert("Location " ... | true |
1b3c2c719a54dfd563ee288167b47ac48b5517b1 | JavaScript | shinjune/www | /work/exp1/test/test4.js | UTF-8 | 333 | 4.53125 | 5 | [] | no_license | let arr = [1, 2, 3, 4, 5]
// // older code
var a2 = [];
for (var i = 0; i <= a2.length; i++) {
a2.push(arr[i] * 2);
}
console.log(a2);
// // old code
var a3 = arr.map(function(x) {
return x * 2;
});
// ES6 code
let arr2 = arr.map(x => x * 2)
console.log(arr2)
// power of 2
let arr2 = arr.map(x => x * x)
cons... | true |
00c87ed3616ce4eca335bd5d2ded80a804fafae5 | JavaScript | afermon/TuBus | /WebApp/Scripts/Views/Convenio/vCrearConvenio.js | UTF-8 | 3,093 | 2.5625 | 3 | [
"CC-BY-4.0",
"CC-BY-3.0",
"MIT"
] | permissive | function vCrearConvenio() {
this.ctrlActions = new ControlActions();
this.service = "Convenio/create";
if (!$("#frmConvenio").valid()) {
this.ctrlActions.ShowMessage('E', "Por favor verifique los campos señalados.");
return;
} else {
this.Create = function () {
var ... | true |
b16a7e586a37034ebf9b9dd1e7f1cf8cf9f6c343 | JavaScript | i-punithgowda/school-management-system | /src/pages/Teacher-Component/dashboard.jsx | UTF-8 | 4,543 | 2.53125 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Axios from 'axios';
import Alert from 'react-bootstrap/Alert';
const Dashboard = (props) => {
const [data, setData] = useState('');
const [State, setState] = useState(false);
function fetchAppointments() {
Axios.post('http://localhost:300... | true |
4da67384a97dfe951a922c96e64d9819668160d2 | JavaScript | altojulyspaceproject/Alto-July-Space-Project | /example/msl/src/RemsTelemetrySeries.js | UTF-8 | 3,516 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | /*****************************************************************************
* Open MCT, Copyright (c) 2014-2017, United States Government
* as represented by the Administrator of the National Aeronautics and Space
* Administration. All rights reserved.
*
* Open MCT is licensed under the Apache License, Version ... | true |
03918f30a2cdbe0d4c7af5daaa67250ba7f4c8c3 | JavaScript | PacktPublishing/Hands-On-Full-Stack-Web-Development-with-GraphQL-and-React-V- | /Section 4/4.1/server/index.js | UTF-8 | 2,767 | 2.640625 | 3 | [
"MIT"
] | permissive | const { ApolloServer, gql } = require('apollo-server')
const cars = [
{
id: '1',
brand: 'Toyota Corolla',
color: 'Blue',
doors: 4,
type: 'Sedan',
parts: [{ id: '1' }, { id: '2' }]
},
{
id: '2',
brand: 'Toyota Camry',
color: 'Red',
doors: 4,
type: 'SUV',
parts: [{ i... | true |
24650bf86e91f70a2019876fa479c5af6f291529 | JavaScript | rexhawkRBLX/KCBot | /index.js | UTF-8 | 3,169 | 2.6875 | 3 | [] | no_license | // Heroku Logs Command: heroku logs --app kingcity-bot -t
const http = require("http");
const bot_config = require("./botconfig.json");
const Discord = require("discord.js");
const fs = require("fs");
const PORT = process.env.PORT || 3000;
const app = require("express")();
const bot = new Discord.Client({disableEveryo... | true |
14930f26ad40735ac7e678510f8217e856d8c65c | JavaScript | Krisatris/GROOVE | /js/popup.js | UTF-8 | 3,811 | 3.0625 | 3 | [] | no_license | /*
let changeColor = document.getElementById('changeColor');
chrome.storage.sync.get('color', function(data) {
changeColor.style.backgroundColor = data.color;
changeColor.setAttribute('value', data.color);
});
changeColor.onclick = function(element) {
let color = element.target.value;
chrome.tabs.que... | true |
9939ed790b4100afe3c603cf17fb2fecdef25f51 | JavaScript | Ghassen-Ben-Othmen/test-justify-text | /test/justify.test.js | UTF-8 | 801 | 2.9375 | 3 | [] | no_license | const {
justifyText
} = require("../controllers/service.controller");
const fs = require("fs");
test('number chars in each line should be 80 - 1 ', () => {
let [expected, actual] = check("input.txt");
expect(actual).toBe(expected);
});
test('number chars in each line should be 80 - 2 ', () => {
le... | true |
e54082e989a31cc76f6b89cbc0400e59330250f1 | JavaScript | asfrattini/mediosInteractivos | /03/sketch.js | UTF-8 | 6,162 | 2.65625 | 3 | [] | no_license | var tam = 0;
var op = 100;
var x = 0;
var y = 0;
var prop = 1;
function setup() {
createCanvas(windowWidth, windowHeight);
}
function draw() {
background(0);
//Estrellas titilando
fill(255);
noStroke();
ellipse(random(0, width), random(0, width), 2 * height / 207, 2 * height / 207);
ellipse(random(0... | true |
819639fe55f413fd55e0894fcd5cb1dd4ef6c48f | JavaScript | tmoodley/kendo-backbone | /demos/public/js/grid-datasource-backbone.js | UTF-8 | 1,820 | 2.578125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | (function(global, Backbone){
global.GridBackboneApp = {
init: function(collection){
this.collection = collection;
this.setupForm();
this.setupGrid();
},
setupForm: function(){
var form = new Form({
el: $(".backbone-form")
});
var that = this;
form.on("s... | true |
ea9a506a5b484559aee92671095275f6cb3824b0 | JavaScript | mpreus/tip_calculator | /app/app.js | UTF-8 | 1,802 | 3.265625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", init);
function init() {
let output = document.querySelector("div.output");
let costInput = document.querySelector("input");
let veryLowTip = document.getElementById("veryLowTip");
veryLowTip.addEventListener("click", function() {
let vltInput = costInput.value;
... | true |
3f47297c5712a4eea7fd93bab595922bb53c1b0c | JavaScript | Juhye-Kim/Boosting-Study | /김주혜/210707/numberOfIslands.js | UTF-8 | 832 | 3.71875 | 4 | [] | no_license | // 리트코드 - 200. Number Of Islands
var numIslands = function (grid) {
let cnt = 0;
for (let i = 0; i < grid.length; i++) {
for (let j = 0; j < grid[0].length; j++) {
if (grid[i][j] === "1") {
grid[i][j] = "2";
let Q = [[i, j]];
while (Q.length) {
let [x, y] = Q.shift();
... | true |
3c3fd81be37cb8a770c18c60976e1c1b178b73ee | JavaScript | DariaBlomma/GloAcademy.18.0 | /Project 1/script.js | UTF-8 | 266 | 2.53125 | 3 | [] | no_license | 'use strict';
let money,
income,
addExpenses,
deposit,
mission,
period;
alert('If today was your last day and tomorrow was too late ...');
console.log('Created undefined variables :' + money, income, addExpenses, deposit, mission, period); | true |
fbf5b11999a3f1b83796645a253301503fac4737 | JavaScript | knoxville-utilities-board/pscc2015 | /ClientTutorial/WebContent/src/util/dateHandling.js | UTF-8 | 2,689 | 2.703125 | 3 | [] | no_license | /* global moment */
define(["dojo/_base/lang"],
function(lang) {
var dateHandling = {};
//I don't think this necessary... - BZA
lang.setObject("kub.util.dateHandling", dateHandling);
var DATE_FORMAT = "L"; /* MM/DD/YYYY */
var TIME_FORMAT = "hh:mm A";
var DATETIME_FORMAT = DATE_FOR... | true |
5f84e2f8ebbfd67e1f124a1f894b48fb3088fd8f | JavaScript | bdai09/School_Work | /Web_semester2/Assignment5/registration.js | UTF-8 | 3,278 | 2.96875 | 3 | [] | no_license | var errors=document.querySelector(".sidepanel");
function formValidation(){
var errors=document.querySelector(".sidepanel");
var password1=document.signup.password;
var password2=document.signup.repassword;
errors.innerHTML=""
nodigit=0;
noUppercase=0;
var value=password1.value.trim();
... | true |
5829003ac487db3aaf182c234089d66c65101d87 | JavaScript | ddiazetc/areyouthere | /music.js | UTF-8 | 530 | 2.90625 | 3 | [] | no_license | /**
* Created by Daniel on 10/1/2016.
*/
let audioContext = new AudioContext();
fetch('audio/bass.wav')
.then(response => response.arrayBuffer())
.then(arrayBuffer => audioContext.decodeAudioData(arrayBuffer))
.then(audioBuffer => {
let sourceNode = audioContext.createBufferSource();
sourceNode... | true |
5fdbf580b265d32f0b3e80f94f93433c0ca6f761 | JavaScript | jakechadwell/codeup-web-exercises | /js/search-script.js | UTF-8 | 5,064 | 3.015625 | 3 | [] | no_license | // This example adds a search box to a map, using the Google Place Autocomplete
// feature. People can enter geographical searches. The search box will return a
// pick list containing a mix of places and predicted search terms.
// This example requires the Places library. Include the libraries=places
// parameter when... | true |
965c6678c115c563aa951e3942233cd7cdfadd33 | JavaScript | Chanwit21/Codecamp9_Chanwit | /JS/Browser_DOM_Event/Lab_DOM/Lab3/script.js | UTF-8 | 565 | 2.84375 | 3 | [] | no_license | // จงเขียนคำสั่งเพื่อ access <li> ตัวที่สาม โดยใช้วิธีต่อไปนี้
// querySelector
// querySelectorAll
// getElementById
// getElementsByTagName
const element1 = document.querySelector('ul li:last-child');
console.log(element1)
const element2 = document.querySelectorAll('ul li:last-child')[0];
console.log(element2... | true |
bb2a0c3be285c4b651cf1750f0fc4854a1b4d0ed | JavaScript | j-dags/AboveTheBreak | /src/data/data.js | UTF-8 | 625 | 2.578125 | 3 | [
"MIT"
] | permissive | // import { data } from './dataset_2020-21'
// import _ from 'lodash'
// export const playerData = (arr) => {
// // console.log(data.resultSets[0].headers);
// const headers = arr.resultSets[0].headers
// let ans = arr.resultSets[0].rowSet
// ans = ans.map((player) => {
// return player.reduce((obj, el, idx) =>... | true |
2249026e82ee96bacec2e7874e7bcbed20f80a6d | JavaScript | BeameryHQ/json-ditto | /ditto/plugins/uniqueArray.js | UTF-8 | 396 | 2.78125 | 3 | [
"MIT"
] | permissive | 'use strict';
const _ = require('lodash');
/**
* @function uniqueArray
* @description Ensure array elements are unique
*
* @param {Array} target the target Array we will ensure its uniqueness
* @returns {Array}
*/
function uniqueArray(target, key) {
if (!target || !target.length) return [];
return !!key ... | true |
af3a4938674accdbbc64f363bd2af9ec438e2c99 | JavaScript | SpyrosKy/lab-react-ironcontacts | /src/componets/Contacts.jsx | UTF-8 | 1,970 | 3.015625 | 3 | [] | no_license | import Acteurs from '../contacts.json';
import React, { Component } from 'react';
export class Contacts extends Component {
state = {
acteurs: Acteurs.slice(0, 5),
};
randomActeur = () => {
const newActeur = [...this.state.acteurs]
newActeur.push(Acteurs[Math.floor(Math.random() * (Ac... | true |
2cdfe8a44711695e8104d4a1058cd125d81a67b8 | JavaScript | IshwarSingh16/Composite-Web-App | /static/js/Node.js | UTF-8 | 906 | 3.28125 | 3 | [] | no_license | // 8x8 array for composite representation
const m = 8;
const n = 8;
let arr = [];
for (var i = 0; i < m; i++) {
arr[i] = [0, 0, 0, 0, 0, 0, 0, 0];
}
var table = document.getElementById("table"), rIndex, cIndex;
for (var i = 0; i < table.rows.length; i++) {
for (var j = 0; j < table.rows[i].cells.lengt... | true |
d1cee1905367793f57a84ab7a8e133f08edbe7e1 | JavaScript | jhcse5189/node.js | /basic/003_exports.js | UTF-8 | 261 | 2.640625 | 3 | [] | no_license | // use exports global object (./calc/index.js)
var calc = require('./calc');
console.log(`calc.add(10, 10): ${calc.add(10, 10)}`);
// use module.exports (./calc2/index.js)
var calc2 = require('./calc2');
console.log(`calc2.add(10, 10): ${calc2.add(10, 10)}`);
| true |
e8bd8e2ef458cae78095704737be9dac14f28dd3 | JavaScript | NexusEncoded/pset-4 | /src/odd.js | UTF-8 | 464 | 3.375 | 3 | [] | no_license |
const readlineSync = require("readline-sync");
let add = 0
let x = 0
console.log();
do{
numba = Number(readlineSync.question("Positive integer: "));
} while (numba < 1 || numba > Number.MAX_SAFE_INTEGER || numba < Number.MIN_SAFE_INTEGER || Number.isNaN(numba) || numba % 1 != 0)
do {
x = numba % 10;
if (x % 2 !... | true |
88fa7cae1e2a0e14218bc46fb74ad6a632baf642 | JavaScript | kwiza02/ReactProjects | /CNQR/App/RestAPI/RestAPIHandler.js | UTF-8 | 1,915 | 2.828125 | 3 | [] | no_license | //Utils
export async function get(Url) {
try {
console.log("URL" + Url);
let response = await fetch(Url);
let json = await response.json();
console.log("Details " + JSON.stringify(json.title))
return json;
} catch (error) {
console.error(error);
Alert.ale... | true |
d92eda028010fb4ceab1952e1e494629023a311f | JavaScript | bgun/Election-Social-Media-Tracker | /js/elections.js | UTF-8 | 2,741 | 2.96875 | 3 | [] | no_license | // JavaScript Document
// global variables used throughout the script
var predictor = "";
var racetype = "";
$(document).ready(function(){
// set default predictor and racetype
changeRacetype("Senate");
changePredictor("Twitter");
updateStats();
// set click events
$('#header ul li a.Senate').clic... | true |
c422263e83eba2ea35330a62741bfaef77af1060 | JavaScript | rpcvjet/HomeSecure-client | /extras/index.js | UTF-8 | 596 | 2.71875 | 3 | [
"MIT"
] | permissive | 'use strict';
const fs = require('fs');
const express = require('express');
var Gpio = require('onoff').Gpio,
led = new Gpio(16, 'out');
var button = new Gpio(17, 'in', 'both');
console.log('Is this working?');
//start the program here
button.watch(function(err, value) {
if (err) exit();
led.writeSync(led.read... | true |
923934e198729c7b639eda6744dc0e08cb7fce34 | JavaScript | Chakrakin/FormHookUse | /src/components/WizardStateful/Summary/WizardStatefulSummary.test.jsx | UTF-8 | 1,528 | 2.59375 | 3 | [] | no_license | import {WizardStatefulSummary} from './WizardStatefulSummary';
import React from 'react';
import {act, fireEvent, screen} from '@testing-library/react';
import TSuit from '../../../utilty/test/TestFormHandling';
import {createStore} from 'little-state-machine';
import {createMemoryHistory} from 'history';
const filled... | true |
e1cec3346a86df0a565f9cdb99edf3cc332c8866 | JavaScript | Manntrix/webli | /lib/new/html/html-demos.js | UTF-8 | 606 | 2.65625 | 3 | [] | no_license | const values = require('./html-value');
const inquirer = require('inquirer');
const adminCat = require('./demos/admin-cat')
const portfolioCat = require('./demos/portfolio-cat')
const questions = [
{ type: 'list', name: 'listcat', message: 'Select the category', choices: values.htmlCategory} ,
];
module.expor... | true |
6663520ba8dc6acc7f16f7c490c6b618cbde36ab | JavaScript | robertmtpaul/sei37-homework | /ben-luck/week1/tue/functions-exercises/js/main.js | UTF-8 | 7,064 | 4.28125 | 4 | [] | no_license |
console.log( 'Hello World!' );
// ## The Fortune Teller
console.log( 'Fortune Teller' );
const partnerName = "Michael";
const numberOfKids = 4;
const geographicLocation = "Sydney";
const jobTitle = "Developer";
console.log( `You will be a ${ jobTitle } in ${ geographicLocation} , and married to ${ part... | true |
fe05053730a26df8a9913e6744549efd327a7f12 | JavaScript | kaila-spraguemcrae/Breaddit | /src/__tests__/reducers/post-list-reducer.test.js | UTF-8 | 1,520 | 2.609375 | 3 | [
"MIT"
] | permissive | import postListReducer from '../../reducers/post-list-reducer';
import * as c from '../../actions/ActionTypes';
import * as a from '../../actions';
describe('postListReducer', () => {
let action;
const postData = {
title: "All About Rye",
body: "It's the best bread",
votecount: 5,
timestamp: "2/... | true |
abc30a658a45a15bef8dfacce1d69999cade412b | JavaScript | turingschool-examples/instaparser | /test/find-hashtags-test.js | UTF-8 | 529 | 2.671875 | 3 | [] | no_license | const assert = require('assert');
const findHashtags = require('../lib/find-hashtags');
describe('findHashtags', function () {
it('should find the hash tags', function () {
const hashTags = findHashtags("Hello #hashtag #wowow");
assert(Array.isArray(hashTags));
assert.equal(hashTags.length, 2);
});... | true |
6c8e8258428815ec0a611df84987a32fa7874f29 | JavaScript | SavierSL/task-app | /src/index.js | UTF-8 | 976 | 2.90625 | 3 | [] | no_license | // PLAYING WITH POST AND ROBO
const { response } = require("express");
const express = require("express");
require("./db/mongoose");
const userRouter = require("./routers/user");
const taskRouter = require("./routers/task");
const app = express();
const port = process.env.PORT || 3000;
app.use(express.json());
//ex... | true |
fbb31914abd8046ed27a82483093f337916f8f87 | JavaScript | Preeti1302/SilverPeakTest | /app.js | UTF-8 | 1,351 | 2.78125 | 3 | [] | no_license | var https = require('https'); // Import Node.js core module
var request = require('request');
const readline = require('readline');
var rl = readline.createInterface(process.stdin, process.stdout);
rl.setPrompt('shell: > ');
rl.prompt();
rl.on('line', function(line) {
if (line === "right") rl.close();
rl.prom... | true |
baa2f2483df55d0a4fbc8e092a7b6b95d4f0a9ae | JavaScript | cold-coder/drinking_competition | /app.js | UTF-8 | 2,414 | 2.546875 | 3 | [] | no_license | var express = require("express");
var app = express();
var http = require("http").Server(app);
var io = require("socket.io")(http);
app.use(express.static('public'));
//can not start game without judge
var hasJudge = false;
// var onlineUserCount = 0;
var onlinePlayers = [];
var score = {};
//game ws server
var ha... | true |
fdf80d270b75cddb8d921f31ba1c29fc4621965c | JavaScript | IsaiahMurray/WebDevNotes-Basics | /Basics/Loops/forLoop.js | UTF-8 | 1,712 | 4.71875 | 5 | [] | no_license | //* Basic For Loop
let i = 7
//? (1) (2) (3)
for (i = 0; i < 10; i++) {
console.log(i); // 0 1 2 3 4 5 6 7 8 9
}
console.log('global variable:', i);
//? 1 => initial expression
//? 2 => condition
//? 3 => increment expression
//* Using a for loop, count to 20, by 2's
for (let i = 0; i <= 20; i +=... | true |
0a90747ea10ebf5a8f0767580c7084d9347cf8dc | JavaScript | TangKunjun/miaov_vue1 | /ssr/entry-server.js | UTF-8 | 746 | 2.65625 | 3 | [] | no_license | /*
服务端路由 需要把访问路径给vue-router 这样才能让对应的url展示对应的页面
*/
const createApp = require("./app");
// 外面的express服务使用 {url: / /about}
module.exports = (context) => {
return new Promise((resolve, reject) => {
const {app, router} = createApp(context);
router.push(context.url);
// 所有的异步组件都完成了 就会... | true |
09bb9809488984935ec9905512915129dc157db4 | JavaScript | zjhch123/redux-demo | /demo08/src/actions/index.js | UTF-8 | 1,038 | 2.75 | 3 | [] | no_license |
export const changeTitle = (title) => ({
type: 'CHANGE_TYPE',
title
});
export const invalidateItems = (title) => ({
type: 'INVALIDATE_ITEMS',
title
});
export const requestItems = (title) => ({
type: 'REQUEST_ITEMS',
title
});
export const receiveItem = (title, items) => ({
type: 'RECEIVE_ITEMS',
i... | true |
72f7cebc599535bdf2348a6f93161367142ba561 | JavaScript | sukumDev123/blynk-client-side | /src/components/switch/ShowInformationThisSwitch.js | UTF-8 | 543 | 2.515625 | 3 | [] | no_license | import React from 'react'
export default function ShowInformationThisSwitch(props) {
const handleText = status =>
status === '0' ? 'Closed switch' : 'Opened switch'
const handleTextBtn = status => (status === '1' ? 'Close' : 'Open')
return (
<>
<h3>
The Switch pin's
{' ' + props.pin... | true |
e2417e0b3d5226b312b7f1b8261a7db553001011 | JavaScript | togran/page-parser | /src/Parser.js | UTF-8 | 3,269 | 2.609375 | 3 | [] | no_license | import React from 'react';
import {Fragment} from "react";
const cheerio = require('cheerio');
class Parser extends React.Component {
constructor(props) {
super(props);
this.state = {
url: '',
data: '',
isLoading: false,
header: '',
text: ... | true |
ec87dedf0be8d46547270ad4b930f35632998daf | JavaScript | vitya1/fuzzy | /core/database-manager.js | UTF-8 | 2,145 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict';
import Tunnel from './tunnel'
import MysqlClient from './mysql-client';
const uuid = require('node-uuid');
const DB_CLIENTS = {
MYSQL: 0,
SQL_LITE: 1
};
var DatabaseManager = function() {
//todo move to app_server?
this.connections = new Map();
this.validateConfig = function() {
//@todo
};
... | true |
52225fcd7fd4acb456995a06fa5c20e9fa28daa8 | JavaScript | nomoren/website | /src/main/webapp/js/userInfo.js | UTF-8 | 11,145 | 2.703125 | 3 | [
"MIT"
] | permissive | $(document).ready(function(){
$.ajax({
"url":"../user/checkLogin.do",
"type":"POST",
"dataType":"JSON",
"success":function(json){
var map=json.data;
if(map.loginStatus==1){//已登录,显示个人中心标签,登录隐藏
if(map.name!=null){//用户名不为空,就显示
$(".b-account-overview__welcoming").text("欢迎您!"+map.name);
}
$.a... | true |
245283d4358acc5010a93550739e7a7fb6c36928 | JavaScript | SunKishTechnologies/ragacuisineofindia | /common_functions.js | UTF-8 | 393 | 3.46875 | 3 | [] | no_license | function isEmpty(s)
{
return ((s == null) || (s.length == 0))
}
function isDigit (c)
{
return ((c >= "0") && (c <= "9"))
}
function isInteger (s)
{
var i;
if (isEmpty(s))
if (isInteger.arguments.length == 1) return 0;
else return (isInteger.arguments[1] == true);
for (i = 0; i < s.length; i++)
{
var ... | true |
94fba899aa354ed28bc10ff6cbdc3c22032be5ce | JavaScript | alessandroCharbonnier/JavaScript | /AStar/Head.js | UTF-8 | 1,493 | 2.640625 | 3 | [] | no_license | class Head {
constructor() {
}
run() {
if (openSet.length > 0) {
this.lowestIndex = 0;
for (let i = 0; i < openSet.length; i++) {
if (openSet[i].f < openSet[this.lowestIndex].f) {
this.lowestIndex = i;
}
}
this.current = openSet[this.lowestIndex];
if (this.current ==... | true |
43f799e1d84fbf6d67eafd33c65bbf6fa685aa31 | JavaScript | jwmay/plc-grade-importer | /src/ui/a.grade-importer.picker.controller.server.js | UTF-8 | 6,122 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | // Copyright 2017 Joseph W. May. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... | true |
77913d539c1542894e5531bfd681ddca24a806e3 | JavaScript | kevinabdul/string-exercise | /utility/radixSort.js | UTF-8 | 1,211 | 3.25 | 3 | [] | no_license | const split = require('./split');
function radixSort(collections) {
let str = false
if (typeof collections === 'string') {
str = true
collections = split(collections, '');
collections = collections.map((char) => char.codePointAt(0))
}
let digitCount = longestDigit(collections);
let bucket = [];
for (let ... | true |
b7a37d2ed0472bbd759616ac10c1248858e15742 | JavaScript | IT-xzy/Task | /Web/zhengjiawei/task14/src/scss/components/carousel/carousel.js | UTF-8 | 2,073 | 3.03125 | 3 | [] | no_license | var oBbox = document.getElementById("box");
var oUl = document.getElementById("inner-box");
var oLeft = document.getElementById("left");
var oRight = document.getElementById("right");
var cur = 0; //定义变量设置left的值;
var timer = null; /* 定义一个计时器 */
var target = 0; /* 目标值 */
var timer1 = null;
var i = 0
timer = setInterval(... | true |
5cac95ae44a350b47e87ab925bf3004a022f0914 | JavaScript | bashby2/codingdojo | /algorithms/chapter 0/flexibleCountdown.js | UTF-8 | 359 | 4.25 | 4 | [] | no_license | //Flexible Countdown
//Based on earlier “Countdown By Fours”, given lowNum, highNum, mult, print multiples of mult from highNum down to lowNum, using a FOR loop.
//Example: For (2,9,3), print 9 6 3 (on successive lines).
function flexCount(low,high,mult){
for (var i = high; i > low; i = i - mult){
console.... | true |
1da5acde776647bc0ab8ca92f28410ab8a137f91 | JavaScript | yooungt13/Parede | /actions/public/js/controllers/AlbumController.js | UTF-8 | 13,786 | 2.53125 | 3 | [] | no_license | app.controller("AlbumController", function($scope, $http) {
console.log("AlbumController is called.")
$scope.albums = [];
$http.get("albums")
.success(function(data, status, headers, config) {
console.log("Albums get success.");
$scope.albums = data;
})
.error(function(data, status, headers, config) {
... | true |
e570705bb8652d4cfe0d72cf58872b72370ded4f | JavaScript | nester1van/algorithms | /src/strings/trieTrees/ternarySearchTries/ternarySearchTries.js | UTF-8 | 1,793 | 3.203125 | 3 | [] | no_license | // таблица имен на основе trie-деревьев тренарного поиска
const TernarySearchTries = (function(){
class Node {
constructor(charCode, value) {
this.charCode = charCode;
this.value = value;
this.left = null;
this.middle = null;
this.right = null;
}
};
class TST {
construct... | true |
e599b9d5b0bd697da6d5f7d300810fac7849f6e8 | JavaScript | waaan7/COMP9044-19T2 | /final/mock/species_count.js | UTF-8 | 413 | 2.921875 | 3 | [
"MIT"
] | permissive | function species_count(target_species, whale_list) {
// PUT YOUR CODE HERE
// return whale_list.map(res => res.species == target_species?res.how_many:0).reduce((a,b)=>a+b,0);
var sum = 0
for (let i =0 ; i< whale_list.length;i++ ){
if (whale_list[i].species == target_species){
sum = sum + ... | true |
585ba364a08c962e26414443d8b6a8035de418a3 | JavaScript | DGEs2018/Traineeship-progress | /Week7/eloquent-js-exercises/chess-board.js | UTF-8 | 1,360 | 4.5 | 4 | [] | no_license | /*
Write a program that creates a string that represents an 8×8 grid, using newline characters to separate lines.
At each position of the grid there is either a space or a "#" character. The characters should form a chessboard.
*/
function chessBoardMaker() {
let chessBoard = '';
for (let j = 0; j < 8; j++) {
f... | true |
cc720135a6e824a642fe1fd1ea4e66a7f4491366 | JavaScript | alexluke/placeholder-polyfil | /placeholder.js | UTF-8 | 970 | 2.671875 | 3 | [
"MIT"
] | permissive | /*
* jQuery placeholder polyfil
* https://github.com/banduin/placeholder-polyfil
*
* Copyright (c) 2012 Alex Luke
* MIT Licensed
*/
;(function($) {
$(function() {
$('input[placeholder]').each(function() {
var $this = $(this);
var ph = $this.attr('placeholder');
if (ph != '' && $this.val() == '') {
... | true |
777fc3ffa1c2d4d435a6c6812f1ab2b0e4c58540 | JavaScript | twatson071/my-weather-app | /src/WeekContainer.js | UTF-8 | 1,154 | 2.734375 | 3 | [] | no_license |
import React from 'react';
import apiConfig from './apiKeys';
import DayCard from './DayCard';
class WeekContainer extends React.Component {
state = {
fullData: [],
lat: null,
lng: null
}
render() {
if (this.state.fullData.length > 0) {
const reading = this.state.fullData[0]... | true |
cc9431b8c9f02939edc9cb65f4f7b7254887cba5 | JavaScript | ikheraj17/data-structures | /sprint-two/src/linkedList.js | UTF-8 | 1,532 | 4.25 | 4 | [] | no_license | var LinkedList = function() {
var list = {};
list.head = null;
list.tail = null;
list.addToTail = function(value) {
var node = new Node(value);
//if head is null, the current
//value for node will become the head
this.head = this.head || node;
//if statement is for
//if tail has alread... | true |
3fbd53dfbff4ffebf61b302f31734ee975a21f61 | JavaScript | JackMoseley2001/pg-helpers | /index.js | UTF-8 | 3,141 | 2.796875 | 3 | [] | no_license | // Imports
const pg = require('pg');
const fs = require('fs');
const path = require('path');
/**
* @typedef SQLFormatOptions
* @property {String} file
* @property {Object} additionalQueries
* @property {Object} parameters
*/
/**
* @typedef FormattedSQL
* @property {String} sql
* @property {Array} parameters
... | true |
96dddf39b86f4c024a2be66dd325d8486ad40e3f | JavaScript | mr-ryan12/10_speckled_frogs | /day_7/10_speckled_frogs.js | UTF-8 | 1,294 | 3.78125 | 4 | [] | no_license | const numToWords = require('number-to-words');
const prompt = require('prompt-sync')();
var numOfFrogs = prompt('How many frogs would you like to sing about? 🐸 ');
while (isNaN(numOfFrogs)) {
numOfFrogs = prompt('Please enter a number. How many frogs would you like to sing about? 🐸 ');
};
var areYouSure = prompt(... | true |
f4ba9d6f8abbdd894f57dff19ad2f36b038441f0 | JavaScript | stavros-melidoniotis/isup-cli | /helpers/prompt-validators.js | UTF-8 | 648 | 2.90625 | 3 | [] | no_license | const { isEmpty } = require('./files')
exports.checkIfEmpty = (value) => {
return (isEmpty(value)) ? "Can't be empty" : true
}
exports.checkIfEmptyAndValidUrl = (value) => {
let urlRegex = /(^https?:\/\/)([w]{3}.)?[a-zA-Z0-9-_+.]{2,256}\.[a-z]{2,5}(\/[a-zA-Z0-9-_+]{1,256}){0,256}$/g
if (isEmpty(value))
... | true |
748ad4d184def7e0538806ada257625b80c5942d | JavaScript | syuhendar729/belajar-nodejs | /coba-coba/app.js | UTF-8 | 536 | 3.8125 | 4 | [] | no_license | const strTo = (word) => {
// -- jadikan semuanya huruf kecil
const huruf = [...word.toLowerCase()]
let hasil = ''
// -- looping utk menelusuri huruf yg sama
for(const [i, h] of huruf.entries()){
for(let ind = 0; ind <= huruf.length; ind++){
if (h === huruf[ind] && i != ind){
hasil += '1 '
}
}
}
... | true |
88807cd5c37f4177a7011ee5f5f84933c7c5ecc4 | JavaScript | reccosrats9/nodbproject | /src/server/serverindexnotes.js | UTF-8 | 1,088 | 3.296875 | 3 | [] | no_license | //express
//body-parser (parses the body of your request and puts in on the request object so you can access it in an endpoint)
//top level middleware is called top level because at the top of the file so it affects every endpoint.
//app.use(//middleware in here) will only impact the endpoints below it
... | true |
4a71fc1d781e364a6a6eddc21a40e7b3f00b8b38 | JavaScript | CodeGazer90/SavvyCodersHomeworkAug2021 | /classActivities/3.1.1-FunctionDeclaration.js | UTF-8 | 316 | 3.859375 | 4 | [] | no_license | // TODO: using the function expressions below, refactor them into function declarations
function greet() {
console.log("Hello!");
};
function threeModTwo() {
console.log(3 % 2);
};
let age = 18;
function checkDrivingAge() {
if (age >= 16) {
console.log(true);
} else {
console.log(false);
}
};
| true |
18edcf2fbb382a71cc4f709d4f02751049858a36 | JavaScript | andyindahouse/TuentiChallenge7 | /Challenge 4 - Help Pythagoras Junior/exercise4.js | UTF-8 | 1,957 | 3.296875 | 3 | [
"MIT"
] | permissive | const fs = require('fs');
const file = {
input: 'submitInput.txt',
output: 'submitOutput.txt'
};
console.time();
init();
console.timeEnd();
function init() {
let data = readFile(file.input).split('\n');
let numCases = data.shift();
let cases = [];
let i = 0;
while(numCases) {
case... | true |
308119acf159882a6a8153ab20ad1c091858844e | JavaScript | hgwr/google-search-navigator | /src/google_keyboard_shortcuts.js | UTF-8 | 7,196 | 2.515625 | 3 | [
"MIT"
] | permissive | let options = {
wrapNavigation: false,
autoSelectFirst: true,
nextKey: 'down, j',
previousKey: 'up, k',
navigatePreviousResultPage: 'left, h',
navigateNextResultPage: 'right, l',
navigateKey: 'return, space',
navigateNewTabKey: 'ctrl+return, command+return, ctrl+space',
navigateSearchTab: 'a, s',
na... | true |
a645d0dab180e45e0344ed95d9c4a483c50b7fbd | JavaScript | guoyu07/Course | /Backend/05 Semana/Demo Modules Text/utilsText.js | UTF-8 | 578 | 3.078125 | 3 | [] | no_license | function isVowel (letter) {
return /[aeiou]/i.test(letter)
}
function isConsonant (letter) {
return /[a-z]/i.test(letter) && !/[aeiou]/i.test(letter)
}
function countVowels (text) {
var aFilteredVowels = text.split('').filter(isVowel)
return aFilteredVowels.length
}
function countConsonants (text) {
var aF... | true |
832dfac8441a9d8eeb0b88f2ee2db0fb39344b8c | JavaScript | gsasaki23/cd_algo_party | /w9d2.js | UTF-8 | 3,473 | 4.1875 | 4 | [] | no_license | class BSTNode {
constructor(val) {
this.val = val;
this.left = null;
this.right = null;
}
}
class BST {
constructor() {
this.root = null;
}
newMethod(params) {
// 'this' keyword will refer to the class instance
// that the newMethod was called on
... | true |
02ab2491bbedb3eee4d8c7a458b2607335c84c41 | JavaScript | vanishtachangea/react-pokemon-js | /src/components/App.js | UTF-8 | 939 | 2.5625 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import axios from 'axios';
import PokemonList from './PokemonsList';
class App extends React.Component{
state={
pokemons:[],
error:[]
};
componentDidMount = async ()=> {
try{
const response = await ... | true |
a6ebf927acfe14ea6bc7cf4fbbe991bfad4843b8 | JavaScript | fischerafael/social-distancing-frontend | /src/Pages/Mapa/index.js | UTF-8 | 4,107 | 2.53125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import Map, { Marker, Popup } from 'react-map-gl';
import api from '../../services/api';
import Header from '../../Components/HeaderSystem'
const MAPBOX_TOKEN = "pk.eyJ1IjoiZGVzaWduZmlzY2hlciIsImEiOiJjazhuZWk4Z28wdDc1M21wczExbzRkaGZkIn0.JrFY7DZmu_I2AdAd2OqNXw";
exp... | true |
6c5ac2464fc1c29c4c2b1530fdc02e2cfea31f79 | JavaScript | PaulShi666/tuoliusuo | /js/login.js | UTF-8 | 1,113 | 2.6875 | 3 | [
"MIT"
] | permissive | //验证手机号码
var sends = {
send:function(){
var myreg = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1}))+\d{8})$/;
var nval =$("#phone").val().replace(/\s+/g,"");
if(!myreg.test(nval)){
mui.toast('请输入有效的手机号码');
}else if(nval.length==0){
mui.toast('请输入手机号码!');
}else if(nval.length!=11){
mui.toast('请输入有效的... | true |
6b0459b20563dc34145e3b07a514dde69ce57af3 | JavaScript | VictoriaNahorna/CMS | /src/views/engine.js | UTF-8 | 576 | 2.71875 | 3 | [
"ISC"
] | permissive | export default {
render: function(data) {
var body = document.getElementsByClassName('general')[0];
data.map(el => {
let div = document.createElement('div'),
h3 = document.createElement('h3'),
p = document.createElement('p');
h3.innerHTML = el.title;
p.innerHTML = el.body;
div.appendChild(h3);
... | true |
658b584a0530305d1fddd6ac180506b841018dae | JavaScript | martinrohart/AdventOfCode2016 | /adventofcode-day14.js | UTF-8 | 1,590 | 3.125 | 3 | [] | no_license | var md5 = require('md5');
var input="qzyelonm";
var puzzle=2;
main(input);
function main(input){
var potentialKeys = [];
var keys = [];
var cnt=0;
var cntWhenLimitReached = 0;
while(keys.length<64 || cnt<(cntWhenLimitReached+1000)){
var key = md5(input+cnt);
if(puzzle==2){
for(var i=0;i<2016;i++){
... | true |
d79881b140bc2a33463d734fbb75e41b368b0343 | JavaScript | rskidmore1/c0621-code-solutions | /node-notes-cli/notes.js | UTF-8 | 709 | 2.6875 | 3 | [] | no_license | const fs = require('fs');
const jsonFile = require('./data');
const add = require('./add');
const del = require('./delete');
const read = require('./read');
const update = require('./update')
if (process.argv[2] === 'read'){
console.log(read());
} else if (process.argv[2] === 'add') {
write(add(process.argv[3]))... | true |
005b78a2ac3f0d53e99b13ea9b2afdc026a99124 | JavaScript | bovenson/mindshare | /static/mindmap/js/login-register.js | UTF-8 | 2,899 | 2.984375 | 3 | [] | no_license | // 登录注册
var loginBtnElement = $("#btn-login");
var registerBtnElement = $("#btn-register");
var registerOrLoginTipElement = $("#registerOrLoginTipElement");
var registerOrLoginBtnElement = $("#registerOrLoginBtnElement");
var inputEmailElement = $("#inputEmail");
var inputPasswordElement = $("#inputPassword");
var lrMo... | true |
0c34745ad352434bd0f3126a8e05506630e5b89c | JavaScript | dellbby/Akbari_Delia_WPF | /AssociatingJS/js/script.js | UTF-8 | 1,188 | 4.5 | 4 | [] | no_license | //JavaScript
var age; //declaration
age =22; //definition
var yearOfBirth = 1991; //declaring and defining on the same line
var kermit = "my friend";
var phrase = "I don't know";
var firstName = "Kermit";
alert("Hello World! This is in the javascript file");
//Arrays
var muppetNames = ["Kermit", "Miss Piggy", "G... | true |
754508df2eb31bffb2cd0b222dd921e325e18792 | JavaScript | Steveztli/grokking-algorithms | /algorithms/tests/all.spec.js | UTF-8 | 3,588 | 3.0625 | 3 | [] | no_license | import { binarySearch } from "../binary-search";
import { quickSort } from "../quick-sort";
import { breadthFirst } from "../breadth-first";
import { dijkstra } from "../dijkstra";
import { knapsack } from "../dynamic-programming";
describe("Binary search", () => {
test("works with numbers", () => {
expect(binar... | true |
de032d3dcb3f8399967275702d4bf62008c3a577 | JavaScript | akras14/cs-101 | /cs-101-js/Count/Inversion/index.js | UTF-8 | 215 | 2.515625 | 3 | [
"MIT"
] | permissive | var invCount = require('./inversion-count');
function run(arr) {
console.log("Inversion for array");
console.log(arr);
console.log(invCount.slowCount(arr));
}
run([1,2,3]);
run([3,2,1]);
run([1,3,5,2,4,6]);
| true |
4ebca7b28a8c02e57524ae2522765eb73d6055ab | JavaScript | Kadenmaguglin/hw4 | /script.js | UTF-8 | 17,753 | 3.078125 | 3 | [] | no_license | var points = 0;
var questions = [
{
title: "In javascript, arrays are used to store...",
choices: ["numbers", "all of these..", "booleans", "strings"],
answer: "all of these.."
},
{
title: "The name of a function is stored before the...",
choices: ["parentheses", "angle bracket... | true |
1b5bf25b54f829805c94d5baf5cc3bbf09467f7b | JavaScript | Lhnozaki/articles-products-express-and-knex | /Previous_routes/articles.js | UTF-8 | 3,367 | 2.59375 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const articles = require("../db/articles");
const knex = require("../database/index");
articles.getUriTitle();
let error = "";
let success = "";
router.get("/search", (req, res) => {
res.render("articles/search", { error: error });
error = "";
}... | true |
2792e329f9dda8c4207dc68ef155560b94dfb026 | JavaScript | kitxsou/kniffel | /screens/endScreen.js | UTF-8 | 2,171 | 2.859375 | 3 | [] | no_license | import Button from "../button.js";
import { mainFont, mainFontDif } from "../sketch.js";
import { grandTotalSum } from "./gameScreen.js";
export default function () {
push();
gradient(topColor, bottomColor);
fill(255);
textSize(90);
textAlign(CENTER);
textFont(mainFontDif);
text("Done! \n Final Score: " ... | true |
007550ff8c9a12666f64ae585b4cb0999e5c8a82 | JavaScript | BGCX262/zz-bsp-svn-to-git | /trunk/v1.0.0/WebContent/bsp/abdf/js/Item.js | UTF-8 | 667 | 2.734375 | 3 | [] | no_license | /*----------------------------------------------------------------------------\
| 值和key JS
|-----------------------------------------------------------------------------
| 作者:刘正仁
\----------------------------------------------------------------------------*... | true |
7fab6d03495d9ada46156a26fea5b76b51458406 | JavaScript | danoseun/intelligent-innovations-conference-api | /server/validations/talk.js | UTF-8 | 1,601 | 2.703125 | 3 | [] | no_license | import validator from 'validatorjs';
import { talks } from '../database';
/**
* @param {object} req - The request object
* @param {object} res - The response oject
* @param {function} next
* @returns {object} JSON representing the failure message
*/
export const addTalkValidation = (req, ... | true |
a97d4cf94a971524f2fb0fa0f7d862c11287dc43 | JavaScript | sreytouchmoch/2021project-javascript1 | /js/app.js | UTF-8 | 2,114 | 3.234375 | 3 | [] | no_license |
function deleteFood(event) {
const buttonName = event.target.className;
if (buttonName == "delete") {
const delbtn = event.target.parentElement;
delbtn.remove();
}
}
function addFood(event) {
event.preventDefault();
let item = document.querySelector("#add-food-textfield");
let ... | true |
25e63e7fef1ff724a942d658fe6e827ea5b2bc1e | JavaScript | adambreen/choicepoint | /public/javascripts/affiliate.js | UTF-8 | 464 | 2.515625 | 3 | [] | no_license | //affiliate.js
$(document).ready(function (){
var
affiliateInput = $('#00N90000004H2pU'),
matches = document.URL.match(/https?:\/\/.*\/(info|test)\/?(.*)/),
affiliateCode
;
if(matches && matches.length > 1){
affiliateCode = matches[2];
if(affiliateCode[0] === '?'){
affiliateCode = 'internalLis... | true |
15d6a8506ce2e5cde5063719b5dc980864428eb2 | JavaScript | sindhuh/Leetcode | /previous leetcode/ZigZagConversion/firstMethod.js | UTF-8 | 1,640 | 4.21875 | 4 | [] | no_license | // ZigZag Conversion
var string = "abcdefghijklmnopqrstuvwxyz";
var nRows = 5;
console.log("The string after zigzag conversion is :", getZigZagString(string, nRows));
function getZigZagString(string, nRows) {
// checking base condition of nRows are less than 1 or greater than string length
// same string wil... | true |
1bda1f3770d6fabfd271b34f25752ee55df548bd | JavaScript | rohansdhek/r3-chat | /js/app.js | UTF-8 | 2,493 | 2.625 | 3 | [] | no_license | var db = new Firebase("https://r3chat.firebaseio.com/");
db.on("value", function(data) {});
$("#login").on('click', function() {
var email1 = $("#log_email").val();
var pass1 = $("#log_pass").val();
if (email1 == "" || pass1 == "") {
$("#warning").html("Fill all the fields");
} else {
$("#load"... | true |
af5aa2535565b31dfd4521563f536410264ad3b5 | JavaScript | ttetrafon/practice | /js/colour/random colour.js | UTF-8 | 229 | 2.984375 | 3 | [] | no_license | const generateRandomColour = () => `#${Math.floor(Math.random() * 0xffffff).toString(16)}`;
console.log("1: " + generateRandomColour());
console.log("2: " + generateRandomColour());
console.log("3: " + generateRandomColour());
| true |
d39aacfc22f47bda4f219c3a2f591ea072c74344 | JavaScript | Shipow/highcharts.com | /js/parts-more/AreaRangeSeries.js | UTF-8 | 5,981 | 2.625 | 3 | [] | no_license | /*
* The AreaRangeSeries class
*
*/
/**
* Extend the default options with map options
*/
defaultPlotOptions.arearange = merge(defaultPlotOptions.area, {
lineWidth: 1,
marker: null,
threshold: null,
tooltip: {
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.low}</b> - <b>{p... | true |
c855578db04dcfa6f84f53c6cca3fe52d331a32d | JavaScript | q-ode/more-recepies-sample | /controllers/recipiesCtrl.js | UTF-8 | 738 | 2.671875 | 3 | [] | no_license | const Recipie = require('../models').Recipie;
const recipiesCtrl = {
addRecipie(req, res) {
const name = req.body.name;
const ingredients = req.body.ingredients;
const description = req.body.description;
return Recipie.create({
name, ingredients, description
})
.then(recipie => {
... | true |
283deff15e4670fa9860a10411cc7ce4100d2033 | JavaScript | nabaddajoan/10-26-2020-tcamsystem | /admin/js/autocapture.js | UTF-8 | 944 | 2.609375 | 3 | [] | no_license |
function autoProcess(room_id) {
$.get('src/get.php', // url
{
token: 'class_room',
id: room_id,
},
function (response) { // success callback
if (response != 'null')
setInterval(checkAttendance, 2000, room_id)
}
);
}
function... | true |
353e67d2b75513ab13cd6f6152f7911561ad40cb | JavaScript | MichaelDurfey/TrelloRemake | /src/index.jsx | UTF-8 | 3,075 | 3 | 3 | [] | no_license | import React from 'react';
import ReactDOM from 'react-dom';
import Board from './components/Board';
import NavBar from './components/Navbar';
import './index.css'
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
boards: [
{
title: 'Winnie',
... | true |
a528405cfe1f305601ea25f4a6f3deed8af97b50 | JavaScript | eprincev-egor/grapeql | /src/parser/syntax/OrderByElement.js | UTF-8 | 1,768 | 2.984375 | 3 | [
"MIT"
] | permissive | "use strict";
const Syntax = require("./Syntax");
class OrderByElement extends Syntax {
parse(coach) {
this.expression = coach.parseExpression();
this.addChild(this.expression);
coach.skipSpace();
if ( coach.is(/asc|desc/i) ) {
this.vector = coach.readWord().to... | true |
d703abaf6ec06f15f469c78543a283265c05fd07 | JavaScript | Teaflavored/node-js-algorithms | /matrix_multiply.js | UTF-8 | 5,434 | 3.609375 | 4 | [] | no_license | var assert = require("assert");
//matrix is represented by 2d array
//assume input of n by n
//[[1,2], [2,3]] * [[3,4], [5,6]]
//[[1 * 3 + 2 * 5, 1 * 4 + 2 * 6 ], [ 2 * 3 + 3 * 5, 2 * 4 + 3 * 6 ]]
//[[13, 16], [ 21, 26 ]]
var naiveMultiply = function (matrix1, matrix2) {
var n = matrix1.length;
var result = [];
for... | true |
36e6d2bde357af506e51bfcd6c5a04c6e134f365 | JavaScript | Dheeraj-venkat/FSU- | /Demo Project/resources/js/dheeraj.js | UTF-8 | 204 | 2.6875 | 3 | [] | no_license | function spectrum(){
var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
$('.blinking').css({color:hue});
} | true |
ed14523a98cda2bb7e6c6750c168e3d7ba4e8e4b | JavaScript | cogas/cogas.github.io | /_includes/js/randomass.js | UTF-8 | 826 | 3.09375 | 3 | [] | no_license | window.onload = function(){
var can = document.getElementById("cvs");
if(!can.getContext) return false;
var ctx = can.getContext("2d");
//options
var point = {x:0,y:0};//座標
var par = {x:4,y:6};//変化量
var timer;//タイマー
var delay = 1;//タイマーを実行する間隔
var width = can.width
var height = ... | true |
966797f199da8c6736425e8fec11d09ffaff4cab | JavaScript | mithra28/digital-photo-frame | /main.js | UTF-8 | 592 | 2.546875 | 3 | [] | no_license | function preload()
{
}
function setup()
{
canvas = createCanvas(640 , 480);
canvas.position(350, 250);
video = createCapture(VIDEO);
video.hide();
}
function draw()
{
image(video , 10 , 10 , 640 , 480);
fill(255,50,0);
stroke(255,100,0);
circle(50,50,125);
f... | true |
cd4c351b5ee31f5a121d0aaf5f7a32cf084279b4 | JavaScript | zacanger/js-drills | /node/check-up.js | UTF-8 | 639 | 2.890625 | 3 | [
"0BSD"
] | permissive | #!/usr/bin/env node
// write a small cli app you can call to check
// if a website is up.
// usage: check-up.js google.com
/*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
const http = require('... | true |
5272ebbeebae33fc39e14ee5258fd071bfb5ac27 | JavaScript | mikechowdiv/JS-files | /projects/localWeather/v1/geolocation.js | UTF-8 | 420 | 2.65625 | 3 | [] | no_license | $(document).ready(function(){
if(navigator.geolocation){
navigator.geolocation.getCurrentPosition(function(position){
$('#data').html('latitude: ' + position.coords.latitude + '<br>longitude: ' + position.coords.longitude);
});
}
var api = 'http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=3... | true |