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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b6e04000bc12862de5db2988258fbf5ce70d994f | JavaScript | PrivateGER/ProjectAulium | /AuliumChain/miner.js | UTF-8 | 1,217 | 2.578125 | 3 | [] | no_license | let socket = require('socket.io-client')('http://localhost:3000');
let blockchain = require("./blockchain");
const { Worker } = require('worker_threads')
function runService(workerData) {
return new Promise((resolve, reject) => {
const worker = new Worker('./miner_core.js', { workerData });
worker.on('message', r... | true |
2f23f709a66e98dcd0a34348921373f73ff0d39c | JavaScript | OmarMAbbasi/Atomize | /routes/api/apiUtils.js | UTF-8 | 1,918 | 2.796875 | 3 | [] | no_license | const { Course, Teacher, Student } = require("../../models");
const indexPayload = array => {
return array.reduce((obj, ele) => {
obj[ele._id] = ele;
return obj;
}, {});
};
const indexIds = array => {
return array.reduce((arr, ele) => {
arr.push(ele._id);
return arr;
}, []);
};
const shapeTeacherResponse... | true |
3f962bf0b9a0e97b113b20506e7303df2734c3f9 | JavaScript | rubani45/docking-undocking | /sketch.js | UTF-8 | 1,423 | 3.296875 | 3 | [] | no_license | var iss, spacecraft;
var hasDocked = false
var bgImg, issImg;
var spacecraftImg1, spacecraftImg2, spacecraftImg3, spacecraftImg4;
function preload(){
bgImg = loadImage("images/spacebg.jpg");
issImg = loadImage("images/iss.png");
spacecraftImg1 = loadImage("images/spacecraft1.png");
spacecraftImg2 = loadImage("im... | true |
de6ac3934e37e1e1a8e802499a8c9944e31fb31e | JavaScript | mdn/interactive-examples | /live-examples/js-examples/atomics/atomics-or.js | UTF-8 | 301 | 3.546875 | 4 | [
"CC0-1.0"
] | permissive | // Create a SharedArrayBuffer with a size in bytes
const buffer = new SharedArrayBuffer(16);
const uint8 = new Uint8Array(buffer);
uint8[0] = 5;
// 5 (0101) OR 2 (0010) = 7 (0111)
console.log(Atomics.or(uint8, 0, 2));
// Expected output: 5
console.log(Atomics.load(uint8, 0));
// Expected output: 7
| true |
4244935bffe0b731a6fe9856ad75c7af446cdf85 | JavaScript | Paskalik/itstep | /Classwork_04.06.2020/script.js | UTF-8 | 2,398 | 2.984375 | 3 | [] | no_license | 'use strict';
$(document).ready(function($) {
let $cards = [
"❤", "❤",
"▲", "▲",
"★", "★",
"⚫", "⚫",
"■", "■"
]
let $start = $('button')
let $pair = 0
let $timer
let $box1 = undefined
let ... | true |
330794930fa48c3323a87cb14df8fd1d2b232f2f | JavaScript | Kate-Harrison-Simon-Gaby/PatternThis | /index.js | UTF-8 | 814 | 2.703125 | 3 | [] | no_license | const redux = require('redux')
const h = require('hyperscript')
const morph = require('morphdom')
const reducer = require('./reducer')
const template = require('./views/template')
const generateBoard = require('./generateBoard')
const firstCharArray = ['0', '1']
const intialState = {
charArray: firstCharArray,
... | true |
5dc5f7dc9967dd1d2a5d13f2982bda4b130c7cd6 | JavaScript | LukeZvada/D-S-Extra-Practice | /scripts/BusinessList.js | UTF-8 | 2,540 | 3 | 3 | [] | no_license | import { useBusiness } from "./BusinessProvider.js";
import { business, nycBusiness, manufacturingBusiness, agentHTML } from "./Business.js";
import { filterNYBusiness, filterManufacturingBusiness, purchasingAgent } from "./BusinessProvider.js";
const contentTarget = document.querySelector("#container")
export const ... | true |
bb581fa794e3120756f1484d0c17c5428e0a597d | JavaScript | FigueirasJuan/Parciales | /9-Parciales/parcial2/7-iteraciones.js | UTF-8 | 919 | 3.71875 | 4 | [] | no_license | //Debemos lograr mostrar un mensaje al presionar el botón 'MOSTRAR'.
function Mostrar()
{
var nota;
var sexo;
var contador = 0;
var promedio;
var contvar = 0;
var suma = 0;
var max;
var min;
while(contador<6)
{
nota = prompt("Ingrese la nota: ");
nota = parseInt(nota);
while(nota>10 || nota<0)
{
nota =... | true |
d409b349db236f3f403ca63d268457842e01c3b6 | JavaScript | mshava/53functions | /reverse.js | UTF-8 | 300 | 3.5625 | 4 | [] | no_license | var reverse = function(word){
var newString = "";
var s = word.length;
while(s > 0){
newString+=word.substring(s-1, s);
s--;
}
return newString;
}
/*
function Reverse(word){
var newString = "";
var x = word.length;
while(x > 0){
newString += word.substring(x-1, x);
x--;
}
return newString;
}
*/ | true |
bfd8aefdf34fdc1559075ea800a0140487fddfe4 | JavaScript | sarah-hillo/animals | /src/components/filtered.js | UTF-8 | 772 | 2.546875 | 3 | [] | no_license | import React from 'react';
import Form from 'react-bootstrap/Form'
import 'bootstrap/dist/css/bootstrap.min.css';
class FilterData extends React.Component {
handleFilter=(event)=>{
event.preventDefault();
let optionData = (parseInt(event.target.value));
this.props.setFilterValue(optionData)
console.log(this.props... | true |
e45d49506839c367a5b77c70db5036cd715f948f | JavaScript | konstantindergachev/openwheelsblog-app | /app/server/graber/graber.js | UTF-8 | 1,838 | 2.78125 | 3 | [] | no_license | const axios = require('axios');
const cheerio = require('cheerio');
const fs = require('fs');
const { catchErrors } = require('../handlers/errorHandlers');
const goForTheNews = async (url) => {
const getData = await axios.get(url);
if (getData.status === 200) {
const html = getData.data;
const $ = cheerio.... | true |
fd56b275954728fac5e5f21ab0f8a29e45db2988 | JavaScript | kevin931203/kevin931203.github.io | /js/website.js | UTF-8 | 197 | 2.640625 | 3 | [] | no_license | function hello() {
alert("我喜歡設計,喜歡在腦中構思新的想法,所以我做網站實現我的想法,用寫程式來撫平我心中過多的憂慮。");
}
console.log(hello()) | true |
42210448b035cfbf2bff70cb7da413e37388509e | JavaScript | igorbronowicki/sluts | /modules/sluts/views.js | UTF-8 | 2,059 | 2.625 | 3 | [] | no_license | var mongoose = require('mongoose'),
Slut = mongoose.model('Slut'),
_ = require('underscore');
/**
* List of sluts
*/
exports.all = function(req, res) {
Slut.find({}, function(err, sluts) {
if (err) {
res.json(200, {
err: "Не получилось достать всех шлюх из БД!"
... | true |
a2819c1e83a8bf37d09d3c72101c74b747696c67 | JavaScript | wudilaobaba/suibi | /Vue项目初始化模板(测试代码使用)/src/testJs/01.js | UTF-8 | 666 | 2.875 | 3 | [] | no_license | // ---------------001-------------
let p = 600
export default p
//一个js文件中只可以导出一个export default
// 引入:(不必引入原始值,写xxxx也可以)
//import xxxx from './01.js' 打印的xxxx为p的值
// --------------002--------------
export const t = 900
export function g() {
console.log(4444);
}
//一个js文件中可以导出多个非default,引入的时候一定要写真实的非defa... | true |
0ad0b700ba0313ffbbadeb2aea01fcdf91326574 | JavaScript | ncj1997/login | /index.js | UTF-8 | 1,192 | 2.546875 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
var mysql = require('mysql');
const port =3000;
const app =express();
// database connection part**************
var con = mysql.createConnection({
host: "localhost",
user: "sahan",
password: "sahan19... | true |
dcad90d6274a0e4b462b24ed89f80777ba82513e | JavaScript | Geeogee/vue-todolist | /js/script.js | UTF-8 | 2,474 | 3.015625 | 3 | [] | no_license | function initVue() {
new Vue({
el: "#app",
data: {
"todos" : [
{
"name" : "todo1",
"done" : false
},
{
"name" : "todo2",
"done" : false
},... | true |
3e34c2f70d525a4710bf2fc460fe1117f439ec44 | JavaScript | bstrellis/React-Todo | /src/components/TodoComponents/TodoList.js | UTF-8 | 523 | 2.96875 | 3 | [] | no_license | // `<TodoList />` receives your Todos array and iterates over the list generating a new `<Todo />` for each element in the array.
import React from 'react';
import './Todo.css'
function TodoList(props) {
return (
<div>
{props.todoArr.map(item => {
return <div className={item.comple... | true |
3bf3c94297f357032c6c1217d0f12bc9da1611d6 | JavaScript | samiashajrawi/high_score_app | /tests/features/ScoresTable.test.js | UTF-8 | 1,686 | 3 | 3 | [] | no_license | /**
Score table test
- It is simple react component which tests react-dom, render, and act
- I chose this test because:
- - It is important part of UI where user can see the scores and real time preview
- - To test react component
*/
import React from 'react';
import { render, unmountComponentAtNode } from "... | true |
1d123a4af77eba8cf71c4d4a43582d4bb11df9d8 | JavaScript | robertux/econopolio | /Econopolio/WebContent/js/dado.js | UTF-8 | 880 | 2.96875 | 3 | [] | no_license | var dadoTossing = false;
var dadoTimer = null;
var dadoCurrent = 1;
var dadoPositionsArr = [0, 50, 100, 150, 200, 250];
function toggleDado(){
if(dadoTossing){
stopAnimDado();
$("#btnAnimDado").val("Lanzar dado");
}
else{
startAnimDado();
$("#btnAnimDado").val("Detener dado");
}
dadoTossing = !dadoToss... | true |
17484cfbd43cf48a81607886994f0492919bf0c2 | JavaScript | Polyak62/external-courses | /task 3/task 3.3.js | UTF-8 | 171 | 2.921875 | 3 | [] | no_license | function checkFild(string,obj) {
return string in obj;
}
var object = {
myProp: 100,
1: 200,
};
var string = "myProp1";
console.log(checkFild(string,object)); | true |
921bb5d096f5cb40d1e7f378fc39c1f01c95436d | JavaScript | danielcruser/limerick | /server/api/favorites.js | UTF-8 | 648 | 2.53125 | 3 | [] | no_license | const router = require('express').Router()
const {Favorite} = require('../db/models')
module.exports = router
router.get('/', (req, res, next) => {
Favorite.findAll()
.then(lines => res.json(lines))
.catch(next)
})
router.put('/', (req, res, next) => {
Favorite.findOrCreate({where: req.body})
.then(fa... | true |
b0b5626b7777e254e0c03ed2f36ecfe7d8e3d7f5 | JavaScript | TanishqSinghAnand/Box-of-Boxes | /Box.js | UTF-8 | 640 | 2.796875 | 3 | [
"MIT"
] | permissive | class Box{
constructor(x, y, width, height){
this.body = Bodies.rectangle(x, y, width, height);
this.width = width;
this.height = height;
World.add(world, this.body);
}
display(){
var pos = this.body.position;
var angle = this.body.angle;
push();
... | true |
515c974a49dbe16d93951345410a3b6dad73120d | JavaScript | HJungIn/FrontEnd_study | /JS 기초/index02.js | UTF-8 | 662 | 4.28125 | 4 | [] | no_license | //let : 변수를 지칭함 : 값을 바꿀 수 있다.
let value = 1;
console.log(value);
value = 2;
console.log(value);
//const : 상수를 지칭함 : 값이 고정적이다. =>바꾸려 하면 에러남(읽기전용이라서)
const a = 1;
//var : 변수를 사용할 때 : but 요즘은 안쓰는 게 좋음
var a = 1;
//==== 문자열일 때 ====
let text = 'hello';
let name = "헬로우 자바스크립트";
//==== 참, 거짓 ====
let good = true;
let lo... | true |
4cec1f1093bb2719da377c86426bb080475b154e | JavaScript | blongz/muddery | /muddery/web/webclient/webclient/utils/utils.js | UTF-8 | 2,822 | 3.28125 | 3 | [
"BSD-3-Clause"
] | permissive |
var utils = {
visual_length: function(str) {
var length = 0;
for (var i = 0; i < str.length; i++) {
var c = str.charCodeAt(i);
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
// single length
length += 1;
}
... | true |
934dd344614851c33c91ad7779ab17085632a62b | JavaScript | kirillovmr/national-park-builder | /Code/npb_node/src/client/WebGL/Math/Vector2.js | UTF-8 | 1,147 | 3.015625 | 3 | [] | no_license | import { vec2 } from "../Libs/gl-matrix";
export class Vector2
{
constructor(x, y)
{
this.x = x;
this.y = y;
}
add(other)
{
if(!(other instanceof Vector2))
{
console.error("Can not add 2 2D vectors. Reason: type mismatch");
return;
}
... | true |
84c00b6c3516a5237c0ca4a5c66afb57ef021dff | JavaScript | beilil81/phpAjax | /js/tp.js | UTF-8 | 495 | 2.5625 | 3 | [] | no_license | $(function(){
$(".publish").click(function(){
var tab = [];
$("[contenteditable]").each(function(){
tab.push( $(this).html() );
});
$.ajax({
url: 'traitement.php',
method: 'POST',
data: {
donnees: tab
},
success: function(msg) {
$(".alert").fadeIn();
$(".successMsg").text(msg);
... | true |
ca0a43d3f1bc5a3f4734c134a9c39a2d163aca62 | JavaScript | joyetapuja/mac-book-pro | /mac-book-pro.js | UTF-8 | 2,150 | 3.53125 | 4 | [] | no_license | function cost(product, productCost){
productPrice(product, productCost)
totalPrice()
}
function memory8Gb(){
cost('memory-8gb', 'memory-cost')
}
function memory16Gb(){
cost('memory-16gb', 'memory-cost')
}
function storage256(){
cost('storage-256', 'storage-cost')
}
function storage512(){
cost... | true |
8708192204900ed24917270591dab828ef1cd386 | JavaScript | Deadweather/Mike-Schutermann-The-Attack-of-the-Green-Capsule | /Assets/My Assets/Scripts/HUD/Timer.js | UTF-8 | 426 | 2.5625 | 3 | [] | no_license | #pragma strict
private var startTime : float;
var textTime : String;
function Start () {
startTime = Time.time;
}
function OnGUI () {
var guiTime = Time.time - startTime;
var minutes : int = guiTime / 60;
var seconds : int = guiTime % 60;
var fraction : int = (guiTime * 100) % 100;
textTime = String.Form... | true |
37e062709a20c3e215e59d306920112259870e48 | JavaScript | ohishikaito/javascript-essence-tutorial-master | /110_Vue/240_FinalApp(Part.6)/end/renderer.js | UTF-8 | 1,187 | 2.71875 | 3 | [] | no_license | import { nodeOps } from './nodeOps.js';
function createVNode(type = '', props = {}, children = '') {
return {
type,
props,
children
}
}
function patch(n1, n2, container) {
let el;
if(n1.type !== n2.type) {
el = n2.el = nodeOps.create(n2.type);
nodeOps.append(container, el);
} else {
... | true |
184f4de48d3a96e21ba5179ebd243ad813e4fd9f | JavaScript | jordipiella/lab-double-dragon-javascript | /player.js | UTF-8 | 7,164 | 2.9375 | 3 | [] | no_license | function Player (name, sprite, row, col) {
this.name= "." + name;
this.nameSimple = name;
this.sprite = sprite;
this.timeAttackPlayer = true;
this.position = {
row: row,
col: col
};
this.step = 0;
this.lifes = 2;
this.lifeBar = 5;
this.direction = "right";
this.drawPlayer = function (numb... | true |
fdea02e21c037619df4f0053552a0de8da11d9d7 | JavaScript | jodaka/Chrome-Toolbar-Bookmark-Button | /settings.js | UTF-8 | 3,094 | 2.578125 | 3 | [] | no_license |
var Settings = (function(){
var self = {};
self.bookmark_icon = (window.localStorage.getItem('toolbar_bookmark_icon'))
? window.localStorage.getItem('toolbar_bookmark_icon')
: 'default';
if (self.bookmark_icon === 'default') {
document.getElementBy... | true |
4f10c99f7ffaaa3f8804fc48273435200388f10c | JavaScript | madieporter/assignments | /exercises/first-server-practice/server.js | UTF-8 | 4,952 | 3.484375 | 3 | [] | no_license | //Server allows you to handle requests
//Servers listen for requests and gives back responses (receptionist at front desk)
//Installation process for any time you create a server
// 1) npm init -y (creates JSON package/file all dependencies are listed, and what node modules are needed)
// 2) npm i express
// 3) touch ... | true |
881c607e95fba8ece074941b226450fc900b48b2 | JavaScript | dannysanchez559/magic8ball_JS | /js/main.js | UTF-8 | 2,683 | 3.515625 | 4 | [] | no_license | let onSwitch = false; // 8BALL IS SET TO OFF BY DEFAULT
const onButton = document.querySelector('#onButton');
const shakeButton = document.querySelector('#shakeButton');
let ballImage = document.querySelector('img');
let randomInt;
const picAmount = 20; // constant for amount of 8ball pics in images
const picNameStart ... | true |
9553bb63ef77199c20d59c345a0d4df1d33c7cf4 | JavaScript | ArjunBEG/cod3wars | /src/6kyu_🟨/c0ns3cut1v3_str1ngs/index.test.js | UTF-8 | 1,523 | 2.515625 | 3 | [] | no_license | const longestConsec = require("./index");
test("fixed tests", () => {
expect(
longestConsec(["zone", "abigail", "theta", "form", "libe", "zas"], 2)
).toBe("abigailtheta");
});
test("fixed tests", () => {
expect(
longestConsec(
[
"ejjjjmmtthh",
"zxxuueeg",
"aanlljrrrxx",
... | true |
1d5d0cda68421e7e1e5c2085f0e9fa6ff15c08da | JavaScript | AbdullahShion/Sell-Mac | /js/main.js | UTF-8 | 2,392 | 3.515625 | 4 | [] | no_license | // memory cost calculation
function getMemorySpecification(price) {
document.getElementById("extra-memory-cost").innerText = price;
}
// total costing calculation
function totalCosting() {
let totalCost =
1299 +
parseFloat(document.getElementById("extra-memory-cost").innerText) +
pa... | true |
fa0aed20ef42a548aee6dc26d59a51268adcb35d | JavaScript | synergy2411/cgi-react | /playground/arrow_func.js | UTF-8 | 1,008 | 3.796875 | 4 | [] | no_license | // // Node installer comes with :
// // - Node Package Manager (npm) - installing the projects developed by community.
// // - Node Runtime Environment - can run JS code
// // - Node Native/Core Modules
// // JavaScript can be run in Browser Environment as well as NRE
// // ARROW FUNCTION
// // ES5 way
// var num... | true |
58be436472050edff95c27a867b74e33b25e70ab | JavaScript | EyadA-G/weatherapp | /App.js | UTF-8 | 3,068 | 3 | 3 | [] | no_license | import React, {useState} from "react";
const api = {
key: "8e6609697ff29376cac963b98e905c70",
base: "https://api.openweathermap.org/data/2.5/",
}
/*fetch (`${api.baseF}forecast?q=${queryF}&units=metric&APPID=${api.key}`)
.then(res => res.json())
.then(result => {
setWeatherF(result);
... | true |
11d0416e87b51925f80d3a1f3d1c255025ed526c | JavaScript | SevenIndirecto/aoc2018 | /d6/index.js | UTF-8 | 3,004 | 3.5 | 4 | [] | no_license | const fs = require('fs');
const input = 'input.txt';
let points = fs.readFileSync(input, 'utf8').trim().split('\n');
points = points.map(point => point.split(', ').map(u => parseInt(u)));
// const points = [[1,1],[1,6],[8,3],[3,4],[5,5],[8,9]];
let maxX = points.reduce((maxX, [x,]) => x > maxX ? x : maxX, 0);
let ma... | true |
347b97ccf043b2eb2e8a9197203fd6bcd6b35d98 | JavaScript | dtryan24/studier | /js/UIHelper.js | UTF-8 | 3,636 | 2.96875 | 3 | [] | no_license | import { CURRENT_STACK,
SAVED_STACKS,
SECOND_INTERVAL,
MINUTE_INTERVAL} from "./constants.js";
/*
Add input row to the popup screen
*/
let addInputRow = () => {
let list = document.getElementById("studierDeck");
let li = document.createElement("li");
li.setAttribute("class", "StudierQuery");
let... | true |
bd847db671145d1e9a6973096025c7aaad4b742c | JavaScript | holyshared/Class.Cache | /Tests/jasmine/spec/class-cache-spec.js | UTF-8 | 1,439 | 3 | 3 | [] | no_license | (function(){
var HashIncluder = new Class({
Cache: 'hash',
fetch: function(criteria){
var cache = this.cache.get(criteria);
if (cache && cache.isLimit() !== false) {
return cache.getContent();
}
var content = {
name: 'foo',
age: 28
}... | true |
a56f12709cb5e29aedca59214e17366b32ff1e00 | JavaScript | craigdallimore/booking | /static/js/Template.js | UTF-8 | 1,766 | 2.546875 | 3 | [] | no_license | (function(App) {
var Template = {
BookingItem: function(JSON) {
function createTD(textContent) {
var td = document.createElement('td');
if(typeof td.textContent !== 'undefined') {
td.textContent = textContent;
} else {
... | true |
4af6439d02d1417c77daed1e3d9bf3b381a6ae7f | JavaScript | Adil-web/Vote | /assets/src/vote.js | UTF-8 | 747 | 2.8125 | 3 | [] | no_license | const vote = async function(URI) {
let promise = await fetch(URI, { method: 'POST', headers: Headers });
if (!promise.ok) {
alert('Ошибка связи с сервером!')
}
location.href = '/results/';
}
const cats = document.querySelector('#id_cats_button');
c... | true |
69f511b17ed6319f52b6993fa8cd02b9ba474ece | JavaScript | iliantova/Telerik-Homework | /Homework_JavaScript_Fundamentals/UsingObjects/1.PlanarCoordinates.js | UTF-8 | 2,905 | 4.21875 | 4 | [] | no_license | /*Problem 1. Planar coordinates
Write functions for working with shapes in standard Planar coordinate system.
Points are represented by coordinates P(X, Y)
Lines are represented by two points, marking their beginning and ending L(P1(X1,Y1), P2(X2,Y2))
Calculate the distance between two points.
Check if three s... | true |
73baa4246ec7f8fc3da09dcbfbaa8bb61aba0735 | JavaScript | demurzasty/cyste.github.io | /SpaceshipOnline/label.js | UTF-8 | 996 | 3.0625 | 3 | [] | no_license | function Label(desc)
{
this.id = desc.id ? desc.id : 'undefined';
this.x = desc.x ? desc.x : 0;
this.y = desc.y ? desc.y : 0;
this.width = desc.width ? desc.width : 0;
this.height = desc.height ? desc.height : ... | true |
552c6d1d569a3f787088954a9462efd727493312 | JavaScript | atsvetkova7/fastfood_native | /js/app/FastfoodDA.js | UTF-8 | 3,348 | 2.828125 | 3 | [] | no_license |
class FastFoodDA {
constructor(){
this.fastFood = firebase.database().ref().child("fastFood");
this.storage = firebase.storage();
}
setFoodPoint( objPoint ) {
this.fastFood.push({
name : objPoint.name,
adres... | true |
133e332813ef347a28308870e4915f81e8099286 | JavaScript | MAshrafM/CodingTrain_CC | /public/CC/36_Bloppy/sketch.js | UTF-8 | 540 | 3.203125 | 3 | [
"CC0-1.0"
] | permissive | // globals
var yoff = 0.0;
// constant
const SCREEN_SIZE = 400;
// Setup
function setup() {
createCanvas(SCREEN_SIZE, SCREEN_SIZE);
}
// Draw
function draw(){
background(0);
translate(width/2, height/2);
let radius = 150;
beginShape();
xoff = 0;
for(let angle = 0; angle < TWO_PI; angle += 0.1){
l... | true |
529b94b3fbf58f38bb253f1d4566df5b5d2bd773 | JavaScript | jamestomasino/jsberry | /org/incrediberry/display/Color.class.js | UTF-8 | 6,105 | 2.84375 | 3 | [] | no_license | (function() {
"use strict";
var Color = my.Class( {
STATIC: { },
constructor: function( r, g, b, h, s, v, l, y, c ) {
this.r = r || 0;
this.g = g || 0;
this.b = b || 0;
this.h = h || 0;
this.s = s || 0;
this.v = v || 0;
this.l = l || 0;
this.y = y || 0;
this.c = c || 0;
},
getHex... | true |
2749decf7ffcfc3263fa57875bc1d08ebdbdefe7 | JavaScript | CuiYanchang-Github/Web | /node全栈/dayone/test-04.js | UTF-8 | 336 | 2.59375 | 3 | [] | no_license | var firecount=0;
var start=new Date();
//function 有return叫函数 没有return叫过程
var timer=setInterval(function(){
if(new Date-start>1000){
clearInterval(timer);
console.log(firecount);
return
}
firecount++;
},0);
//CPU时钟中断
//延时方法 setTimeout setInterval process.nextTick() requestAniamtionFrame | true |
4a3af7f8e9e2c3548705b918e6ea378a172c4d73 | JavaScript | solenee/distributional-analysis | /histogram-cluster/hist.js | UTF-8 | 3,930 | 3.0625 | 3 | [] | no_license | // logy(x)
function getBaseLog(x, y) {
return Math.log(x) / Math.log(y);
}
function histogram(jsonData) {
var margin = {top: 70, right: 100, bottom: 150, left: 200},
width = 620 - margin.left - margin.right,
height = 520 - margin.top - margin.bottom,
padding = 30;
var scoreScale = d3.scale.linear()
... | true |
c9df429bf0c497da7d1f4707bd4123ba09f5ae14 | JavaScript | Kaowebdesign/ginger.base | /themes/airspace-hugo/assets/js/script.js | UTF-8 | 2,646 | 2.515625 | 3 | [
"MIT"
] | permissive | // Preloader js
$(window).on('load', function () {
$('.preloader').fadeOut(100);
});
//basic functions
$(document).ready(function () {
'use strict';
let nav = $('.nav'),
navButton = $('.nav__icon'),
navLink = $('.nav__link');
navButton.on('click',function(e){
e.preventDefault();
$(this).closest(nav... | true |
b6c7a7224f8c56d3fc4d300de101d6afbd71848b | JavaScript | nss-day-cohort-14/static-web-javascript-quiz-timcreasy | /js/app.js | UTF-8 | 1,910 | 4.03125 | 4 | [] | no_license | // ==================== HTML ELEMENTS TO MANIPULATE =======================
// Get user input for height
var heightInput = document.getElementById("heightInput");
// Get user input for char
var charInput = document.getElementById("charToUse");
// Button element
var button = document.getElementById("inputButton");
var... | true |
5b6ddcf5dd4e834bd43d82fa47f92b603c93859f | JavaScript | joelaaronross/UserGet | /js/UserGet.js | UTF-8 | 596 | 2.53125 | 3 | [] | no_license | $().ready(() => {
$.getJSON("http://localhost:8080/Users/Get/1")
.then((resp) => {
console.log(resp);
render(resp.data);
});
});
function render(users) {
$("#pid").val(users.id);
$("#pname").val(users.firstName + " " + users.... | true |
38cf75a4d1bbbaaf30cc15c9aaec517c73b1314b | JavaScript | RickySauce/BeerReview-REACT | /client/src/reducers/userReducer.js | UTF-8 | 817 | 2.53125 | 3 | [
"MIT"
] | permissive | export default function userReducer(state = {user: ''}, action) {
switch (action.type) {
case 'SIGN_UP':
return {user: action.user};
case 'LOG_IN':
return {user: action.user};
case 'LOG_OUT':
return {user: ''}
case 'ADD_REVIEW':
return {
user: {
...state.user,... | true |
5e233edb27dc51a95f4496626a02693e3b2ec686 | JavaScript | priya-khanna/react-notetaker | /app/App.js | UTF-8 | 1,075 | 2.75 | 3 | [] | no_license | // Instead of rendering static Main component, we will render Root component.
// When route will change, router will run and pass component we want to render. We wil define Root inside routes.js
import React from 'react';
import ReactDOM from 'react-dom';
import { Router, History } from 'react-router';
import routes f... | true |
144b22697fbf8fc654fca39b19d05b8737df04d6 | JavaScript | kungfu-monkey/Supernova | /Supernova/projects/ui/Apps/TVControl/TVControl_PKG/web/images/tv.js | UTF-8 | 954 | 2.53125 | 3 | [] | no_license | function SetChannel(str){
sendPost("SetChannel", str);
return false;
}
function SetVolume(str){
sendPost("SetVolume", str);
return false;
}
function PressButton(str){
sendPost("PressButton", str);
return false;
}
function SwitchSource(){
sendPost("SwitchSource", "");
return false;
}
func... | true |
27c1e0c851e8593f3662a1c928bd857fcc2f6d23 | JavaScript | jseijas/flow-bot | /src/smart/wolfram.js | UTF-8 | 3,294 | 2.6875 | 3 | [
"MIT"
] | permissive | import request from 'request';
import xml2js from 'xml2js';
class Wolfram {
constructor(apiKey) {
this.apiKey = apiKey;
}
query(input, cb) {
if (!this.apiKey) {
return cb('Wolfram key not set');
}
let uri = 'http://api.wolframalpha.com/v2/query?input='
+ encodeURIComponent(input) + '... | true |
8cd66d99763fb989e40fa570c70b719b82399ad4 | JavaScript | sx5640/wdi-march-2016 | /22-oop-in-javascript/employee.js | UTF-8 | 851 | 3.65625 | 4 | [] | no_license | function Employee() {
this.name = '';
this.dept = 'general';
}
// newEmployee = new Employee();
function Manager() {
// `this` is an object of type Manager
Employee.call(this);
this.reports = [];
}
Manager.prototype = Object.create(Employee.prototype);
function WorkerBee() {
// `this` is an object of... | true |
8502b4857ac2e48d062e30d437d9dee29d0d3f5d | JavaScript | croat25/todo-api | /variable-playground.js | UTF-8 | 317 | 3.53125 | 4 | [] | no_license | var person={
name:'andrew',
age:21
}
function updateperson(obj){
// obj={
// name:'andrew',
// age:24
// }
obj.age=24;
}
updateperson(person);
console.log(person);
var grades=[21,41];
console.log(grades);
function updategrades(obj){
debugger;
grades.push(obj);
}
updategrades(45);
console.log(grades); | true |
beeee1ffe7f64ee10e109c05881b45ade510ee5b | JavaScript | OBLMFGJE/connect-api-examples | /connect-examples/v2/node_orders-payments/models/catalog-item-variation.js | UTF-8 | 2,882 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | /*
Copyright 2019 Square Inc.
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 applicable law or agreed to in writing, software
dis... | true |
629a2bd3d24a9bac0c10450669e8d618ccd2649c | JavaScript | kalebecalixto/webEntregas | /webEntregas/public_html/modelos/ADI_Bin/rotinasJS/contabilidade/statusContabilidade.js | ISO-8859-1 | 5,146 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | <!-- /ADI_Intranet_Root/ADI_Programacao/ADI_Bin/rotinasJS/contabilidade/statusContabilidade.js -->
/**
* Verifica o status do ms da contabilidade
*
* @version 1.0 06/10/2007
* @author lucas hermano
* @param exercicioStatusContab conter o sequencial do ano para busca do status
* @param codMesStatusContab ... | true |
a991b56fe6d6627df211d8d63783f53ac5d4962c | JavaScript | imagineLife/nodeWork | /misc/vm/index.js | UTF-8 | 417 | 3.171875 | 3 | [] | no_license | /*
NODE VMs
https://nodejs.org/api/vm.html#vm_vm_executing_javascript
...enables running js (+ more?!) in a v8 VM 'context'
*/
var vm = require('vm');
// Define a context for the script to run in
var context = {
'foo' : 25
};
// Define the script
var script = new vm.Script(`
foo = foo * 2;
var bar = foo + ... | true |
fa2de23bf355bd969cc542563943e0b40bef2838 | JavaScript | VladSerebro/CleaningCompany | /public/js/main.js | UTF-8 | 1,178 | 2.609375 | 3 | [] | no_license | $(document).ready(function(){
const bookings = document.getElementById('bookings');
const cities = document.getElementById('cities');
const cleaners = document.getElementById('cleaners');
const customers = document.getElementById('customers');
if(bookings)
deleteEntity(bookings, '/admin/bo... | true |
cd054eb8a0fde1da0e6b985689d8521676997ae5 | JavaScript | NielzosFilms/Bit-Internship-Map | /backend/generation/generateSchema.js | UTF-8 | 5,792 | 2.53125 | 3 | [] | no_license | const path = require("path");
const dotenv = require("dotenv");
const pluralize = require("pluralize");
dotenv.config();
const sequelize = require(path.join(__dirname, "../../models/index"));
const models = sequelize.sequelize.models;
const { convertDataTypeToGraphql, LCFirst } = require("./utils");
const fs = require... | true |
20b01573face370e56da6bcaa4a009d3c384af45 | JavaScript | seterry/CMNHdemoAdventure | /TextBalloon.js | UTF-8 | 3,685 | 3.265625 | 3 | [] | no_license | //
// Text Balloon
// CMNH
//
var TextBalloon = function () {
// Constructor
this.dialogColor = "#ffff44";
this.dialogFont = "18px Arial";
this.normalColor = "#ff0044";
this.highlightColor = "#00ff44";
this.choiceFont = "18px Arial";
this.balloonColor = 0xffd900;
this.dialog = ""
this.choices = [];
this.arr... | true |
ab38658c85008b09399aaba69fc83beba32be681 | JavaScript | BersnardC/simple-list-api | /server/controllers/tasks.controller.js | UTF-8 | 1,060 | 2.78125 | 3 | [] | no_license | const Tasks = require('../models/tasks.model');
const tasksCtrl = {};
tasksCtrl.getTasks = async (req, res) => {
const tasks = await Tasks.find()
console.log('Get tasks')
res.json(tasks);
};
tasksCtrl.createTask = async (req, res) => {
try {
const task = new Tasks(req.body)
await task.save();
res.j... | true |
2c5876a74a5d837892dd15814c93c0194f3c7701 | JavaScript | MrJoshua2282/eTheater | /src/pages/MovieDetails/MovieDetails.js | UTF-8 | 2,056 | 2.5625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import { useParams, NavLink } from 'react-router-dom';
import './MovieDetails.scss';
import Default from '../../assets/img/default_poster.jpg';
export default function MovieDetails() {
// FYI: I usually keep 'keys' in env
const key = 'a7931d23';
const { id } ... | true |
d2a703cac540d5a72daa81185c9f564c21d52f24 | JavaScript | stand1/- | /Stone_six/CLIENT-MINI/pages/personnalPhotoLib/personnalPhotoLib.js | UTF-8 | 2,452 | 2.765625 | 3 | [] | no_license | Page({
/**
* 页面的初始数据
*/
data: {
noramalData: [{
"Cover": "http://dashus.oss-cn-shenzhen.aliyuncs.com/DefaultImage/Game/20190306144842/1001.png",
"CoverHeight": 467,
"CoverWidth": 350
},
{
"Cover": "http://dashus.oss-cn-shenzhen.aliyuncs.com/DefaultImage/Game/2... | true |
f838c10f4ffbd26f9937767db0c96e990e648f41 | JavaScript | dhyana1984/.net-leetcode | /LeetCodeDotNetCore/LeetCodeDotNetCore/Greedy/Easy/WaterBottles.js | UTF-8 | 939 | 3.5625 | 4 | [] | no_license |
/**
* 1518
* 小区便利店正在促销,用 numExchange 个空酒瓶可以兑换一瓶新酒。你购入了 numBottles 瓶酒。
如果喝掉了酒瓶中的酒,那么酒瓶就会变成空的。
请你计算 最多 能喝到多少瓶酒。
示例 1:
输入:numBottles = 9, numExchange = 3
输出:13
解释:你可以用 3 个空酒瓶兑换 1 瓶酒。
所以最多能喝到 9 + 3 + 1 = 13 瓶酒。
*/
var numWaterBottles = function (numBottles, numExchange) {
let ful... | true |
73b473ff3dac547c13e2d134eea7c0a3e08fb02a | JavaScript | gletorney/vue-img-optimizer | /js/main.js | UTF-8 | 4,473 | 2.65625 | 3 | [] | no_license | // @gletorney
window.addEventListener('DOMContentLoaded', function() {
var Vue = window.Vue;
var URL = window.URL || window.webkitURL;
var ImageCompressor = window.ImageCompressor;
var vm = new Vue({
el: '#app',
data: function() {
return {
options: {
maxWidth: undefined,
... | true |
8a0cfaade7e80c0f198b18c670267462644bc627 | JavaScript | bian1992518/h5-ypyg-react-redux- | /h5/components/addressBottomView.js | UTF-8 | 2,795 | 2.5625 | 3 | [] | no_license | /**
* Created by zhangheng on 2016/8/1.
*
* 編輯地址界面 省市县 选中地址
*/
import React from "react";
import itemStyles from "../styles/addressItemStyles";
export default class AddressBottomView extends React.Component {
constructor(props) {
super(props);
this.state = {
listState: this.pr... | true |
0dd0713657d048212746d75e439ae53b12e62ad5 | JavaScript | mnurik/monitoring-channels | /src/reducers/current.js | UTF-8 | 1,289 | 2.515625 | 3 | [] | no_license | import * as actionTypes from './../constants/actionTypes'
export const initialState = {
id: null,
group: '',
checkCount: '',
frequency: '',
name: '',
channelItems: [{ id: null, ip: '', port: '', type: 1 }]
}
export default (state = initialState, action) => {
switch (action.type) {
case actionTypes.E... | true |
80cc8ae0f6bbe1b1734a09b23d22654b1169eead | JavaScript | Lukas-Mul/Volebni-Kalkulacka | /gameGender.js | UTF-8 | 5,808 | 2.78125 | 3 | [] | no_license | const timeoutSign = document.querySelector(".timeoutSign");
const questionContainer = document.querySelector(".question-container");
const questionContainerMuz = document.querySelector(".question-container-muz");
const restartDiv = document.querySelector(".restartDiv");
const continueDiv = document.querySelector(".cont... | true |
95e6cddf94666c0921a88bd8253dc30cb0d8f08d | JavaScript | OliverLeitner/webcomponentsandmore | /server.js | UTF-8 | 1,405 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | const express = require('express')
const app = express()
const path = require('path');
// global vars from node
var amqp = require('amqplib/callback_api');
// submit data to rabbitmq
function submitToRabbitMQ(data) {
amqp.connect('amqp://demo:123@rabbitmq.localnet', function (error0, connection) {
if (err... | true |
1a4813c02e7b1d89b131bf7ffba3540f0dc58b41 | JavaScript | martinbutler/fullstackOpensDoors | /servo/wifi.js | UTF-8 | 3,566 | 2.78125 | 3 | [] | no_license | /* the wifi-cc3000 library is bundled in with Tessel's firmware,
* so there's no need for an npm install. It's similar
* to how require('tessel') works.
*/
var wifi = require('wifi-cc3000');
var network = 'FullstackFast' // put in your network name here
var pass = 'Fullst@ck'; // put in your password here, or leave... | true |
4f79ae5b7bac7e319ac063f1a7de8b5bb39856fb | JavaScript | ndrishinski/js-challenges | /10-1-19.js | UTF-8 | 310 | 4.03125 | 4 | [] | no_license | // Given an array, find the int that appears an odd number of times.
// There will always be only one integer that appears an odd number of times.
function findOdd(a) {
for (let i = 0; i <a.length; i++) {
let arr = a.filter(item => item == a[i])
if (arr.length % 2 != 0) return a[i]
}
} | true |
ea0d4b8e09c9fe4484a6a1b9d4d53ff766316b69 | JavaScript | aminbabar/W9D1 | /src/asteroid.js | UTF-8 | 708 | 2.65625 | 3 | [] | no_license |
const MovingObject = require("./moving_object");
const Util = require("./utils.js");
function Asteroid(options) {
let color = ["green", "pink", "gold", "blue", "orange"]
options.color = color[Math.floor(color.length * Math.random())];
options.pos = options.pos || [0, 0];
// random bww 0 and 10 Math.... | true |
57a5c16fad1d55ad4de8cbb3c8dada0331f9a2ba | JavaScript | nirtamir2/patroll | /src/services/location.service.js | UTF-8 | 583 | 3.171875 | 3 | [] | no_license | function getDistance(latLng1, latLng2) {
const R = 6370.981162;
const dLat = toRad(latLng2.lat - latLng1.lat);
const dLon = toRad(latLng2.lng - latLng1.lng);
const lat1 = toRad(latLng1.lat);
const lat2 = toRad(latLng2.lat);
const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
Math.sin(dL... | true |
7b76f502d1e9125f2f193318ab173de1b92495ee | JavaScript | edvas314/deusvult | /bot.js | UTF-8 | 12,921 | 2.796875 | 3 | [] | no_license | const Discord = require('discord.js');
const fs = require('fs')
const bot = new Discord.Client();
const cron = require('cron');
const responses = fs.readFileSync('responses.txt').toString().split("\r\n")
const atresponses = fs.readFileSync('atresponses.txt').toString().split("\r\n");
var deus_counts = parseInt(... | true |
22d94f4070a74746ed6164e1366b39ba599bf227 | JavaScript | Nedu/expensesapp | /client/src/App.js | UTF-8 | 2,816 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Route } from 'react-router-dom';
import axios from 'axios';
import Home from './Components/Home/Home';
import Expenses from './Components/Expenses/Expenses';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {... | true |
a407b87152b11d0624e6d6bcf4aba644250a15cf | JavaScript | israelBuskila/Movies-Subscription-management. | /Client/src/Components/EditMember.js | UTF-8 | 1,208 | 2.53125 | 3 | [] | no_license | import axios from "axios";
import { useState } from "react";
const EditMember = (props) => {
const [name, setName] = useState(props.member.Name);
const [email, setEmail] = useState(props.member.Email);
const [city, setCity] = useState(props.member.City);
const updateButton = async () => {
let obj = {
... | true |
bf3bdb0b44f20c369f5c39a7f6ce8b32081c6c81 | JavaScript | heroku/cli | /packages/orgs-v5/lib/utils.js | UTF-8 | 2,446 | 2.578125 | 3 | [
"ISC"
] | permissive | let _ = require('lodash')
let cli = require('heroku-cli-util')
let error = require('./error')
let getOwner = function (owner) {
if (isteamApp(owner)) {
return owner.split('@herokumanager.com')[0]
}
return owner
}
let isteamApp = function (owner) {
return (/@herokumanager\.com$/.test(owner))
}
let isVali... | true |
3c35ffa3ff42f517b22e393fd8ad07d38bdee027 | JavaScript | Jack5079/bad-keyboard | /keyboard.js | UTF-8 | 1,441 | 3.4375 | 3 | [] | no_license | const keys = Array(5000).fill(0).map((_, i) => String.fromCharCode(i)).splice(33)
//`\`1234567890-=\!@#$%^&*()_+|qwertyuiop[]QWERTYUIOP{}asdfghjkl;'ASDFGHJKL:"zxcvbnm,./ZXCVBNM<>?`.split('')
const keycont = document.getElementById('keys')
const align = ['left', 'right', 'center']
const random = {
/**
* @param {... | true |
f2e7c5eac90b749de4f86d177aa6fd20ccb107f1 | JavaScript | tfshockness/nodejs_learning | /server.js | UTF-8 | 1,080 | 2.609375 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const config = require('./src/lib/config');
const { todoController, homeController } = require('./src/lib/routers');
// const todoRoute = require('./src/controller/todoController');
// const homeRoute = require('./src/controller/homeControl... | true |
620234c0795cb6b1b677669b6f13dc7a19b16555 | JavaScript | mihalik/react-storybook-addon-docgen | /dist/components/generateMarkdown.js | UTF-8 | 2,152 | 2.796875 | 3 | [
"MIT"
] | permissive | /**
* Copyright (c) 2015, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* DM: This was base... | true |
8639c200582a43c06b42c9157ed37367bf19613a | JavaScript | frogr/Testing | /basic-javascript/tests/project-1.test.js | UTF-8 | 13,482 | 3.234375 | 3 | [] | no_license | const chai = require('chai');
const assert = require('chai').assert;
const funcs = require('../src/project-1');
const expect = chai.expect;
// we've gone ahead and gotten a start here for you,
// except, for some reason, none of our current assertions are working.
// first step is to make sure all these assertions wo... | true |
3b3cae00308352f3c11bd1ccae2edf5264f38fa3 | JavaScript | kevinsosborne/Algorithms | /Chapter 6 - Queues and Stacks/CirQueue: isEmpty.js | UTF-8 | 979 | 4.1875 | 4 | [] | no_license | // Return whether queue is empty
class Queue{
constructor(cap){
this._storage = [];
this._start = 0;
this._end = 0;
this._capacity = cap;
this._storage.length = cap;
}
Enqueue(val){
if(this._end < this._storage.length){
this._storage[this._end] = val... | true |
7da9e83456d4a6f36a6fb8a54c9e10c818f1f5ad | JavaScript | petarcmarinov97/SoftUni-JavaScript | /JS-Application/SinglePageApplication-Exercise/02.Movies/app.js | UTF-8 | 1,715 | 2.6875 | 3 | [] | no_license | import { addMovieView } from './pages/addMovie.js';
import { guestHomeView,userHomeView } from './pages/home.js';
import { loginView } from './pages/login.js';
import { registerView } from './pages/register.js';
import { getAllMovies, logInUser, registerUser } from './requests.js';
async function setup(){
if(local... | true |
ba85c07c837a372595a0850070d154c504b2b555 | JavaScript | Oreki13/ark-week1 | /2/1.js | UTF-8 | 127 | 2.765625 | 3 | [] | no_license | var nilai = "makams";
function vhk (kata) {
return kata == kata.split('').reverse().join('');
}
console.log(vhk(nilai)); | true |
357b2cae42dbdb1af28c6e28f65512d122b62377 | JavaScript | alaj/crud-helper | /test.js | UTF-8 | 800 | 2.53125 | 3 | [] | no_license | const CrudHelper = require('./index')
const crud = new CrudHelper({
key: 'id',
save:(v)=>{
console.log(`save ${JSON.stringify(v)}`)
return v
},
delete:(v)=>{
console.log(`delete ${JSON.stringify(v)}`)
return v
}
})
crud.setDataSource([
{
id:1,
att... | true |
2428a8afa1efff44cd020a79ee4a76a85ac2b5c4 | JavaScript | tbwilson89/portfoliov2 | /src/components/projects/testmoving.js | UTF-8 | 5,468 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react'
import cardInfo from './cardgame/database/cardinfo'
import Card from './cardgame/card'
export default class testMove extends Component {
constructor(props){
super(props)
this.state = {
sectionOne: [
{
dragging: false,
x: 0,
y... | true |
78f55dfe0b9556f5e7d21a06fe3a820f8d83edf5 | JavaScript | wxmbaobao/react-demo | /src/demo/App1.js | UTF-8 | 3,266 | 3.015625 | 3 | [] | no_license | import React from 'react';
import { userInfo } from 'os';
// import logo from './logo.svg';
// import './App.css';
// function App() {
// return (
// <div className="App">
// <header className="App-header">
// <img src={logo} className="App-logo" alt="logo" />
// <p>
// Edit <code... | true |
fe7577e7a4616f5aeb7f070ff48f17bcc2fcda9f | JavaScript | nanno-nanno/MidsummerSite | /scripts/main.js | UTF-8 | 5,752 | 2.859375 | 3 | [] | no_license | /*jslint browser: true*/
/*global $*/
$(document).ready(function(){
function Contestant(cname, cscore1, cscore2, cscore3) {
this.name = cname;
this.score1 = cscore1;
this.score2 = cscore2;
this.score3 = cscore3;
this.total = function() {
return Number(this.sc... | true |
8497875959159c0793e295ef4af75f0a5e4a4bbe | JavaScript | idea-co/ideaco | /resources/js/elements/home.js | UTF-8 | 4,683 | 2.765625 | 3 | [
"MIT"
] | permissive | current_slide = 1 //initial slide position
//listen to click events on slide arrow and trigger the next slide
$(document).on("click", ".block__section4__cont__slider .left_arrow", function(){
minusSlides();
});
//listen to click events on slide arrow and trigger the next slide
$(document).on("click", ".block__section... | true |
41ee274ce163a242a6f826cea7fb26caf01c5f02 | JavaScript | cajacko/viki-bell-website | /scripts/migration/saveTags.js | UTF-8 | 952 | 2.65625 | 3 | [] | no_license | /* eslint no-console: 0 */
import { parseString } from 'xml2js';
import { readFileSync } from 'fs';
import { join } from 'path';
import parseWordpressXml from './parseWordpressXml';
import saveTag from './saveTag';
const xml = readFileSync(join(__dirname, 'data-2017-07-13.xml'), 'utf8');
function saveTagLoop(items, ... | true |
0779ca7df824677771f02da4bab6763a357ac53f | JavaScript | fireflylearning/pattern-library | /blocks/core/ff_module/ff_module-progress/_src/_ff-module-progress-template.jsx | UTF-8 | 2,668 | 2.53125 | 3 | [] | no_license | 'use strict';
var React = require('react');
module.exports = React.createClass({
displayName: 'Progress',
getCompletedWidth: function() {
return {width: Math.floor(((this.props.completedBy / this.props.sentTo) - (this.props.marked / this.props.sentTo)) * 100)+'%'};
},
getMarkedWidth: function() {
re... | true |
636c47c382a6e04c39a979e1f66793e9fe83db8b | JavaScript | Dicir/bitebank | /index.js | UTF-8 | 406 | 2.734375 | 3 | [] | no_license | import { Cliente } from "./Cliente.js"
import { ContaCorrente } from "./ContaCorrente.js"
const cliente1 = new Cliente("Ricardo", 11122233309)
const contaCorrenteRicardo = new ContaCorrente(1001, cliente1)
contaCorrenteRicardo.depositar(500)
contaCorrenteRicardo.sacar(100)
const contaPorrenteRicardo = new ContaPoupa... | true |
1af4d1dd9c9e9d71c5f77bf4b40896dc429a5b14 | JavaScript | xXD4rkC0d3rXx/cocoscreator3-zjt | /engine/bin/.cache/dev/preview/transform-cache/fs/cocos/core/math/utils.js | UTF-8 | 8,425 | 2.71875 | 3 | [
"MIT"
] | permissive | System.register("q-bundled:///fs/cocos/core/math/utils.js", [], function (_export, _context) {
"use strict";
var _d2r, _r2d, EPSILON, random;
/**
* @en Tests whether or not the arguments have approximately the same value, within an absolute<br/>
* or relative tolerance of glMatrix.EPSILON (an absolute tol... | true |
53b7396849fef5469f57d0fc1e29f542350562cb | JavaScript | nojas01/FitExpressJS | /calculations/distance.js | UTF-8 | 1,634 | 3.0625 | 3 | [] | no_license | // formula source: https://www.geodatasource.com/developers/javascript
const models = require('../models')
const env = process.env.NODE_ENV || 'development';
const config = require(__dirname + '/../config/config.json')[env];
const Sequelize = require('sequelize');
const sequelize = new Sequelize(config.databas... | true |
faf470e76e4204f088edf6d34e1d8c63937893a4 | JavaScript | dpatel38/Win_class | /week2/note-card-firebase-project/notepad-app/src/components/Board.js | UTF-8 | 2,902 | 2.71875 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
import '../css/Board.css';
import Note from './Note';
import myFirebase from '../utility/MyFirebase';
const GENERIC_NOTE_TITLE = "New Note Title", GENERIC_NOTE_BODY = "New Note Body";
class Board extends Component {
constructor() {
super();
this.state = {
notes: ... | true |
26b3171b4414fe7e829a312fcbfeb2abbd77f8b9 | JavaScript | brunocarvalhodearaujo/order-book | /src/routes/Orders.js | UTF-8 | 1,643 | 2.765625 | 3 | [] | no_license | const express = require('express')
const BitValor = require('../adapters/BitValor')
module.exports = class Orders {
constructor () {
this.bitvalor = new BitValor()
}
/**
* @api {GET} /orders recupera as informações de ofertas de todas as exchanges
* @apiName GetOrders
* @apiGroup Orders
*
* @... | true |