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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5a575f85ed408332c8b2f1f41f69bf453658f38d | JavaScript | YizhiHong/Leetcode-JavaScript-Solution | /378. Kth Smallest Element in a Sorted Matrix.js | UTF-8 | 867 | 4.125 | 4 | [] | no_license | /**
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.
Note that it is the kth smallest element in the sorted order, not the kth distinct element.
Example:
matrix = [
[ 1, 5, 9],
[10, 11, 13],
[12, 13, 15]
],
k = 8,
return ... | true |
da48057d33c1e04dec31c114d08fd4d9229adb6d | JavaScript | BlaiseCosico/live-poll | /controllers/SocketController.js | UTF-8 | 5,736 | 2.796875 | 3 | [] | no_license | const roomdata = require('roomdata');
let rooms = [];
let curr_room;
function makeid(length) {
var result = '';
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var charactersLength = characters.length;
for ( var i = 0; i < length; i++ ) {
result... | true |
19b8e55b7efa88468174b380858c53925a1424d9 | JavaScript | LuisGhz/react-4h-course-15-project-2 | /src/components/Note.jsx | UTF-8 | 1,493 | 2.515625 | 3 | [] | no_license | import { useDispatch } from "react-redux";
import moment from 'moment';
import { Link } from "react-router-dom";
import { deleteNote, toggleFavoriteNote } from "store/actions/noteAction";
const Note = ({ note }) => {
const dispatch = useDispatch();
const deleteNoteHandler = note => {
dispatch(deleteNote(note))... | true |
c5bcf1b8505b2c81e001f6d682d687fa1d8b678b | JavaScript | NoahFrank/DiscordScape | /src/commands/discordscape/inventoryCmd.js | UTF-8 | 1,091 | 2.625 | 3 | [] | no_license | const graf = require('discord-graf');
const storage = require('../../index').Storage;
module.exports = class InventoryCommand extends graf.Command {
constructor(bot) {
super(bot, {
name: 'inventory',
aliases: ['inv'],
module: 'discordscape',
memberName: 'inve... | true |
347645bf60bb8bba51a0eb5eaadf0201806f5c55 | JavaScript | rob-now/JavaScript--course | /myMax.js | UTF-8 | 984 | 3.640625 | 4 | [] | no_license | //Funkcja sprawdzająca, która liczba z podanego zakresu jest największa.
//W konsoli podaję też wynik za pomocą Math.max() dla porównania
function myMax() {
var arr = Array.from(arguments);
var result = arr[0];
console.log("Input: " + arr + "\n\n---myMin---");
for (var i = 0; i < arr.length; i++) {
... | true |
58845ee117d8660988d9420288d386adb38afee5 | JavaScript | MelMepham/p5-experiments | /p5.js Folders/03_22_Rotated ellipse/sketch.js | UTF-8 | 848 | 2.96875 | 3 | [] | no_license | function setup() {
createCanvas (600, 400);
}
function draw() {
background(233, 47, 171);
noStroke();
fill(238, 131, 209);
ellipse(200, 25, 100, 20);
ellipse(200, 298.2, 100, 20);
push();
translate(75,93.3)
rotate(2.1);
ellipse(0, 0, 100, 20);
pop();
push... | true |
abe2c12b073603c4d4587b61a0401c231e8460ab | JavaScript | jvke/bacon-forms | /src/components/forms/email.js | UTF-8 | 2,123 | 2.609375 | 3 | [] | no_license | import React from 'react';
import Bacon from 'baconjs';
import findIndex from 'lodash/findIndex';
import isEmail from '../../utils/isEmail';
export default class Email extends React.Component {
constructor() {
super();
this.state = {
errors: []
};
}
componentDidMount() {
const element = t... | true |
4bdc54c407bb0008c1afe1f48a0eb5eeadfd75ed | JavaScript | eveber/Test_React_App | /src/redux/dialog-reducer.js | UTF-8 | 1,074 | 2.796875 | 3 | [] | no_license | //Action types consts
const ADD_MESSAGE = 'ADD-MESSAGE';
//const UPDATE_TEXT_AREA_MESSAGE = 'UPDATE-TEXT-AREA-MESSAGE';
let initialState = {
dialogs: [
{id: 1, talkerName: 'Тимченко Николай', linkId: 1},
{id: 2, talkerName: 'Клименко Валентин', linkId: 2},
{id: 3, talkerName: 'Кузнецов Андр... | true |
a4c6d483b874351c8180f1b14b1fe48b19d31deb | JavaScript | TrendingTechnology/vue-template-babel-compiler | /src/plugins/utils/shouldPrependVM.js | UTF-8 | 1,697 | 2.6875 | 3 | [] | no_license | /*
Interpret Bubble's logic:
https://github.com/yyx990803/buble/blob/f5996c9cdb2e61cb7dddf0f6c6f25d0f3f600055/src/utils/prependVm.js
*/
import globals from '../constants/globals'
const t = require('@babel/types')
function inScope(scope, nodeName) {
if (!scope || !scope.bindings) return false
let ret = false
let... | true |
2842c62ece8495162c2f232a0c9a7a9b39b19092 | JavaScript | luorixiangyang/Blog-code | /front_end/javascript/js_requestAnimationFrame/sample_setInterval.js | UTF-8 | 581 | 3.109375 | 3 | [] | no_license | const start = () => {
const text = document.querySelector('.text')
const maxWidth = /[0-9]*/.exec(getComputedStyle(text).width)
let w = 0
const renderId = setInterval(() => {
for (let i = 0; i < 10000; i++) {
for (let j = 0; j < 10000; j++) {
const k = i * j
}
}
if (w < maxWidth... | true |
c32e1b5e7b2fcf089815d407a07e2cce1cfbcbd9 | JavaScript | HollingsworthX51/TriviaGame | /assets/game.js | UTF-8 | 1,429 | 3.375 | 3 | [] | no_license | function check() {
var question1 = document.quiz.question1.value;
var question2 = document.quiz.question2.value;
var question3 = document.quiz.question3.value;
var correct = 0;
if (question1 == "sixth") {
correct++;
}
if (question2 == "Tactical Studies Rules") {
correct++;... | true |
47f97877c6336b5f82a4452a1a7e7c53277c8fe9 | JavaScript | SmarkSeven/leetcode-js | /algorithms/arrayPairSum.js | UTF-8 | 1,325 | 3.875 | 4 | [] | no_license | /**
Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
Example 1:
Input: [1,4,3,2]
Output: 4
Explanation: n is 2, and the maximum sum of pairs is 4 = min(1, 2) + m... | true |
ff33014c2e2800704f9a33d48c2be5bcc7fb8c42 | JavaScript | oli-gra/js-basics-online-shopping-lab-bootcamp-prep-000 | /index.js | UTF-8 | 1,603 | 3.421875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | var cart = [];
function getCart() {
return cart;
}
function setCart(c) {
cart = c;
return cart;
}
function addToCart(item) {
// lable item
var itemincart={itemName:"",itemPrice:0}
itemincart.itemName=item
itemincart.itemPrice=Math.floor(Math.random()*100)+1
// put item in cart
cart.push(itemincart)
... | true |
53b543305ebdeac10d7694941c185ab94b35bc84 | JavaScript | catdad/json-cli-toolkit | /test/command/sort.test.js | UTF-8 | 3,245 | 2.78125 | 3 | [] | no_license | var expect = require('chai').expect;
var _ = require('lodash');
var ns = require('node-stream');
var through = ns.through;
var sort = require('../../lib/command/sort.js');
function write(stream, data) {
data.forEach(function (val) {
stream.push(val);
});
stream.end();
}
function run(data, opts, done) {
... | true |
b0f24b0a5f976e183ab72fd6d579df5ec02166fd | JavaScript | notchris/hypershot | /src/assets/shaders/bundle.glsl.js | UTF-8 | 4,451 | 2.703125 | 3 | [
"MIT"
] | permissive | ---
name: Test1
type: fragment
author: https://www.shadertoy.com/view/ltdXzX
---
#ifdef GL_ES
precision mediump float;
#endif
// glslsandbox uniforms
uniform float time;
uniform vec2 resolution;
varying vec2 fragCoord;
// shadertoy globals
#define iTime time
#define iResolution resolution
#define ANIMATE
#define ... | true |
f99f31451f5b8a04a609bdf6ccc9968fb91f9077 | JavaScript | Wombat42/PracticeStructure | /src/drills/binarytreeLCA/index.jsx | UTF-8 | 1,260 | 2.703125 | 3 | [] | no_license | import React from "react";
import Try from "../../components/try";
import TreeNode from "../../structure/tree";
export default function BinaryTreeLCA(props) {
const leftSide = new TreeNode(12, new TreeNode(25), new TreeNode(30));
const rightSide = new TreeNode(
15,
new TreeNode(36, new TreeNode(66, new Tre... | true |
f642b945cf07407416ded1303e00db80862316dc | JavaScript | wsbychkova/anomalyDetection-api | /app/machine_learning/svm_function.js | UTF-8 | 739 | 2.703125 | 3 | [] | no_license | var jssvm = require("js-svm");
var svm = new jssvm.BinarySvmClassifier({
alpha: 0.01,
iterations: 1000,
C: 5.0,
trace: false,
});
var trainingData = [];
var testingData = [];
const svmTrain = (allData) => {
const resultData = [];
for (let i = 1; i < allData.length; i++) {
if (i < 50) {
trainin... | true |
6b1963d8a9c1208ef1863abb61061711941ec320 | JavaScript | manasama77/5waktu.co.id | /js/login.js | UTF-8 | 1,309 | 2.6875 | 3 | [
"CC0-1.0",
"MIT"
] | permissive | function check_login()
{
//Mengambil value dari input username & Password
var username = $('#username').val();
var password = $('#password').val();
//Ubah alamat url berikut, sesuaikan dengan alamat script pada komputer anda
var url_login = 'https://gmpb-adam:8080/bsbuletin/process_login.php';
... | true |
1dc3c36e41fe97758f2e66672bd8e5094468dd64 | JavaScript | mayararysia/javascript_studies | /javascript_completo_2018/aula26_media/regex.js | UTF-8 | 1,016 | 3.734375 | 4 | [
"MIT"
] | permissive | /*
Expressões Regulares -Rgex https://regexr.com/
São padrões utilizados para encontrar, modificar ou validar
determinados padroes em strings
começa com duas barras -> //
? - zero ou uma vez
+ -> uma ou mais vezes
*- 0 ou mais vezes
\d - de 0 à 9
{4} - 4 dígitos
{0,4} - mín e máximo
$ - termina
^ - começa
... | true |
9d79130c6fc70e4ffa4b5fb5928c83a5c10ada9d | JavaScript | coolfriends/coolpal | /test/feature-request.test.js | UTF-8 | 4,135 | 2.546875 | 3 | [
"MIT"
] | permissive | import FeatureRequestPlugin from "../lib/plugins/feature-request/plugin.js";
describe("FeatureRequestPlugin", function() {
let bot_user_name = "abot";
let pal = {
prefix: "!",
client: {
user: {
username: bot_user_name
}
}
};
let plugin = new FeatureRequestPlugin(pal);
describ... | true |
ea5917ea9c6f78915b7041affc389c997284bc37 | JavaScript | nfooda/nu2020-nodejs- | /testCallback.js | UTF-8 | 141 | 3.34375 | 3 | [] | no_license | function area(n){
return n*n;
}
function test(callbackfunction){
return callbackfunction(20);
}
let x = test(area);
console.log(x); | true |
7bfb3f6074c303b41a0e839303de06ae6239c940 | JavaScript | baichaohua/JavaScript | /第一部分 基础/2 JavaScript 基础知识/2.15 函数表达式/FunctionExpression.js | UTF-8 | 6,421 | 4.8125 | 5 | [] | no_license | //在 JavaScript 中, 函数不是 “神奇的语言结构”,而是一种特殊的【值】;
//我们在前面的章节使用的语法成为 【函数声明】
function sayHi(){
console.log("Hello");
}
sayHi();
//而另外一种创建函数的语法称之为 【函数表达式】。通常会写成如下这样:
let sayHi2 = function () {
console.log('这是函数表达式的写法,就是将函数作为一个变量的值,类似于OC中的函数返回值');
}
sayHi2();
//其实上面2种写法,都是一样的:创建一个函数,并把它存进变量 sayHi 中
//注意,下面这个写法中 sayHi 后面没有()... | true |
4257aae3eada190cedcc802d15471a84be5e39af | JavaScript | errrrricka/ReactPrac | /src/components/SearchBar.js | UTF-8 | 963 | 3.3125 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
// const SearchBar = () => {
// return (
// <input />
// );
// }
// refactor from functional to class component.
// class components to record keeping and communicating with other components
// every class has a render. a function. that will return JSX, always.
class... | true |
bd6980b7318d99f3a7ddf9ebf9021252d52c5162 | JavaScript | hochan222/hochan222.github.io | /src/Components/Page/Transform/index.js | UTF-8 | 1,317 | 2.546875 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import axios from 'axios';
axios.create({
url: 'https://test/api/cafe/list/today',
});
const useFetch = url => {
const [data, setData] = useState(null);
const [error, setError] = useState('');
const [loading, setLoading] = useState(true);
useE... | true |
67812787d2a0ecda0852ecc7d290870850699ee5 | JavaScript | mdp/kdebug | /attempt.js | UTF-8 | 2,719 | 2.96875 | 3 | [] | no_license | const bitcoin = require("bitcoinjs-lib");
const gibberish = require("./gibberish-aes.js");
const bs58 = require('bs58');
function incrementBase58(num) {
return padLeft(convertBase(num.toString(10), 10, 58), 4, '1')
}
function padLeft(nr, n, str){
return Array(n-String(nr).length+1).join(str||'0')+nr;
}
function... | true |
a89d01f1944516489f1a7dec1150f2608c918f9c | JavaScript | rithvikp1998/Tux4Math | /js/multiplyPractice.js | UTF-8 | 1,565 | 3.546875 | 4 | [] | no_license |
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var count=0;
function check(){
document.getElementById("ansImg").style.visibility="visible"
var checkValue;
var numA;
var numB;
numA = document.getElementById("firstNum").innerHTML;
numB = document.getElementById(... | true |
e028b58f9f067047a56889279206aa6f5e17cf93 | JavaScript | upsidedownmind/boxcutjs | /src/placas.js | UTF-8 | 4,797 | 3.640625 | 4 | [
"Apache-2.0"
] | permissive | function log(w) {
console.log(w);
}
function graficarCorte(corte) {
log('----------------')
log('ancho: ' + corte.ancho + ', largo: '+ corte.largo);
for (var y = 0; y < corte.largo; y++) {
var linea = ' ';
for (var x = 0; x < corte.ancho; x++) {
linea += corte.superfici... | true |
dec566d553797c01f2c09f051e2ac30f21b92b6f | JavaScript | chengruixin/searchPractice | /client/src/components/LshGraph.js | UTF-8 | 2,554 | 3.234375 | 3 | [] | no_license | import { useEffect, useState } from "react";
import './LshGraph.css';
const canvasWidth = 400;
const canvasHeight = 400;
function LshGraph(){
const [bands, setBands] = useState(10);
const [rows, setRows] = useState(5);
const handleClickEvent = ()=>{
let tempBands = document.querySelector(".set-para... | true |
233859df9690fb214c827135a60900042b5963b2 | JavaScript | nikola-bodrozic/react-jest-mock-module | /src/utils/services.test.js | UTF-8 | 526 | 2.703125 | 3 | [] | no_license | import axios from "axios";
import { getHello } from "./services";
describe("should mock axios.get() when calling getHello()", () => {
it("mocked axios is called", () => {
getHello();
expect(axios.get).toHaveBeenCalledTimes(1);
expect(axios.get).toHaveBeenCalledWith("http://jsonplaceholder.typicode.com/po... | true |
b0dcf44f8f807762e0efbe1a72d16f9e0a014d20 | JavaScript | Mac-Taylor/Auto-Shop-Assignment | /js/views/shop.js | UTF-8 | 3,007 | 2.71875 | 3 | [] | no_license |
let View = require('ampersand-view');
module.exports = View.extend({
template: document.querySelector('#shop-template').innerHTML,
bindings: {
'model.tires': '.tires',
'model.paint': '.paint',
'model.exhaust': '.exhaust',
'model.horsepower': '.horsepower',
'model.mpg':... | true |
c22024e199b52d53e1c75e8547cdec41d250ee5a | JavaScript | nickdickerson/901NodeIntro-2019oct7 | /WIP/Ch01/js/weatherweek.js | UTF-8 | 692 | 3.78125 | 4 | [] | no_license |
let temps = [
{ day: "Monday", high: 80,low: 60 },
{ day: "Tuesday", high: 81,low: 61 },
{ day: "Wednesday", high: 82,low: 62 },
{ day: "Thursday", high: 83,low: 63 },
{ day: "Friday", high: 84,low: 64 },
{ day: "Saturday", high: 85,low: 65 },
{ day: "Sunday", high: 86,low: 66 },
];
let lo... | true |
f85b64c0378a77b520adb02f450366ec473be5aa | JavaScript | mbobbert/drench-game-gulp | /src/js/main.js | UTF-8 | 4,426 | 3.609375 | 4 | [] | no_license |
var divs = []; //multi-dimensional array of div's (the squares)
var colors = []; //multi-dimensional array of colours that are a second layer on top of the squares
var all_colors = ['#CF7210', '#1C1219', '#C3845F', '#B16C53', '#F5BA00', '#F0C6E2'];
/**
* Shuffle the 6 colors and assign a shuffled color to each coord... | true |
5d5e8a51a46ddfe29b5864f39e3cf31506d2150b | JavaScript | darkphotonKN/admin-cookie-auth | /components/LoginForm.js | UTF-8 | 1,208 | 2.53125 | 3 | [] | no_license | import Router from 'next/router';
import { authenticate } from '../misc/util';
export default class LoginForm extends React.Component {
state = {
email: '',
password: ''
};
handleInput = (e) => {
this.setState({ [e.target.name]: e.target.value });
};
handleSubmit = async (e) => {
e.prevent... | true |
d958baa0ff69c1be806300034c596caf38593a77 | JavaScript | jdelagal/AngularExpressNodeMongo | /server/api/books/book.api.js | UTF-8 | 876 | 2.5625 | 3 | [] | no_license | 'use strict';
var Book = require('./book.model.js');
exports.listBooks = function (req, res) {
Book.find(function (err, books) {
if (err) {
return handleError(res, err);
}
return res.json(200, books);
});
};
exports.createBook = function (req, res) {
var book = new Book();
book.title = req.... | true |
c859eb417ec5b9bd9130da82f7047b8daab51787 | JavaScript | MasoodAhmadi/webdriverIOAdvanced | /test/specs/wdio.utils.js | UTF-8 | 347 | 2.53125 | 3 | [] | no_license | function errorLog(e) {
console.log("Your error", e);
console.log("Your error message", e.message);
}
function addInput(path, value) {
$(path).click();
$(path).addValue(value);
}
function editInput(path, value) {
$(path).click();
$(path).clearValue();
$(path).addValue(value);
}
module.exports = { errorL... | true |
f6c4b1955d04cf1d26c6bdb72e436e44704bd120 | JavaScript | manikmatta17/Protractor_Automation | /LearningJavaScriptBasics/DefiningVariables.js | UTF-8 | 180 | 2.84375 | 3 | [] | no_license | console.log("Hello World!!");
var i=10;
console.log(i);
var name ="Manik";
console.log (name);
var value =10.10;
console.log(value);
var isCheck =true;
console.log(isCheck);
| true |
844b8761d264726d9c3a972573629bdc06cfbd4a | JavaScript | CodeCoreYVR/class_demos_bootcamp_march_2021 | /js_functions_arrays/demo.js | UTF-8 | 4,118 | 4.46875 | 4 | [] | no_license |
if(false){
//typeof 'name' "" ``
// function (){ // for fucntion JS interpreter looks for this sequence
// }
// [] // For Arrays JS interpreter look for square brackets
}
// DRY = Don't Repeat Yourself
// Funcitons provide us a way to reuse the code
if (false){
// Simple function
// 👇🏻 This is known... | true |
f48cdf0f6fb948c2a5127eda71bdb495ea7a128b | JavaScript | abduljarkoni/Jvalley_css_display | /main.js | UTF-8 | 201 | 2.8125 | 3 | [] | no_license | //mengatur css display
const cssDisplay = (event) => {
//tangkap select value nya
let selecValue = document.getElementById("css_display").value;
//tampilkan di log
console.log(selecValue);
};
| true |
b510b8f320cc029945c6810e1caad1f7c09e0465 | JavaScript | maror757/Neural-Network-Character-Recognition | /src/index.js | UTF-8 | 3,538 | 2.71875 | 3 | [] | no_license | import { MnistData} from './data'
import { NeuralNetwork } from './model'
import sketch from './sketch'
import * as ui from './ui'
import p5 from 'p5'
//const CREATE_NEW = false
var drawing
var model
var data
var interval_prediction
async function create_new_model(num_train_elements) {
console.log('clear local sto... | true |
96b3cbae9a8573ec04c5f6a23cb935d30aab3362 | JavaScript | sun-074/project | /third/exp-demo/utils/index.js | UTF-8 | 2,879 | 2.828125 | 3 | [
"MIT"
] | permissive |
const crypto = require("crypto"); // Node 自带API
// MD5 只能加密不能解密
// 加密函数 data 需要加密的字段
function aesEncrypt(data, key) {
const cipher = crypto.createCipher('aes192', key);
var crypted = cipher.update(data, 'utf8', 'hex');
crypted += cipher.final('hex');
return crypted; // 密文
}
// 解密
function a... | true |
810b1b1c4858b265c68259cff323fc924b2b36c1 | JavaScript | EdxOrx/AuthGenerationBootcamp | /js.js | UTF-8 | 1,912 | 2.953125 | 3 | [] | no_license | const isLoggedIn = () => {
let loggedin = localStorage.getItem('loggedin');
if(loggedin){
return true;
}else{
localStorage.removeItem('loggedin');
return false;
}
};
const logIn = (email, pass) => {
if(email === "email@email.com" && pass === "pass"){
console.log("inside");
localStorage.se... | true |
2b4634a104bcf312b10eeb8227de503168f60e21 | JavaScript | inuduka-shino/koaect_test | /gm_test.js | UTF-8 | 1,520 | 2.671875 | 3 | [] | no_license | /*eslint no-console: 0 */
/*global console */
(function () {
'use strict';
/*
function test0() {
var im = require('gm').subClass({imageMagick: true});
im('image/PE004.jpg')
.rotate('green', 90)
.write('image/imtest.jpg', function (err) {
if (err) {
... | true |
241926ed0226b6d9356eedcca6465429b7443931 | JavaScript | DimaLukianov/LaravelBlog | /resources/js/search.js | UTF-8 | 557 | 2.703125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
$('#keyword').on('input', function() {
var searchKeyword = $(this).val();
if (searchKeyword.length >= 1) {
$.post('/search.php', { keywords: searchKeyword }, function(data) {
$('ul#content').empty()
$.each(data, function() {
... | true |
6a6317f41852a1748374dafb5b1fc1d96043f413 | JavaScript | ajinkyapuar/mws-restaurant-stage-1 | /src/js/dbhelper.js | UTF-8 | 7,454 | 2.78125 | 3 | [] | no_license | /* global google */
/* eslint-env browser, es6 */
/**
* Common database helper functions.
*/
class DBHelper {
/**
* Database URL.
* Change this to restaurants.json file location on your server.
*/
static get DATABASE_URL() {
const port = 1337 // Change this to your server port
return `http://localhost:$... | true |
9fcb92c9815fbab52d9460dd12c6b71c29ede837 | JavaScript | amrtgaber/10d6 | /public/js/controllers/dice-ctrl.js | UTF-8 | 2,276 | 2.78125 | 3 | [
"ISC"
] | permissive | angular.module('10d6')
.controller('diceCtrl', function($scope) {
$scope.dice = [];
$scope.dice.push(new Dice(6));
$scope.addSingleDice = function(sides) {
$scope.dice.push(new Dice(sides));
$scope.singleDice = {}; // clear input field
$scope.$emit('stats');
};
$scope.addMultiD... | true |
f0aadd37f92e669fef9ab4a0efc717c0024ee869 | JavaScript | hagward/Swoopy | /js/gamecanvas.js | UTF-8 | 3,163 | 3.421875 | 3 | [] | no_license | /**
* Represents the visual minefield.
*/
function GameCanvas(gameCanvas, gridCanvas, minefield, cellSize) {
var color = {
normal: 'black',
revealed: 'lightGrey',
flag: 'blue',
mine: 'red',
border: 'white'
};
var numberColors = [
'green',
'green',
... | true |
4a7a82eddcd0f5942bc428e35ec33d95027e535d | JavaScript | NicoleAyme/CETAV | / Final JS /js/main.js | UTF-8 | 862 | 3.21875 | 3 | [] | no_license | var json = function json() {
// Obtener la instancia del objeto XMLHttpRequest
if (window.XMLHttpRequest) {
peticion_http = new XMLHttpRequest();
} else if (window.ActiveXObject) {
peticion_http = new ActiveXObject("Microsoft.XMLHTTP");
}
// Preparar la funcion de respuesta
peticion_http.onreadyst... | true |
c750faa7790b143afe5b0a30d386980e0cd9787f | JavaScript | AshishkrGoyal/streetmix | /bin/download_translations.js | UTF-8 | 1,653 | 2.59375 | 3 | [
"LicenseRef-scancode-unknown-license-reference"
] | permissive | 'use strict'
const fs = require('fs')
const path = require('path')
const getFromTransifex = require('../lib/transifex.js')
const envFile = path.join(__dirname, '/../.env')
if (fs.existsSync(envFile)) {
const env = require('node-env-file')
env(envFile)
}
const resources = ['main', 'segment-info']
const languages ... | true |
ad989faa8bc79a84e64d92d7f130484251842848 | JavaScript | alekstar79/netaggregator | /var/www/netaggregator.ru/nuxt/utils/canvas/dinamic/star.mjs | UTF-8 | 760 | 3.25 | 3 | [] | no_license | const { random } = Math
export class Star
{
constructor({ w, h, velocity: v = 1, star })
{
this.x = random() * w
this.y = random() * h
this.vx = random() * (random() > .5 ? v : -v)
this.vy = random() * (random() > .5 ? v : -v)
this.radius = star.random
? ra... | true |
be26a893ed6466d06eae8f1628fff463bbeb6c7b | JavaScript | brendanjcaffrey/itunes-streamer | /serve/track_table.js | UTF-8 | 7,308 | 2.53125 | 3 | [
"MIT"
] | permissive | var TrackTable = function(colDescriptions, rowsPerPage, trackChanges) {
this.table = $("#tracks");
this.contextMenu = $("#context-menu");
this.contextMenuPlay = this.contextMenu.find(".play");
this.contextMenuPlayNext = this.contextMenu.find(".play-next");
this.contextMenuDownload = this.contextMenu.find(".do... | true |
a2223501317a9caae605ba2bff1f6d39829736fa | JavaScript | mateo2021/Projekty_MS | /praca_lic/strona/script.js | UTF-8 | 2,852 | 2.703125 | 3 | [] | no_license | //obsługa elementów wjazdowych 2 lewo 1 prawo
$(document).on("scroll", function() {
const windowHeight = $(window).height();
const scrollValue = $(this).scrollTop();
const $art2 = $(".art2");
const $art1 = $(".art1");
const $art3 = $(".art3");
const art2FromTop = $art2.offset().top;
const art2Height = $... | true |
f458d2c5cd27e7ea26b1a1040c525434bb2fee64 | JavaScript | tcandarli/protractorTestScripts | /CtekProject/interactionWithElements.js | UTF-8 | 1,285 | 2.9375 | 3 | [] | no_license | describe('Interacting Elements Suite', () => {
it('isPresent Method', () => {
browser.get('https://www.bhtp.com/');
// isPresent()
element(by.id("cta-button")).isPresent().then(function (result) {
if (result == true) {
console.log("Get Quote Button Test Pa... | true |
ac05a132f21150e73f84837ca4a7864aa1b56a6b | JavaScript | aastharajput/Sales-App-Prototype | /cordova-module/platforms/android/app/src/main/assets/www/js/ImageHelper.js | UTF-8 | 1,510 | 2.625 | 3 | [] | no_license | define([],function(){
var ImageHelper = {
cacheDir : null,
init:function(){
log.info('Initializing ImageHelper');
if(typeof(cordova.file)=="undefined") {
log.error("cordova file not found");
return;
}
log.info('Initializing for ',cordova.file.externalCacheDirectory);
var that = thi... | true |
bda89bdb24a2122d438d142eb5682b59fb28c0d4 | JavaScript | wenden-risk-analyser/risk-calculator | /src/risk-calculator.js | UTF-8 | 3,636 | 2.671875 | 3 | [] | no_license | const check = require('check-types');
const riskConstants = require('./risk-constants');
const validationContent = riskConstants.ValidationContent;
const customerRisks = require('./risk/risks.customer');
const betRisks = require('./risk/risks.bets');
/*
* Customer Service interface
*
* @typedef... | true |
c4a25aa13f0ce0ae6b6e4f9abdc5db56e2d7952f | JavaScript | Riccardoburderi/films | /src/App.js | UTF-8 | 1,507 | 2.53125 | 3 | [] | no_license | import React from 'react';
import './App.css';
import Movielist from './Components/Movielist';
import Navbar from './Components/Navbar2';
const APIKEY = '42c2b0ab';
const APIURL = 'http://www.omdbapi.com/';
function fetchMovies(search){
return fetch(APIURL+'?apikey='+APIKEY+'&s='+search).then((res)=>res.json());
}
... | true |
b28cb38daddfcbe9f9eafb9a75a054cef1395836 | JavaScript | VictoriyaLomonosova/Front-end-pro.-Lomonosova | /homework 16/dz16.js | UTF-8 | 2,545 | 3.65625 | 4 | [] | no_license | class Clock {
constructor() {
this.timer = null;
}
formatDateToString() {
throw new Error("Not implemented!");
}
render() {
const timeElement1 = this.formatDateToString();
for (let i = 0; i < timeElement1.length; i++) {
const square = document.createElement("span");
do... | true |
d1ce502fd5ae5fa6b50565a391b4d22e39fd6129 | JavaScript | cyuseff/clevertech | /app_client/src/utils/Fetch.jsx | UTF-8 | 456 | 2.59375 | 3 | [] | no_license | 'use strict';
import Fetch from 'whatwg-fetch';
function parseJSON(data) {
return data.json();
}
function _fetch(url, method, data) {
let opts = {method};
if(data) {
url += '?';
for(let i in data) url += i + '=' + data[i] + ',';
url = url.replace(/,$/, '');
}
return fetch(url, opts)
.then... | true |
a55873cbe16f5ca8e9bebc455c7fa26e9d287b42 | JavaScript | akshayjai1/expres-graphql | /schema.js | UTF-8 | 2,593 | 2.578125 | 3 | [] | no_license | const axios = require("axios");
const { GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLSchema, GraphQLList, GraphQLNonNull } = require('graphql');
const CustomerType = new GraphQLObjectType({
name: 'Customer',
fields: () => ({
id: { type: GraphQLString },
name: { type: GraphQLString },
... | true |
8fbb5f1bb0895364ece58978f8f887d9fa7dc983 | JavaScript | d4rkr00t/reactc | /examples/__tests__/CompositeComponent-test.js | UTF-8 | 10,573 | 2.546875 | 3 | [] | no_license | import test from "ava";
test("should support rendering to different child types over time", t => {
t.pass();
});
// TODO:
// it('should support rendering to different child types over time', () => {
// const instance = ReactTestUtils.renderIntoDocument(<MorphingComponent />);
// let el = ReactDOM.findDOMNode(in... | true |
043a7fa2ad2ef6603b4ea5deb2c67136a0996f59 | JavaScript | i-request/IReq-FE-Cafe | /src/filterProducts.js | UTF-8 | 188 | 2.65625 | 3 | [] | no_license | function filterProducts (product, searchTerm) {
return products.filter(product) => {
return product.name.toLowerCase().includes(searchTerm)
}
export default filterEmojis | true |
0c697e87714af17c375fb1c14b3a111a286bf178 | JavaScript | robert-porter/blackjack | /TyTest/app.js | UTF-8 | 6,326 | 3.421875 | 3 | [] | no_license |
var canvas;
var context;
var deck;
var playerHand = [];
var dealerHand = [];
var pot = 0;
var playerStack = 100;
var dealButton;
var hitButton;
var standButton;
var debugOut;
//enum
var playerBusted = 2;
var dealerBusted = 3;
var playerWin = 4;
var dealerWin = 5;
var tieGame = 6;
///enum
var images = [];
funct... | true |
df0bc2b90314de7ff1ab8ce9dd982bf8cf88c1ff | JavaScript | Loop80/gmail-templates-extension | /backend/TemplatesList.js | UTF-8 | 2,378 | 2.953125 | 3 | [] | no_license | 'use strict';
const e = React.createElement;
class TemplatesApp extends React.Component {
constructor(props) {
super(props);
this.state = {
items: [
{
id: 1,
title: "Lorem Ipsum",
... | true |
b6939c45582dc365fbbbc0fffe124cbfc926e664 | JavaScript | amnh-digital/hope-icecore-web | /data/TestTimescale.js | UTF-8 | 387 | 2.6875 | 3 | [] | no_license | const Timescale = require('./Timescale');
var timescale = new Timescale({'sourceFile':'./gisp2age.txt'});
timescale.on('data', data => console.log(data));
var test = function(){
for(let i = 0; i < 11; i++){
let testNum = 1.0 - (i / 10.0);
console.log(`Testing ${testNum}:`);
timescale.update(testNum);
}
//ti... | true |
4ddce071e2758f9c6ff115f40892a095523602b8 | JavaScript | iicoom/Note | /JavaScript/JS-quiz/Higher-order.js | UTF-8 | 3,142 | 4.65625 | 5 | [
"MIT"
] | permissive | /**
* 高阶函数:英文叫Higher-order function
* 一个函数就可以接收另一个函数作为参数,这种函数就称之为高阶函数
*/
/**
* 调用方式 minus(8)(3)
* @param {*} m
*/
function minus(m) {
return function(n) {
return m - n;
}
}
console.log(minus(8)(3))
// => 3
/**
* 1. 最简单的形式
*/
function add(m, n, f) {
return f(m) + f(n);
}
console.log(add... | true |
3eea2120780220abb9503f5cf1135ebd1c5a4c40 | JavaScript | Thezigzagtree/JSFoundationsProjectThree | /JSFoundationsProjectThree.js | UTF-8 | 1,609 | 3.703125 | 4 | [] | no_license | // A class that
class Person {
constructor(name, age, gender) {
this.name = name;
this.age = age;
this.gender = gender;
}
}
class Instructor extends Person {
constructor(name, age, gender, subject) {
super(name, age, gender);
this.subject = subject;
}
}
class Student extends Person {
constructor(name, ... | true |
bb4dc2a62eb11a51db1ee23262b627701037b31d | JavaScript | LyricsProject/lyricsCloud | /Functions/binaryFind.js | UTF-8 | 485 | 3.546875 | 4 | [] | no_license | function binaryFind(arr, member) {
let left = 0;
let right = arr.length;
let insertionPoint = left + Math.floor((right - left) / 2);
while (left < right) {
if (member < arr[insertionPoint].letter) {
right = insertionPoint;
} else if (member > arr[insertionPoint].letter) {
left = insertionPo... | true |
94d09467f9b8bb18be99287fb73a78676c02eea5 | JavaScript | hspradlin8/Freaky-Faeries | /src/components/event/EventEditForm.js | UTF-8 | 2,843 | 2.625 | 3 | [] | no_license | import React, { Component } from "react"
import EventManager from "../../modules/EventManager"
class EventEditForm extends Component {
//set the initial state
state = {
eventName: "",
date: "",
venue: "",
loadingStatus: true,
};
handleFieldChange = evt => {
cons... | true |
15482e815112eaf3ec6b92ae8acab35318eacc2a | JavaScript | s3rgeym/bots.hub | /catalog/Sima(Cocos) + MDB JS/functions.js | UTF-8 | 6,081 | 2.890625 | 3 | [
"Unlicense"
] | permissive | const { Utils } = require('cocoscore');
const { Keyboard } = require('vk-io')
const moment = require("moment");
moment.locale("ru");
/*function sp(string) {
if (typeof string !== "string") string = string.toString();
return string.split("").reverse().join("").match(/[0-9]{1,3}/g).join(".").split("").reverse().join("... | true |
5ea178c5f6295462992bf98eb90a8651a0e242fd | JavaScript | rubinj30/intro-web-workers | /src/index.js | UTF-8 | 1,136 | 3.09375 | 3 | [] | no_license | import createBounce from './bounce';
import fib from './fib';
import asyncFib from './asyncFib';
const form = document.getElementById('input-form');
const input = document.getElementById('input');
const radios = document.querySelectorAll('input[type="radio"]');
const display = document.getElementById('display');
const... | true |
add441489db2c8d05991d54580a79f43fe9c95b6 | JavaScript | torirossini/330-project-1-01 | /src/abcLIB.js | UTF-8 | 463 | 3.03125 | 3 | [] | no_license | (function(){
function dtr(degrees){
return degrees * (Math.PI/180);
}
function drawCircle(ctx,x,y,radius,color){
ctx.save();
ctx.fillStyle = color;
ctx.beginPath();
ctx.arc(x,y,radius,0,Math.PI * 2);
ctx.closePath();
ctx.fill();
c... | true |
f12f6c81fa6d0726c446aa4c41d4bdc776d9106e | JavaScript | luanadkuster/Exercism | /teams/start-tech/javascript/space-age/space-age.js | UTF-8 | 567 | 2.828125 | 3 | [] | no_license | const periodoOrbital = {
mercury: 0.2408467,
venus: 0.61519726,
earth: 1.0, // todos os demais períodos são baseados no período da Terra sendo igual a 1
mars: 1.8808158,
jupiter: 11.862615,
saturn: 29.447498,
uranus: 84.016846,
neptune: 164.79132
};
const periodoTerraEmSegundos = 31557600;
export const ... | true |
bb271e7cebab292d68eacea64fbfcbc9f9db002f | JavaScript | AnaPapst/rocketgirl.github.io | /followmouse.js | UTF-8 | 1,410 | 2.953125 | 3 | [] | no_license | (function(){
// I load the easel.js library before this is called.
// https://code.createjs.com/easeljs-0.6.1.min.js
// You don't see that in the codepen code though
var myCanvas = document.createElement('canvas');
var canvas = document.querySelector('body').appendChild(myCanvas);
canvas.hei... | true |
01ae4d0b73a64dff3fd2098fefc4e246ee40a7a9 | JavaScript | AleksandrSimonov/avtoruExt | /loadingAnimation.js | UTF-8 | 991 | 2.609375 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function () {
$('#loadingAnimation').ready(function() {
LoadingAnimation('loadingAnimation');
});
});
function LoadingAnimation(convasId){
debugger;
var c=document.getElementById(convasId),
ctx=c.getContext('2d'),
pi = Math.PI,
xCenter = c.w... | true |
178ee534786488d4f7328c5c832316d837147bf3 | JavaScript | dawidl022/le-js-tutorial | /functional.js | UTF-8 | 1,698 | 3.640625 | 4 | [] | no_license | "use strict";
let states = ["Kansas", "Nebraska", "North Dakota", "South Dakota"];
function imperativeUrls(elements) {
let urls = []
elements.forEach(element => {
urls.push(urlify(element));
});
return urls;
}
function urlify(string) {
return string.toLowerCase().split(/\s+/).join("-");
}
function toC... | true |
e46d5214a7e72cce8ca9f93e597950b039ff48bb | JavaScript | fredisp/fredispig.github.io | /demo/fanye/demo.js | UTF-8 | 707 | 2.609375 | 3 | [] | no_license | /**
* Created by wong on 2018/3/6.
*/
(function(){
init();
function init(dom,args){
if(args.current<= args.pageCount) {
fillHtml(dom.args);
bindEvent(dom,args)
}else { alert("wrong num")}
}
function fillHtml(dom,args){
//btn 上一页
//数字页数部分
... | true |
6028c0ffbfc44c0d22db49635540d5e25655038c | JavaScript | asharali315/quizapp | /app.js | UTF-8 | 6,137 | 2.578125 | 3 | [] | no_license | var questionAsked = 0
var score = 0
var questions = document.getElementById("question")
var optionsElement = document.getElementsByClassName("opt-element")
var correctAnswer = ""
var quiz = [
{
id: 0,
question: "who was the last viceroy of India?",
answer: "MOUNT BATTEN",
options: [
... | true |
0dea77599b1df1e951305f75279e82f9a5a5a40b | JavaScript | wbotelhos/notify | /spec/model/afterOpen_spec.js | UTF-8 | 1,100 | 2.765625 | 3 | [
"MIT"
] | permissive | describe('#afterOpen', function() {
'use strict';
context('with callback', function() {
it ('executes the callback', function() {
// given
var instance = new Notify({
afterOpen: function() {
this.called = true;
}
});
// when
instance._afterOpen.call(inst... | true |
56c4d14a67b8d6ccbd3acee8706862763456d3ae | JavaScript | 0chroma/Nexuiz-Scores--old- | /dojo/dojo/_base/array.js | UTF-8 | 6,298 | 3.046875 | 3 | [
"AFL-3.0",
"AFL-2.1",
"BSD-3-Clause"
] | permissive | if(!dojo._hasResource["dojo._base.array"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
dojo._hasResource["dojo._base.array"] = true;
dojo.require("dojo._base.lang");
dojo.provide("dojo._base.array");
(function(){
var _getParts = function(arr, obj, cb){
return [
(dojo.is... | true |
e03684eb3eb0f4853f90f4f01f7db41f767289f2 | JavaScript | kutluduman/kata | /sumLargest.js | UTF-8 | 191 | 3.4375 | 3 | [] | no_license | const sumLargestNumbers = data => {
const arr = data.sort((a,b)=> b - a);
return arr[0] + arr[1];
};
const array = [65,1,6,5,7,8,9,45];
console.log(sumLargestNumbers(array));
| true |
e54b60f443c5c747eb3e7b6c3b39c972702ae4d3 | JavaScript | efmcoder/completeJavaScriptCourse | /2-JS-basics/final/challenge1.js | UTF-8 | 720 | 4.25 | 4 | [] | no_license | /*
Mark and John are trying to compare their BMI which is calculated
BMI = mass / height^2
mass in kg and height in meters.
1. Store Mark and John's mass and height in variables
2. Calculate both their BMI's
3. Print a string to the console for whose BMI is higher - use true/false
*/
var massMark = 80;
var heightMark =... | true |
cc3b91a6905377276a0897279cb01d8d22b90ce1 | JavaScript | thomb212/assignment_3 | /challenge_bonus/sketch.js | UTF-8 | 1,445 | 3.078125 | 3 | [] | no_license |
function setup() {
createCanvas(640, 480);
}
function draw() {
colorMode(HSB, 100);
for(var g = 0; g < 10; g++){
for(var i = 0; i < 10; i++){
noStroke();
var randomValue = random(10);
var squareFill = random(100);
fill(0, 0, randomValue * 10 - squareFill);
rect(i * 64, g * 64, 64, 64);
}
}
color... | true |
55a0b0a9bc71b6a91fb57867192382ae9874e868 | JavaScript | asriley/PoseNet | /sketch.js | UTF-8 | 1,691 | 3.421875 | 3 | [] | no_license | // ml5 has pre-made machine learning libraries to use
// posenet is a library in ml5 and is a machine learning model
// allows for real-time human-pose estimation
let video;
let poseNet;
let noseX = 0;
let noseY = 0;
let eyelX = 0;
let eyelY = 0;
function setup() {
createCanvas(640, 480);
// adds a webcam image... | true |
99c267bed1681fefe2cbce9c987b2321cbae8bc0 | JavaScript | shailic/interfacedevelopment1 | /0.5 Exercises/Week 1/P1 The Fortune Teller/js/main.js | UTF-8 | 503 | 2.96875 | 3 | [] | no_license | // These are my variables
var jobTitle = "scientist";
var geoLocation = "Geneiva";
var partnerName = "ThatPerson";
var noChildren = 3;
// Output
$('.output').html("<p>Tell me my fortune!</p>");
var fortune = function() {
if (jobTitle == "scientist") {
$('.output').html("<p>You will be a " + jobTitle + " in " + ... | true |
95469a7fd4fef7ac7529d00d9863d7917611d437 | JavaScript | EncoreMultimedia/PictureMapper | /src/app/ExportCSV.js | UTF-8 | 1,256 | 2.609375 | 3 | [] | no_license | /**
* Created by jfortune on 9/11/16.
*/
import React,{Component, PropTypes} from 'react';
class ExportCSV extends Component {
fireDownload() {
let breakpoints = this.props.breakpoints;
let csv = [];
csv.push('data:text/csv;charset=utf-8,' + ['Breakpoint', 'Width', 'Height', 'Multiplier', 'Style'].jo... | true |
0ddc54606654e63e9bf0c03aba6995b99ab85a17 | JavaScript | fwilkerson/franken-app | /resources/todo/src/actions.js | UTF-8 | 581 | 2.65625 | 3 | [] | no_license | const assign = (...args) => Object.assign({}, ...args);
const setTodos = ({todos, todo}) => [...todos, {text: todo, complete: false}];
const addTodo = state => ({todo: '', todos: setTodos(state)});
const setComplete = todo => assign(todo, {complete: !todo.complete});
const toggleTodo = ({todos}, id) => ({
tod... | true |
de29a0e2e77fa0194337053a39b2b9a9c1b49f4e | JavaScript | dannycoates/heka-decode-stream | /fill-buffer.js | UTF-8 | 317 | 2.71875 | 3 | [] | no_license | module.exports = function fillBuffer(state, buf) {
var bytesLeft = state.buffer.length - state.index
var bytesCopied = Math.min(buf.length, bytesLeft)
buf.copy(state.buffer, state.index, 0, bytesCopied)
state.rest = buf.slice(bytesCopied)
state.index += bytesCopied
return state.index === state.buffer.length
}
| true |
b2510ca086bfed69bb3b1a76a41d38ab798bed3a | JavaScript | Dealers/dealers-website | /app/services/products-grid.service.js | UTF-8 | 2,140 | 2.703125 | 3 | [] | no_license | /**
* Created by gullumbroso on 29/04/2016.
*/
angular.module('DealersApp')
/**
* This service offer methods to manage and orginize product arrays.
*/
.factory('ProductsGrid', ['$http', '$rootScope', 'Authentication', function ProductsGridFactory($http, $rootScope, Authentication) {
var PRODUCTS_IN_CH... | true |
eca091f5d2df99ce3155e1debabc2009c8734899 | JavaScript | HelloKevinTian/js-sample | /buffer.js | UTF-8 | 2,562 | 3.734375 | 4 | [] | no_license | var buf1 = new Buffer(2);
var buf2 = new Buffer(4);
var buf3 = new Buffer(6);
var buf4 = new Buffer(8);
var buf5 = new Buffer(4);
var shortNum = 65535; //2字节最大值
var intNum = 4294967295; //4字节最大值
var timeNum = Math.floor(Date.now());
var timeDoubleNum = Date.now();
buf5[0] = 0xff;
buf5[1] = 0xff;
buf5[2] = 0xff;
buf5[3... | true |
b69dab966098eb28794ac8048a47692147694d4a | JavaScript | ozt88/Physics | /src/nextphysics/util/Util.js | UTF-8 | 547 | 2.984375 | 3 | [] | no_license | /**
* @author namhoon <emerald105@hanmail.net>
*/
/**
* Utility class
*
* @class NP.Util
* @constructor
*/
NP.Util = function() {
/**
* return if it is integer
*
* @method isInt
* @param n
* @return {boolean}
*/
this.isInt = function(n) {
return typeof n === 'number' && n % 1 === 0... | true |
841e1baa9bbbac24484a8517c2b97f9700c98491 | JavaScript | Navaneetham07/HideMe | /login/src/Notes/index.js | UTF-8 | 2,290 | 2.734375 | 3 | [] | no_license | import React from "react";
import '../assets/name.css';
import '../assets/style.css';
var array=[]
class Notes extends React.Component {
constructor(props){
super(props);
this.state={
items:[],
value:'',
id:0
}
this.addNote=this.addNote.bind(this);
this.gotoLogin=this.gotoL... | true |
7b8e66077fd3124e7eee13531f8175d1238222dc | JavaScript | hugoduchene/ChoixEcole-Heroku | /app/static/js/app.js | UTF-8 | 2,557 | 2.53125 | 3 | [] | no_license | if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('/sw.js')
.then(function(registration) {
console.log('Service Worker Registered!');
return registration;
})
.catch(function(err) {
console.error('Unable to register service worker.', err);
});
}
const CACHE_NAME = 'stat... | true |
8a236b08aab28e5479d4c1edd177e9ed2cfc63d8 | JavaScript | guatedude2/bunny.2d.example | /app/stages/Splash.js | UTF-8 | 1,933 | 2.53125 | 3 | [
"MIT"
] | permissive | import _ from 'lodash';
import {Game, Stage, Sprite, Loader, Shape} from 'bunny.2d';
import assets from '../assets.json';
export default class Splash extends Stage {
constructor() {
super(0xFFFFFF);
this.alpha = 0;
// logo sprite
this.logo = new Sprite('assets/logo.png');
this.logo.alpha = 0;
... | true |
9b82e212ebd5000423b11d3573131ba06d85a226 | JavaScript | thang-hoang/weather-dashboard-workshop | /weather/weather-redux.js | UTF-8 | 2,901 | 2.65625 | 3 | [] | no_license | import { createStore, applyMiddleware } from 'redux';
import ReduxThunk from 'redux-thunk';
import * as actionCreators from './weather-action-creators.js';
import * as actions from './weather-actions.js';
const dummyTime = "2017-01-09T05:10:19.367Z";
export const addCityFunc = cityName => dispatch => {
queryCityD... | true |
5972d85c4c9c486b0a2d25da5f8ed81be42935ee | JavaScript | ErnWong/nzypt2016-pendulum | /lib/pendulum.js | UTF-8 | 2,516 | 2.671875 | 3 | [] | no_license | import rk4 from 'ode-rk4';
const angle1 = 0;
const angle2 = 1;
const dangle1 = 2;
const dangle2 = 3;
function diff(f, x) {
const dx = 1e-6;
let x1 = x - dx;
let x2 = x + dx;
let y1 = f(x1);
let y2 = f(x2);
return (y2 - y1) / (x2 - x1);
}
export function Pendulum({
g,
l,
pivotAngVel,
pivotRadius,
... | true |
4728a155e67b1f8387b549d60909a05222dc395c | JavaScript | rizvanrzayev/mover-warehouse-mobile-new | /src/reducers/activeQueue.js | UTF-8 | 1,045 | 2.53125 | 3 | [] | no_license | import {
FETCH_SINGLE_QUEUE,
FETCH_SINGLE_QUEUE_FAIL,
FETCH_SINGLE_QUEUE_SUCCESS,
} from 'actions/queue';
const initialState = {
queue: {},
prepared: false,
preparedParcel: [],
isLoading: false,
hasError: false,
};
const activeQueue = (state = initialState, action) => {
switch (action.type) {
ca... | true |
c44d86ff19e749dacc9e617336687a0b1b9ab6b7 | JavaScript | fanfanstl/projects | /django项目/school/static/usermanagement/js/login.js | UTF-8 | 795 | 2.5625 | 3 | [] | no_license | $(function () {
//表单提交事件
$("#reg_form").submit(function (e) {
if (!check()) {
e.preventDefault()
}
else {
var $passwd = $("#passwd_input");
var passwd = $passwd.val().trim();
$passwd.val(md5(passwd));
}
});
fun... | true |
7a94c7d39dba66d1ba127a779a94932f6e90a65f | JavaScript | Olegow/numberbook.github.io | /js/index.js | UTF-8 | 1,148 | 2.734375 | 3 | [] | no_license | ;(function () {
let contacs = localStorage.name;
let doc = window.document;
let header = doc.getElementById('header');
if (typeof contacs === undefined)
header.innerText = JSON.parse(contacs);
let btn = doc.getElementById('btn');
let add = doc.getElementById('add');
// let field = ... | true |
390073024e1f6c4d9ddb99cd1dfb1b8bfa61ad1a | JavaScript | GuillaumeAI/gix-text-miner | /examples/x03-sparser.js | UTF-8 | 1,891 | 3.109375 | 3 | [
"MIT"
] | permissive | var rejectioncontent = require("./rejectioncontent")();
var rejectedWords = rejectioncontent.RejectedWords;
//["a","at","and","on","this","from","the"];
//@STCGoal Understand what Text mining is about
//@STCGoal Preparing Data
var tm = require( 'gix-text-miner' );
var corpus = new tm.Corpus([]);
var data = require(... | true |
6ea168d77573ab8e9953a83681d23310e90c69a8 | JavaScript | scolsen/panswag | /lib/reader.js | UTF-8 | 543 | 2.84375 | 3 | [] | no_license | //swagger reader, responsible for parsing swagger.
const fs = require('fs');
let cwd = process.cwd();
function read(file, signal){
if(signal === 'data'){
//convert to JSON format.
} else if (signal === 'file') {
try{
if(file.match(/\/|\\/)){
let files = fs.readFileSync(file);
return JSON.parse(files); ... | true |
d9dff8600d5ebb1e74ed3fdd11f8ada182bc5ffe | JavaScript | wix-incubator/carmi | /src/annotation-utils.js | UTF-8 | 963 | 2.609375 | 3 | [
"MIT"
] | permissive | const _ = require('lodash');
function omit(node, fields) {
if (Array.isArray(node)) {
return node.map(child => omit(child, fields));
} else if (typeof node === 'object' && node !== null) {
return Object.keys(node).reduce((acc, k) => {
if (!fields.hasOwnProperty(k)) {
acc[k] = omit(node[k], fi... | true |