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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
e5ce7ed8d83be1306bc5d3ac56bcc47f64c76427 | JavaScript | stephanie-gredell/JazzMIDIBridge | /js/example5-random-sequence.js | UTF-8 | 4,083 | 3 | 3 | [] | no_license | /*!
* copyright 2012 abudaan http://abumarkub.net
* code licensed under MIT
* http://abumarkub.net/midibridge/license
*
*
* example of how you can send Javascript generated MIDI events to a MIDI output
*
* dependecies:
* - JazzMIDIBridge.js
* - MIDIDeviceSelector.js
*
*/
window.ad... | true |
65de27f51fd535433e49b73ec68852669269074f | JavaScript | gaomengluo/verification | /index.js | UTF-8 | 2,421 | 2.9375 | 3 | [] | no_license | let c = document.getElementById('c'),
ctx = c.getContext('2d'),
p = document.getElementById("puzzle"),
pctx = p.getContext("2d"),
slider = document.getElementById("slider"),
pos = {x: null, y: null},
delta = 5,
s = {
size: 70,
refresh: drawCaptcha
};
let img = new Image... | true |
f05e8881abb32be660a41bdf5f451b6ac6f3748c | JavaScript | emersonbarrion/mean | /server.js | UTF-8 | 873 | 2.578125 | 3 | [] | no_license | var http = require("http"),
mongojs = require("mongojs");
var uri = "mongodb://localhost:27017/hbfc",
db = mongojs.connect(uri, ["players"]);
function requestHandler(request, response) {
response.writeHead(200, {"Content-Type": "text/html"});
db.players.find({"name": "emerson"}, function(err, records) {
i... | true |
4a8b31b62ea890c38d5e8e6fe7432ebd888b56b6 | JavaScript | gshaver82/OfMonstersAndMen | /assets/js/script.js | UTF-8 | 13,655 | 2.515625 | 3 | [] | no_license | //Backup API key for n2yo.com
// https://www.n2yo.com/rest/v1/satellite/above/41.702/-76.014/0/70/18/&apiKey=589P8Q-SDRYX8-L842ZD-5Z9
//picture of ISS from NASA site. free to use https://images.nasa.gov/
// "NASA should be acknowledged as the source of the material.""
//pic of ISS
//https://images-assets.nasa.gov/imag... | true |
c08e8e28a0b8e30f9e3fbac6bfaa3c9c3aa3dc75 | JavaScript | 13192323927/yiwugou | /1912/node/02/houtai/common.js | UTF-8 | 12,655 | 3.5 | 4 | [] | no_license | /*
* @Description: 生成随机颜色randomColor(type)
* @Author: Haowei
* @Date: 2019-07-23 16:06:57
* @LastEditTime: 2019-07-23 19:18:04
* @LastEditors: Please set LastEditors
*/
function randomColor(type) {
var result = '';
if (type == 'rgb') {
// function randNumColor() {
// var n = parseInt(M... | true |
9d5ce72faa3e929e504c495b946101e3b77b2d6f | JavaScript | ommish/dungeon-hop | /js/ground.js | UTF-8 | 1,022 | 2.734375 | 3 | [] | no_license | const Space = require('./space.js');
class Ground {
constructor(i, ctx, path) {
this.playerNumber = i;
this.ctx = ctx;
this.path = path;
}
drawGround() {
this.path.spaces.forEach((space) => {
if (space.dx >= -90 && space.dx <= 500) {
if (!space.tile) {
space.setObjectImag... | true |
83b76660d5f549adaee5e1b091fa98f69a47adb7 | JavaScript | jiangshide/g2 | /src/geom/shape/interval.js | UTF-8 | 9,295 | 2.5625 | 3 | [
"MIT"
] | permissive | /**
* @fileOverview interval shapes
* @author dxq613@gmail.com
* @author sima.zhang1990@gmail.com
* @author huangtonger@aliyun.com
*/
const Util = require('../../util');
const Shape = require('./shape');
const PathUtil = require('../util/path');
const Global = require('../../global');
// 获取柱状图的几个点
function getRe... | true |
2030c3993b1cd199add28eba71c98b37b04adda2 | JavaScript | abrar997/crazy-file | /src/axios/image/image.js | UTF-8 | 686 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import axios from 'axios';
export class image extends Component {
state={
photo:[]
}
componentDidMount() {
axios.get("https://jsonplaceholder.typicode.com/photos").then((res) => {
console.log(res.data);
this.setState({
photo: res.data,
}... | true |
d7474580f59bce4e855d2303c27ef5a9a20e0e81 | JavaScript | Muyanfm/PGPIProyecto | /Django/PFG/ServiSaco/templates/GestionPedidos/javascript.js | UTF-8 | 3,214 | 2.734375 | 3 | [] | no_license | var popUp = "<div id='PopUpContainer'> \
<div id='PopUp'> \
<h3>¿Seguro que desea eliminar el pedido con id '<span></span>' ?</h3> \
<div id='PopUpBtns'> \
<a id='PopUpSi'>Sí</a> \
<a id='PopUpNo'>No</a> \
... | true |
72532f59fb19f7d7a236eec184a3920511de4a3c | JavaScript | vueZZ/vue-admin | /src/lib/utils/index.js | UTF-8 | 2,087 | 2.875 | 3 | [
"MIT"
] | permissive | const utils = {
/**
* 日期时间格式化
*/
formatDate (fmt, date) {
if (!(date instanceof Date)) {
return date
}
const o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds(),
'q+': Math.floor(... | true |
8240c574437b72073e7a4877bee21e2032c2372e | JavaScript | Asheepun/site-asheepun | /public/old_projects/abb/js/engine/factories/vector.js | UTF-8 | 2,741 | 3.390625 | 3 | [] | no_license | const vec = (x = 0, y = 0) => {
const that = {
x,
y,
mag: Math.sqrt(x*x + y*y),
};
//cascading mutation methods
that.set = (x, y) => {
that.x = x;
that.y = y;
that.mag = Math.sqrt(x*x + y*y);
}
that.add = (v) => {
if(typeof v === "number... | true |
8bf4f95d6ce86d84c86b089a66dfaa713664d1ee | JavaScript | RoyJustinWayne/WSU-SeniorProject | /PREV_SEMESTER_FILES/weather_station_project_files/weather-station-master/scripts/checkConnected.js | UTF-8 | 972 | 2.59375 | 3 | [] | no_license | const knex = require('knex')(require('../knexfile'));
const fetch = require("node-fetch");
const moment = require('moment');
// If the station has not sent data for longer than 30 seconds we will
// Update the connected column to be false.
async function checkConnected(){
var stations = await knex('latestweather'... | true |
cbbc93bc838b63c29e15001528251dd0ab4f7baa | JavaScript | evanswitte/fire | /polymorph/polymorph.js | UTF-8 | 1,455 | 3.453125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
/* create example polygons */
var r = function(){ return (Math.floor(Math.random()*100)/10) };
var p1 = [];
var p2 = [];
for (var i = 0; i < 3478; i++) {
p1.push([r(),r()]);
p2.push([r(),r()]);
if (i%3===0||i%7===0) {
p2.push([r(),r()]);
p2.push([r(),r()]);
p2.push([r(),r()]);
}
}
/* ... | true |
e6a8c60268abead5067fbc4e5290ce88b8a85449 | JavaScript | blicount/LostNShare-BackEnd | /services/eventHndler.js | UTF-8 | 2,387 | 2.515625 | 3 | [] | no_license | const Item = require('../models/Item');
const Event = require('../models/Event');
const moment = require('moment');
module.exports = {
// initalize event data object
initEvent : function initEvent(req,res){
return new Promise((resolve,reject)=> {
let newevent = new Event({
... | true |
8e9420ea8e661142f403950dd97249c545876ef2 | JavaScript | jibundeyare/epsi-arras-js-2017-2018 | /js/babel.js | UTF-8 | 261 | 3.28125 | 3 | [] | no_license | 'use strict';
window.setTimeout(function () {
console.log('time is out');
}, 3000);
var name = 'Toto';
console.log('\nline 1\nline 2\nline 3\nhello ' + name + '\n');
var _ref = [1, 2, 3],
a = _ref[0],
b = _ref[2];
console.log(a);
console.log(b); | true |
6fdee5067e8e2028a456cb9fb4912757c557393d | JavaScript | JakeKoo/2020-Class | /fabric_inventory_heroku/client/src/store/reducers/authReducer.js | UTF-8 | 2,741 | 2.578125 | 3 | [] | no_license | import * as actionTypes from '../actions'
import updateObject from '../utility'
import axios from 'axios'
const initialState = {
isAuthed: false,
token: null,
showChart: false,
showContainers: true,
userID: null,
error: null,
loading: false,
products: [],
cart: []
}
const showChar... | true |
7bef9510e4a265a264d72d642638ef5d2814454e | JavaScript | neverthanmore/ES6_Demo | /demo01/app.js | UTF-8 | 1,023 | 4.3125 | 4 | [] | no_license | //块级作用域--let
//let申明的变量只在此命令的代码块内生效
'use strict'
{
let a = 'gbb';
var b = 'xiaomai';
}
console.log(a); //a is not defined
console.log(b); // 'xiaomai'
//循环中使用let非常合适
for (let i = 0; i < Things.length; i++) {
Things[i];
};
//直观的例子
(function getVariable(){
var a = 10;
if(true){
var a = 5;
}
... | true |
2706e17ed627b7547108413bccd1232f4900e034 | JavaScript | sergebruni/react-tutorial | /src/Table.js | UTF-8 | 841 | 2.65625 | 3 | [
"MIT"
] | permissive | import React from 'react'
const TableHeader = ({columns}) => {
return (
<thead>
<tr>
{columns.map(col => (<td key={col}>{col}</td>))}
</tr>
</thead>
)
}
const TableBody = ({characters, removeCharacter}) => {
return (
<tbody>
{characters.map((character, i) => (
<tr k... | true |
2ae34e40e6456c8bc32c027d5f532697bc73fdd8 | JavaScript | OlRabiesAbe/jeu-de-chat-sans-titre | /tile.js | UTF-8 | 6,988 | 2.90625 | 3 | [] | no_license |
//~.~.~.~.~.~.~.~.~.~.~.~. code for a generic tile ~.~.~.~.~.~.~.~.~.~.~.~.//
function Tile(game, img, framex, framey, x, y, posX, posY, width, height, frameW, frameH, allSides, canMove, isVertical, start, end) {
this.game = game;
//Buffer added to make detection of cat less sensitive on right side.
this.buffe... | true |
2720a2a4c613b7628bec4db818552b50bf5087fb | JavaScript | cfwuchang/node-- | /source_code/mini-redux/createStore.js | UTF-8 | 964 | 3.46875 | 3 | [] | no_license | let action1 = {
type: 'INCREMENT'
}
let action2 = {
type: 'DECREMENT'
}
function reducer(state = 1, action) {
if (action.type === 'INCREMENT') {
return state + 1
} else if (action.type === 'DECREMENT') {
return state - 1
} else {
return state
}
}
function createStore(redu... | true |
4b778e8dd66ef3068d504aad6c2c5371669cff70 | JavaScript | webking12345/video_membership | /public/js/stickyBar.js | UTF-8 | 2,349 | 2.625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | $(document).ready(function() {
//sticky bar
$("#theme-btn").click(function() {
if ($(this).data("state")) {
$(this).data("state", 0);
$(this).find("img").attr("src", base_url + "public/images/bulb-off.png");
theme='darkly'
} else {
$(this).data("s... | true |
4c2975bb7cfefd1ff3b8bf2779f862beae82c699 | JavaScript | AlexYankoff/SoftUni-Alex | /JS_Advanced/EXAM_PREP1/test.js | UTF-8 | 419 | 3.703125 | 4 | [] | no_license | class Cinema {
constructor(name) {
this.name = name
this.obj = {"Boby":'yes'}
}
abc (n) {
if (n in this.obj) {
return `${n} ${this.name}`
}
}
def(n2) {
if (n2 in this.obj) {
return `${n2} ${this.name}`
}
return "nem... | true |
ca624b54f2add8e7acdb37384d68cdb566e6e550 | JavaScript | helloyan/React-and-React-Native---Third-Edition | /Chapter24/storing-data-new/App.js | UTF-8 | 1,740 | 2.671875 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect } from "react";
import { Text, TextInput, View, FlatList, AsyncStorage } from "react-native";
import styles from "./styles";
import Button from "./Button";
export default function App() {
const [key, setKey] = useState(null);
const [value, setValue] = useState(null);
const [so... | true |
6f20f13018de09579e8c0aa4acb8d3dd2710db86 | JavaScript | justuswitmer/tarjanAjaxReviewApp | /server/server.js | UTF-8 | 682 | 2.640625 | 3 | [] | no_license | // requires
const express = require( 'express' );
const bodyParser = require( 'body-parser' );
const app = express();
// uses
app.use( express.static( 'server/public' ) );
app.use( bodyParser.urlencoded( { extended: true } ) );
// globals
const port = 3000;
let inventory = [];
// spin up server
app.listen( port, ()=... | true |
803ac6e5f3936de3756f615fab1bd419267d170e | JavaScript | viginayak007/reporting | /server.js | UTF-8 | 1,236 | 2.515625 | 3 | [] | no_license | const express = require('express');
const cors = require('cors');
const bodyParser = require('body-parser');
const fs = require('fs');
const { Parser } = require('json2csv'); //convertor
const server = express();
const port = 8080;
server.use(bodyParser.json({limit: '10mb', extended: true}));
server.use(bodyParser.... | true |
4bdec0d28b2bad021e7fc9ba2a427f960478d099 | JavaScript | yq979292/senior_frontend_engineer_course | /chapter_3_oop/2020-08-25 面向对象-3/dialog.js | UTF-8 | 4,252 | 3.171875 | 3 | [] | no_license | // 封装组件;
export class Dialog extends EventTarget {
constructor(opts) {
super();
//作业:合并配置,用老师之外的方法合并配置,外部有配置传入以 外部配置为准,如果没有配置传入就调用默认配置;
//暗号:哈士奇
let defaultOpts = {
width: "30%",
height: "250px",
title: "测试标题",
content: "测试内容",
draggable: true, //是否可拖拽
maskable: tru... | true |
af145605f4ab94a944b3bdbeb644d5515c558758 | JavaScript | Shopify/libra-web-tools | /packages/libra-web-wallet-utils/scripts/protobuf-jsonify.js | UTF-8 | 618 | 2.671875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* eslint-disable no-console */
/* eslint-env node */
const {readFileSync, writeFileSync} = require('fs');
const {parse} = require('protobufjs');
if (process.argv.length < 3) {
console.log('Usage: ', `${process.argv[0]} ${process.argv[1]} {sourcePath}`);
process.exit(1);
}
function jsonify(sourcePath) {
const... | true |
af00d5e6741e4e96510cf68fe7ad0085a153cf4e | JavaScript | nangonghan/ae-colour-palette-manager-extension | /Colour Palette Manager/js/main.js | UTF-8 | 2,926 | 2.859375 | 3 | [] | no_license | (function () {
'use strict';
var paletteCounter = 0;
var csInterface = new CSInterface();
var colourValues = undefined;
document.getElementById('logoimage').addEventListener('click', function() {
csInterface.openURLInDefaultBrowser("https://videohive.net/user/penguino138/portfolio");
//csInterface.evalScript('... | true |
6d6b82f1d9745c954525b90c8b92b85ffe187b52 | JavaScript | SohaSiddiqui6/Zepto-TaskApp | /src/components/Table.js | UTF-8 | 1,080 | 2.8125 | 3 | [] | no_license | import React, {useState, useEffect} from "react";
import axios from 'axios';
const Table = ({value}) => {
const url = `https://7cg8uz8p69.execute-api.us-east-1.amazonaws.com/test/people?period=${value}`
console.log(url)
const [data, setData] = useState([])
useEffect(() => {
axios.get(url)
.then(res =... | true |
a951d27346aeb6e8716c8445c79640abea92ebc7 | JavaScript | fluffles2456/GFLBot-v2 | /commands/paradeus.js | UTF-8 | 3,812 | 2.90625 | 3 | [] | no_license | //initialise discord.js
const Discord = require("discord.js");
module.exports = {
name: "paradeus",
//execute command
execute(paradeusMsg, args)
{
//all paradeus units in array
const paradeusNameList = [
//index 0 is empty; index 1-5, common non-boss paradeus units
... | true |
f58d10b87673228827a2b713bb46b11de03e0dfa | JavaScript | Fatanaminullah/lely-aldy-wedding | /src/components/utils/function.js | UTF-8 | 3,250 | 2.625 | 3 | [] | no_license | import moment from "moment"
import { useCallback, useEffect, useState } from "react"
import { useInView } from "react-intersection-observer"
export const useScrollAnim = (animation = "fadeInUp") => {
const [ref, inView] = useInView({
threshold: [0.125, 0.5, 0.75],
triggerOnce: true,
})
con... | true |
1a54a470ec30b30582bc874d9e44b08a704911fd | JavaScript | charlierproctor/boids | /object.js | UTF-8 | 683 | 3 | 3 | [] | no_license | var coords = require('./coords');
function object(id,pos,opts){
this.id = id;
this.pos = pos;
this.strength = opts.strength;
this.shape = opts.shape;
this.maxStrength = opts.maxStrength;
}
object.prototype.draw = function(ctx){
ctx.beginPath();
ctx.ellipse(this.pos.x, this.pos.y, this.shape.radius, this.shape.... | true |
f4e0b7f69bc6cacc64ee2a9b6e32dcf25a24f9f8 | JavaScript | chemllot85/BusTicketApp | /BusTicketApp-frontend/src/components/Utilities/OriginArrayBuilder.js | UTF-8 | 435 | 2.734375 | 3 | [] | no_license | export default function OriginArrayBuilder(stops, allStopNames, allStopsIds) {
const result = [];
stops.map(
(value) =>
result.push(value.origin) &&
value.stops.map((stop) => {
allStopNames.push(stop.name);
allStopsIds.push(stop.id);
if (result.indexOf(stop.name) > -1) {
... | true |
70bc0d99a651ba9cfacffc563f3486e632040482 | JavaScript | zigmantasvcs/20180521VCSWEBVAKARINIAI | /classwork/js/salygos/js/master.js | UTF-8 | 683 | 3.359375 | 3 | [] | no_license | var skaicius = 10;
// if(skaicius > 10){
// alert("skaicius yra daugiau uz 10");
// }
// else{
// alert("skaicius yra mazesnis uz 10");
// }
// skaicius tarp 5 ir 10 (5 included 10 not included)
if(skaicius == 5 || skaicius == 10){
console.log("skaicius yra " + skaicius);
alert("skaicius yra " + skaicius,... | true |
2c679e12100c072a90f34a235536cfb3e6c6e5b0 | JavaScript | phpeter/microservice-urlshortener | /server.js | UTF-8 | 2,331 | 2.734375 | 3 | [] | no_license | // server.js
// where your node app starts
// init project
var dns = require('dns');
var express = require('express');
var Sequelize = require('sequelize');
var bodyParser = require('body-parser');
var app = express();
var URL;
// setup a new database
// using database credentials set in .env
var sequelize = new Seq... | true |
252eee643baa421f623f1459bc50ec078c467c80 | JavaScript | tsoding/wcc | /samples/test_fib.js | UTF-8 | 649 | 3.03125 | 3 | [
"MIT"
] | permissive | // NOTE: to run this test just do `make test_fib` in the root of the project.
// For more information do `make help`.
const fs = require("fs");
const assert = require("assert");
WebAssembly
.instantiate(fs.readFileSync(`${__dirname}/fib.wasm`))
.then((wasm) => {
const fibs = [0, 1, 1, 2, 3, 5, 8, 13, ... | true |
4394d3beaf6183c1a3be4cd2809e6454a95f953e | JavaScript | doujunchen/doujunchen.github.io | /clock/main.js | UTF-8 | 5,020 | 3.03125 | 3 | [] | no_license | /**
* Created by Administrator on 2016/9/13 0013.
*/
(function () {
/*
var mycanvas=document.getElementById("mycanvas");
var otex=mycanvas.getContext("2d");
otex.beginPath();
otex.moveTo(0,0);//起点
otex.lineTo(250,250);
otex.lineTo(500,0);
otex.lineTo(0,0);
otex.strokeStyle="yellow";
... | true |
dc9ae3ec39c82926efdbb69df8881583925c5320 | JavaScript | wchsinyi/chatterbox-client | /client/scripts/messagesView.js | UTF-8 | 1,044 | 2.515625 | 3 | [] | no_license |
var MessagesView = {
$chats: $('#chats'),
initialize: function () {
},
render: function (data) {
var resultArr = data.results;
for (let i = 0; i < resultArr.length; i++) {
MessagesView.renderMessage(resultArr[i]);
}
},
renderMessage: function (msg) {
var currentMsg = MessageView.... | true |
0a330e3f249ccd6434348c567a18fd92c4cb3cd0 | JavaScript | 808kevin/ITM352_F2020_repo | /Nguyen_Kevin_Assignment1/server.js | UTF-8 | 2,859 | 3.21875 | 3 | [] | no_license | //Code from Lab13 Ex4
var express = require('express'); //uses express
var app = express();//gets express
var myParser = require("body-parser");
var fs = require('fs');
var products = require('./products.json'); //gets stuff from products.json
// Code from Professors Port :)
var qs = require('querystring'); //allows t... | true |
9f567ff876380359f2275a7e980ce3022fcfd5d1 | JavaScript | r-walsh/zeelib | /dist/not-elem.js | UTF-8 | 595 | 2.96875 | 3 | [
"WTFPL"
] | permissive | 'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _elem = require('./elem');
var _elem2 = _interopRequireDefault(_elem);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**
* The opposite of `elem`
* Returns true if the element is n... | true |
a858e32622e5fdfef49d81857e12638e46f17b74 | JavaScript | tyelf22/recipeAppBackend | /routes/shoppingRoute.js | UTF-8 | 1,984 | 2.71875 | 3 | [] | no_license | const express = require('express')
const router = express.Router()
const List = require('../models/shoppingModel')
//Get all shopping
router.get('/', async (req, res) => {
try{
const shopping = await List.find()
res.json(shopping)
}catch(err){
res.send(`Error ${err}`)
}
})
//Get si... | true |
b84173af7382d2e4dbf0f194e493d3870131a501 | JavaScript | ChenDiaz/LoLWinrateAnalyzer | /js/buttonJquery.js | UTF-8 | 338 | 2.671875 | 3 | [] | no_license | function validateForm() {
var x = document.forms["form"]["user"].value;
if (x == null || x == "") {
document.getElementById("user").style.borderColor = "red";
return false;
}
else {
$('#submit-button').css('background-color','red');
$('#submit-button').html('Loading');
re... | true |
b2cdae2e8eb5895249c1716d7d7466d548ff40b9 | JavaScript | gsbelarus/GdmnCleaner | /Manager.js | UTF-8 | 457 | 2.6875 | 3 | [] | no_license | export async function postJSON() {
let response = await fetch("http://192.168.0.54:3000/?token=garbit&barcode=10167&lngn=1.1&latn=2.2", {
method: 'get'
});
let responseStatus = await response.status;
if (responseStatus >= 200 && responseStatus < 300) return await response.json();
if (respon... | true |
bcd078bf50581591ba60ea5cd4091454444e5a42 | JavaScript | kakarottos/TodoReactApp | /src/index.js | UTF-8 | 2,912 | 2.875 | 3 | [] | no_license | import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
class ToDoInput extends React.Component {
render() {
const { addItem, inputEl, currentItem, handleInput } = this.props;
return (
<form onSubmit={addItem}>
<input ref={inputEl} value={currentItem.text} onChange={... | true |
02e279b2ca687c2deb68341c1b9cc2392cf6ed8c | JavaScript | saint-aid/KNOWLEDGE-REPOSITORY | /src/components/ExplorationSection.js | UTF-8 | 811 | 2.765625 | 3 | [] | no_license | export default class ExplorationSection{
constructor({$element, onClick}){
this.onClick = onClick;
this.explSection = document.createElement('h4');
this.explSection.className = 'explSection';
$element.appendChild(this.explSection);
//this.render();
}
... | true |
05e4a131dd678fb8e18e7747b8c6e099c624f503 | JavaScript | noviceZ/myBlog | /JavaScript/Log.js | UTF-8 | 800 | 2.984375 | 3 | [] | no_license | // JavaScript Document
//搜索框检索指定信息
function searchs(){
if(!document.getElementById) return false;
if(!document.getElementsByTagName) return false;
if(!document.getElementById("mytext")) return false;
var mytext = document.getElementById("mytext");
if(!document.getElementById(... | true |
4e910a60a829736ac4983e6860e7e7e80b684cab | JavaScript | pushkar100/game-of-thrones | /src/components/Characters.js | UTF-8 | 2,422 | 2.53125 | 3 | [] | no_license | import React from 'react';
import { connect } from 'react-redux';
import { Link } from 'react-router-dom';
import { fetchCharacters } from '../actions';
import Loader from './Loader';
class Characters extends React.Component {
getCharacters = () => {
return this.props.characters.filter((b, i) => i !== 0) || [];
}
... | true |
b220acd876d0e45bfaf2be40ba6cf24720d9090d | JavaScript | AurelijaZ/august | /day1-task5.js | UTF-8 | 790 | 3.921875 | 4 | [] | no_license | //set an event woth click of a button
var event1=document.getElementById("button1");
event1.addEventListener('click', myFirst, false);
function myFirst()
{
var userInput1= parseInt(document.getElementById("input1").value);
var userInput2=parseInt(document.getElementById("input2").value);
var num1=parseIn... | true |
747a4e37b0d2c4f1d3366926cd515c2273e34501 | JavaScript | pradnya05/angular | /module1sol/app.js | UTF-8 | 776 | 2.5625 | 3 | [] | no_license | (function(){
'use strict';
angular.module('LunchCheck', [])
.controller('LunchCheckController', LunchCheckController);
LunchCheckController.$inject=['$scope'];
function LunchCheckController($scope)
{
$scope.lunch='';
$scope.ans='';
$scope.check=false;
$scope.checklunch=function(){
if($scope.lunch.trim... | true |
46fe07967b2d94999080fb9219a6437334aa5c1c | JavaScript | davifprado/js | /funcao/27.js | UTF-8 | 469 | 3.0625 | 3 | [] | no_license | function kid(AlturaMenor, TaxaMenor, AlturaMaior, TaxaMaior) {
if (AlturaMenor == AlturaMaior) {
if (TaxaMenor > TaxaMaior) {
console.log("A Criança menor ultrapassa a maior em 1 ano")
} else if (TaxaMaior > TaxaMenor) {
console.log("A Criança maior ultrapassa a menor em 1 an... | true |
ad33f3e2d8d33a47c02a5f7e76cc96141cde1bb0 | JavaScript | cmaffei720/password-generator | /script.js | UTF-8 | 14,508 | 3.734375 | 4 | [] | no_license | // Assignment Code
var generateBtn = document.querySelector("#generate");
// Write password to the #password input
function writePassword() {
var password = generatePassword();
var passwordText = document.querySelector("#password");
passwordText.value = password;
}
var passwordLength = prompt("How long do you... | true |
812e9b540dd370f98c716e13cf69032dfc6ca7dd | JavaScript | evanheisler/proji | /client/src/utils/api.js | UTF-8 | 462 | 2.78125 | 3 | [
"MIT"
] | permissive | export function handleJSONResponse(response) {
let json = response.json();
if (response.status >= 200 && response.status < 300) {
return json;
} else {
return json
.catch(parseErr => {
let errObj = {
errors: [
{
title: parseErr.message,
meta:... | true |
1203d72ba5fc580bc51147e1c69d80d581682391 | JavaScript | Caragop-Ioan-Alexandru/Cara94 | /04. My blog/script.js | UTF-8 | 512 | 2.953125 | 3 | [] | no_license | var searchBtn = document.getElementsByClassName("fas fa-search");
var searchTxt = document.getElementsByClassName("search-txt");
searchBtn.onclick() = function () {
if (searchTxt.className == "open") {
//shrink the box
searchTxt.className = "";
} else {
//expand the box
searchTxt.className = "ope... | true |
27bef8475fcbc7dff43e557398bb87d94f3a6c27 | JavaScript | VitalikP1/goit-js-hw-2 | /Task6.js | UTF-8 | 628 | 3.984375 | 4 | [
"MIT"
] | permissive | const summNumbers = function () {
let numbers = [];
let total = 0;
while (true) {
let input = prompt(
"Введите число! Чтобы посчитать их сумму - нажмите отмена"
);
if (input === null) {
break;
}
input = Number(input);
const notANumber = Number.isNaN(input);
if (notANumber... | true |
5f3027964d3a34f7207be5b8530a28e3230d53d7 | JavaScript | the-pudding/job_retraining | /src/js/graphic.js | UTF-8 | 2,941 | 2.515625 | 3 | [
"MIT"
] | permissive |
import enterView from 'enter-view';
import intro from './truckersAndDevs';
import skillStacking from './skillStacking';
import scatter from './scatter';
let mobile = false;
let viewportWidth = window.innerWidth;
let viewportHeight = window.innerHeight;
let isMobile = viewportWidth < 700? true : false;
function getHe... | true |
c22d23f97275fccf77d263041102795148eada09 | JavaScript | Mahdi0123Copen/mabur18.github.io | /Web Mashup/NYT_API.js | UTF-8 | 1,417 | 2.734375 | 3 | [] | no_license | /* Restful request
https://api.nytimes.com/svc/search/v2/articlesearch.json?begin_date=20201206&end_date=20201207&sort=newest&q=pollution&api-key=YOUR_API_KEY
*/
const NYT_url = "https://api.nytimes.com/svc/search/v2/articlesearch.json?";
const NYT_params = "begin_date=20180314&end_date=20210324&sort=oldest&";
con... | true |
4ad5c3b5a9144618cd190484170946cba2d2d2c8 | JavaScript | titicuevas/Curso-2020-2021 | /DWEC/Primer Trimestre/Tema 3/Tareas/3A10/3A10.js | UTF-8 | 3,652 | 3.796875 | 4 | [] | no_license | function menu() {
var salir = false;
do {
mostrarOpciones();
var opcion = pregunta("Seleccione una opción");
switch (true) {
case opcion == 1:
sumar();
break;
case opcion == 2:
restar();
... | true |
35c41eac68efd4180ffb57f1653fb02dc9e95ba7 | JavaScript | SwaNull/youtube.demo | /publish/web/js/01-line-drawing.js | UTF-8 | 3,881 | 2.625 | 3 | [] | no_license | AdobeEdge.bootstrapCallback(function (compId) {
comp = AdobeEdge.getComposition('EDGE-50899785').getStage();
});
var s, test, target,
targetx1 = 225,
targety1 = 218,
targetx2 = 523,
targety2 = 111,
// Slopes of cardinal and ordinal paths, for constrained drawing
slopeBound = [0, 0.414, 1, 2.414, Infinity, -2.41... | true |
d8f368137cdf4adbe6dfb1f2c9eb9eeaba9431af | JavaScript | tanbinh123/matcha | /client/src/modules/MyProfile/components/Tags.jsx | UTF-8 | 2,959 | 2.546875 | 3 | [] | no_license | import React from 'react';
import './Tags.css';
import api from '../../../library/api'
const unlinkTag = async (args, updateState, deleteTag) => {
try {
let res = await api.tag(`DELETE`, args);
if (res && res.status >= 400) {
const response = await res.json();
if (res.status >= 500) {
thr... | true |
af9a4df6e86afff9d80d54df8191c5c06500643d | JavaScript | davigueras/mean-stack-intro-01 | /models/fruitModel.js | UTF-8 | 357 | 2.65625 | 3 | [] | no_license | // Incluyo la libreria Mongoose
var mongoose = require('mongoose');
// carga en una variable la classe Schema;
var schema = mongoose.Schema;
// Instancia un objeto Schema de moongose y define una especificacion
var fruitSchema = new schema({
name: String,
size: Number,
origin: String
});
module.exports = mongoo... | true |
d4d6e7413d33be988649c02562d5b4bb55ce9b6a | JavaScript | mhdbs/twitter-updates | /src/index.js | UTF-8 | 2,427 | 2.6875 | 3 | [] | no_license | import React, {Component} from 'react'
import ReactDOM from 'react-dom';
class Main extends Component {
constructor() {
super();
this.handleSearch = this.handleSearch.bind(this);
this.state = {
data: []
}
}
componentDidMount() {
setInterval(() => {
... | true |
5193df891b0a819f44e28164c0a3642c8bf17121 | JavaScript | jlank/istm6205 | /jlank-istm6205-ae02/static/hovscript.js | UTF-8 | 697 | 2.546875 | 3 | [
"MIT"
] | permissive |
function ShowPopup(hoveritem)
{
if (hoveritem.id == "hoveroverContactInfo") {
hp = document.getElementById("hoverpopupContactInfo")
} else if (hoveritem.id == "hoveroverEdInfo") {
hp = document.getElementById("hoverpopupEdInfo");
};
hp.style.top = hoveritem.offsetTop + 20;
hp.style.left = hoveritem.offsetLef... | true |
5506d47c04584d4d09d91fcaff68d688a5250174 | JavaScript | OriginProtocol/origin | /packages/web3-provider/src/index.js | UTF-8 | 3,505 | 2.53125 | 3 | [
"MIT"
] | permissive | /**
* Web3 Provider Engine Subproviders
*/
const ProviderEngine = require('./ProviderEngine')
const {
MetricsProvider,
ThrottleRPCProvider,
EthGasStationProvider
} = require('./subproviders')
/**
* Convert a standard provider to a web3-provider-engine subprovider
* @param provider {object} - A Web3 provider
... | true |
61da7f402d1331e461a856cbca9d763f3b7963ae | JavaScript | YujohnNattrass/javascript_fundamentals | /javascript_basics/string_assignment.js | UTF-8 | 346 | 3.703125 | 4 | [] | no_license | const name = 'Bob';
const saveName = name;
name.toUpperCase();
console.log(name, saveName);
/* Logs: Bob Bob
* reason: strings are immutable, so when we invoke toUpperCase(); on line 3
* the return value is a completely new string object which is not saved to a variable
* which is why name and saveName still refere... | true |
9875d67d169c6bba93df22592b32f33d9a42f4ca | JavaScript | TuurDutoit/isw-r | /app/store/actions/media/player.js | UTF-8 | 3,522 | 2.625 | 3 | [] | no_license | // @flow
import * as actions from '/types/media/player/actions';
import { catcher, error } from '/util/error.js';
import type {
FetchStartAction,
FetchEndAction,
PlayAction,
PauseAction,
VolumeAction,
ToggleMutedAction,
NextAction,
PreviousAction,
Song,
ApiStatus,
ApiSong,
} from '/types/media/pl... | true |
111d4191fbbc0477bbfc7ae42c7575bb39f1bc40 | JavaScript | parrot-studio/shoborn | /js/shoborn.js | UTF-8 | 8,095 | 2.578125 | 3 | [] | no_license | (function() {
var Timer, Tweet, TweetSearcher, View;
Tweet = (function() {
var formatDate, level1, level2a, level2b, level3, levelca, levelcb, parseLevel, zeroPadding;
level3 = /[\((]\s*[\´\']\s*[・・]\s*ω\s*[・・]\s*[\``]\s*[\))]/;
level2a = /[\((]\s*[\´\']\s*[・・]\s*ω\s*[・・]\s*[\``]?\s*[\))]?/;
lev... | true |
51e276682cd76f8a9b42a7b26c53dd6aefb4be5c | JavaScript | AndonGeorgiev/Game-SoftUni | /helpers.js | UTF-8 | 290 | 2.65625 | 3 | [] | no_license | export function hasCollision(elementOne, elementTwo) {
let first = elementOne.getBoundingClientRect();
let second = elementTwo.getBoundingClientRect();
return !(first.top > second.bottom || first.bottom < second.top || first.left > second.right || first.right < second.left);
} | true |
0efbb4667a5637d5f92e620008a75540d4ed7038 | JavaScript | FbW-E01/pb-classes-vehiclefactoryfactory-Totakhail-Khushal | /classes.js | UTF-8 | 1,892 | 4.71875 | 5 | [] | no_license | // # Vehicle Factory Factory
// Create "factory factory" function that returns a constructor function.
// The factory factory takes in one parameter, "type".
// Each created factory needs to create objects with this given type.
// Each created factory needs to take in three parameters and save them to the created o... | true |
13bfafa1274e3b405b292760c061b63a9e6a2aad | JavaScript | WilliamDo/hinoki | /tree.js | UTF-8 | 323 | 3 | 3 | [] | no_license | /* eslint-env node */
function depth(root) {
return depthOfTree(root);
}
function depthOfTree(root) {
if (root == null) {
return 0;
}
var depthLeft = depthOfTree(root.left);
var depthRight = depthOfTree(root.right);
return 1 + Math.max(depthLeft, depthRight);
}
exports.depth = dept... | true |
1b68d4fbf6fd15aee8df4fb8e53de2de7d3d43d9 | JavaScript | alexandr2110pro/binarytest | /app.js | UTF-8 | 1,526 | 3.078125 | 3 | [] | no_license | /*
That was an additional reminder to use TDD *always*.
It would have saved a lot of time today.
Also, I'm not sure, if the "quote" is the required property to print. But it looks like it is.
I didn't used the tick's object fields in the logic of that app because I wasn't sure, what does each field exactly mean and... | true |
e2287d7ad3bdfc121935e6dda582374c1cd15625 | JavaScript | NedelinaN/New_calc | /example.js | UTF-8 | 2,810 | 3.65625 | 4 | [] | no_license | // Получили количество электроприборов, например 5
// Получили коэффицент из входных данных, как я понял, например 0.435
// Округляем этот коэффицент до 10х значений, например 0.4, про округление много материала, прочитай, как это делается
// Создаем отдельный файл, в компонентах, например coefStandart.js
// Переносим... | true |
0cbff97f1f32d7fd0d18d7f381d213b186cb732d | JavaScript | chrisharrington/showveoservice | /ShowveoService.MVCApplication/Scripts/Prereqs/Controls/EncodingChecker.js | UTF-8 | 3,818 | 2.875 | 3 | [] | no_license | if (!Showveo.Controls)
Showveo.Controls = { };
/*
* A class used to periodically check to see if any encoding tasks are in progress and, if so, displays them
* to the user.
*/
Showveo.Controls.EncodingChecker = function (parameters) {
//------------------------------------------------------------------------------... | true |
c895711bd153172c318ff05559cb6f9f502e9ce1 | JavaScript | ChrisMondok/zolf | /js/Ball.js | UTF-8 | 7,820 | 2.8125 | 3 | [] | no_license | define(['js/Actor.js', 'js/AimingCircle.js', 'js/Enemy.js', 'js/Floor.js', 'js/Water.js', 'js/BloodFountain.js', 'js/geometry.js', 'js/noiseSourceFactory.js', 'js/playerInput.js'],
function(Actor, AimingCircle, Enemy, Floor, Water, BloodFountain, geometry, noiseSourceFactory, playerInput) {
var getImageDataIsFuxored... | true |
532758b90f1d70d30f3c85a540db314d7c62f31d | JavaScript | solatis/needle | /lib/decoder.js | UTF-8 | 1,012 | 2.71875 | 3 | [
"MIT"
] | permissive | var iconv,
Transform = require('stream').Transform;
function parserFactory(fn) {
try {
iconv = require('iconv-lite');
} catch(e) {
/* iconv not found */
}
return function(charset) {
var chunks = [],
stream = new Transform({ objectMode: false });
// Buffer all our data
stream... | true |
34f0b58d46639efbc599eb76167cdf28a9a600cb | JavaScript | coderray/createjs.init.js | /js/GAME.js | UTF-8 | 825 | 2.546875 | 3 | [
"MIT"
] | permissive | var GAME = (function(g,cjs){
var stage,
main,
loader;
g.init = function(){
stage = INIT.stage;
loader = INIT.loader;
main = new cjs.Container();
stage.addChild(main);
g.start();
}
g.start = function(){
var indexBg = new cjs.Bitmap(loader.getResult('indexBg')),
txt = new createjs.Text... | true |
be1915a5e545fb07951f3f789753a815634c75e4 | JavaScript | admanashy/ponySlot | /js/betLine.js | UTF-8 | 1,313 | 2.6875 | 3 | [] | no_license | function BetLines(){
/**
* шлет ивенты модулю бетлайнс
*/
var me = this;
this.x = 0;
this.y = 0;
this.createBetLine = function(x,y,i,rootContanier){
var betline = new PIXI.Graphics();
betline.lineStyle(7, 0xff69b4 ,0);
console.log(y... | true |
2c8f370e35b5b81e89c498e04e131a4d78dc8c32 | JavaScript | mrAsabol/JWTAuth | /routes/auth.js | UTF-8 | 2,817 | 2.515625 | 3 | [] | no_license | const router = require('express').Router();
const jwt = require('jsonwebtoken');
const User = require('../model/User');
const bcrypt = require('bcryptjs');
const { registerValidation, loginValidation} = require('../validation');
var CryptoJS = require("crypto-js");
router.post('/register', async (request,re... | true |
016f0f4d50c392e66ad3dc0569e665813b510419 | JavaScript | Wiejeben/MarcoPlaats | /API/Helpers/BaseModel.js | UTF-8 | 2,707 | 2.53125 | 3 | [] | no_license | module.exports = class BaseModel {
/**
* @property {Collection} collection
* @property {string} table
* @property {object} document
* @property {object} params
* @property {boolean} useAggregation
*
* @param {string} table
*/
constructor(table) {
this.table = tabl... | true |
9c90dd49a9da2764d7c94de66df48fda91c4b729 | JavaScript | BMatillaVaras/ejercicios-de-adalab | /modulo2/leccion02/ejercicio4/js/main.js | UTF-8 | 219 | 3.53125 | 4 | [] | no_license | const total = 128;
const numerPerson = 9;
const sake = 2;
const pricePerson = (total - sake) / numerPerson;
const Ana = pricePerson + sake;
console.log(`Cada uno paga ` + pricePerson + `€ y Ana paga ` + Ana + `€`);
| true |
b5adcdb71da88f479486b50d2ced429748437b98 | JavaScript | divaymohan/worker-hiring-backend-service | /routes/customer.js | UTF-8 | 2,437 | 2.53125 | 3 | [] | no_license | const express = require("express");
const Router = express.Router();
const { validate, validateUpdate } = require("../models/customer");
const { validatAdd } = require("../models/address");
const {
getCustomer,
getCustomers,
addCustomer,
deleteCustomer,
updateCustomer,
updateAddressOfCustomer,
getCustomer... | true |
c4d38c5048186d8f003af58aa303d539b24dfea6 | JavaScript | foxymen9/country-list | /country-list.js | UTF-8 | 1,054 | 2.96875 | 3 | [
"MIT"
] | permissive | 'use strict'
var data = require('./data.json')
/**
* Precompute name and code lookups.
*/
var nameMap = {}
var codeMap = {}
data.forEach(function (country) {
nameMap[country.name.toLowerCase()] = country.code
codeMap[country.code.toLowerCase()] = country.name
})
module.exports = CountryList
function CountryLis... | true |
717ad6ab46175d4f4ba9118c7c1c4149de587883 | JavaScript | AltusJVR/scss_maps | /src/js/theme.js | UTF-8 | 1,744 | 3.15625 | 3 | [] | no_license | const documentE = document.documentElement;
const button = document.querySelector(".navbar__theme");
const page = window.location.pathname;
function setTheme(themeName) {
if (page === "/index.html") {
localStorage.setItem("theme", themeName);
document.documentElement.className = themeName;
}
if (page ===... | true |
285cc74dadf1db1db26e91674a0d9f3c69318548 | JavaScript | tautvydascoding/2018-03-05 | /dirbame_cia/diena_6/deividas/1-js-pagrindai/main.js | UTF-8 | 2,903 | 3.171875 | 3 | [] | no_license | console.log( " Labas ");
var x = 10;
var y = 100;
var z = x + y;
console.log( x );
console.log( y );
console.log( "suma yra ", z );
//
console.log( z * 3);
console.log( z / 3);
console.log( z );
function sveikintis() {
var tekstas = "Laba diena";
console.log( tekstas );
}
sveikintis();
sveikintis();
... | true |
f7ae50f531537aac0eeea52245f3f41f249b3acf | JavaScript | Catfeeds/Job_Gom | /video/gomeplusFED/DataPlatform/filters/videoStatis/index.js | UTF-8 | 9,953 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* @author Mr.He
* @date 20160818
* @fileoverview 视频统计,数据过滤处理
*/
var util = require("../../utils"),
_ = require("lodash");
/* 环比计算 , 昨天-前天 / 前天 */
function Chain(lastday , beforeLastday){
if(lastday == 0 || beforeLastday == 0){
return '0%';
}
var num = (lastday - beforeLastday) / bef... | true |
1d19d287c379bbfb81d5fd823017eae29f6f20e9 | JavaScript | raphamartinez/portalcanastra | /api/models/history.js | UTF-8 | 2,194 | 2.578125 | 3 | [] | no_license | const Repositorie = require('../repositories/history')
const { InvalidArgumentError, NotFound, InternalServerError } = require('./error')
class History {
async listHistoryDashboard(perfil, id_login) {
try {
if (perfil === 1) {
const count = await Repositorie.countInTheTime()
... | true |
fa4738e9a1923a5b6bfbd7873e2dc2f441b501fd | JavaScript | gwd999/videos | /Season1/patterns/creational/constructor.js | UTF-8 | 276 | 3.234375 | 3 | [] | no_license | //Constructor: creating a simple instance
class ShoppingCart{
constructor({items: items} = {items: []}){
//set some values
//validations and rules for creating an object
//like: need to have items!
this.items = items;
}
}
console.log(new ShoppingCart());
| true |
d887fabfbf3830cfdbbd535a42894a07c04a7378 | JavaScript | kmaccoy/ReplAlgoPractice | /problems/fizzbuzz.js | UTF-8 | 837 | 4.53125 | 5 | [] | no_license | // Write a function that takes an object and returns a nested array. These inner arrays will each have two elements: the key-value pairs from the object. These whole array should be *SORTED* in alphabetical order by the key names.
//declare output array to push items into
//iterate through the array
//set up network of... | true |
e599b10006f8dc2439cc37686cf827f2c13e7347 | JavaScript | Kevin-Do/IgnikaiNodeServer | /server.js | UTF-8 | 2,016 | 2.9375 | 3 | [
"MIT"
] | permissive | //Packages and Setup
var defaultPort = 3000;
var io = require('socket.io')(process.env.PORT || defaultPort);
var shortid = require('shortid');
//Player Management
var players = [];
//---Server Start---
console.log("\n---------------------------")
console.log("Server Started - Port: " + defaultPort);
console.log("----... | true |
3153319ebdb17fe557351c0569d7e17c20c700b6 | JavaScript | topus009/study | /01.js | UTF-8 | 262 | 2.890625 | 3 | [] | no_license | /* ЗАДАЧА 1
Треугольник.
Напишите цикл, выводит такой треугольник:
1 #
2 ##
3 ###
4 ####
5 #####
6 ######
7 #######
*/
var str = "#";
while (str.length <= 7) {
console.log(str);
str += "#";
};
| true |
6a88b6dc14712244bf34851f56c7189e48a181a1 | JavaScript | dulithag/applicationIMU | /web/script.js | UTF-8 | 8,412 | 2.59375 | 3 | [] | no_license | function createShaderProgram(GL){
console.log("======= initialize Shaders =======") ;
var shader_vertex_source=" \n\
attribute vec3 position; //the position of the point \n\
attribute vec3 color; //the color of the point \n\
uniform mat4 Pmatrix; \n\ ... | true |
be10a61a1f1b1470c37050941d36aa9f59f06384 | JavaScript | csq121605366/weixin | /server/index.js | UTF-8 | 2,365 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | import Koa from "koa";
import { Nuxt, Builder } from "nuxt";
// ramda
import R from "ramda";
import { resolve } from "path";
const r = path => resolve(__dirname, path);
const host = process.env.HOST || "127.0.0.1";
const port = process.env.PORT || 8080;
// Import and Set Nuxt.js options
let config = require("../nuxt.... | true |
31844e5642d8b4bf086d603102402ae5a366e963 | JavaScript | outranker/hangman-game | /hangman/scripts/app.js | UTF-8 | 2,437 | 3.5625 | 4 | [] | no_license | const puzzleEl = document.querySelector("#puzzle");
const guessesEl = document.querySelector("#guesses");
const defs = document.querySelector("#translation");
const loader = document.querySelector("#loading");
let game1;
function displayLoading() {
loader.classList.add("display");
// to stop loading after some time... | true |
a2f2096c37a237c2b79e28ab8474c053d9dba4db | JavaScript | asimovinstitute/Arkanet | /Nutworks.js | UTF-8 | 11,477 | 2.765625 | 3 | [] | no_license | // arcade learning environment
// papers
// tijdgebonden netwerk
// localiteit kleine chuncks
// spel bedenken, possibility space finite but uncomputable, differs widely from sensible moves space
// hard to perfect
// for html
var output;
var seed = 1;
var cells = [];
var cellScale = 10;
// for the graphs
var records ... | true |
856a33a2a64ca2bda3e0f3a52e41f80c92c30173 | JavaScript | AndreaColombo/Hypermedia-Application-project-15-16---Barlocco-Cena-Colombo | /WEBSITE/js/desc-sl.js | UTF-8 | 5,066 | 2.625 | 3 | [
"MIT"
] | permissive | function openTab(evt, tab) {
// Declare all variables
var i, tabcontent, tablinks;
// Get all elements with class="tabcontent" and hide them
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
... | true |
9ec9607dcc063a6fd47b8c01ed1987131631cf6a | JavaScript | Domingowen/interview-ansewer | /src/pokerCardAlgorithms.js | UTF-8 | 275 | 3.078125 | 3 | [] | no_license |
let Shuffle = () =>
[..."A23456789JQK", 10]
.reduce((arr, e) => arr.concat([`红心${e}`, `黑桃${e}`, `梅花${e}`, `方块${e}`]), [
"大🃏",
"小🃏",
])
.sort(() => Math.floor(Math.random() * 3 - Math.random() * 3));
console.log(Shuffle()); | true |
5305d25f4d9fb66b24fd482405c26c08b4603e81 | JavaScript | lentqq/javascript_tf_arrays | /01.sum_first_last_elements.js | UTF-8 | 415 | 4.28125 | 4 | [] | no_license | // let arrNums = ['20', '30', '40'];
// function sumElements (arrNums){
// let sum = Number(arrNums[0]) + Number(arrNums[arrNums.length -1]);
// console.log(sum);
// }
// sumElements (arrNums)
function sumElements (input){
let firstElement = Number(input.shift());
let secondElement = Number(input.pop());
let... | true |
82c498bd813c452fb809b506d7c4dc1b6abbadd1 | JavaScript | rakibprog/javascript-you-need-to-know-for-react | /locatstorage.js | UTF-8 | 231 | 2.90625 | 3 | [] | no_license | //local storage setItem
localStorage.setItem('myCat', 'Tom');
//localStorage getItem
const cat = localStorage.getItem('myCat');
//localStorage removeItem
localStorage.removeItem('myCat');
//localStorage Clear
localStorage.clear(); | true |
6062e78428d4f0c93ce421a3b2b72543b9897188 | JavaScript | ghadagesandip/AngularFoundation | /js/directives/set-active.js | UTF-8 | 306 | 2.53125 | 3 | [] | no_license | app.directive('setactive',function(){
return {
scope :{},
link : function(scope, element, attr){
element.on('click',function(){f
element.parent().children().removeClass('active');
element.addClass('active');
})
}
}
}); | true |
296350d6b7e63992e2e64c81d9bf98552a4e7600 | JavaScript | anchvy/restify-api-with-react | /api/src/models/user.js | UTF-8 | 1,004 | 2.578125 | 3 | [] | no_license | import md5 from 'md5'
import db from '../connectors/postgresql'
const TABLE_NAME = 'users'
/**
* Create new user row
*
* @param {string} email
* @param {string} username
* @param {string} alias
* @param {string} password
* @return {Promise}
*/
async function create(email, username, alias, password) {
retur... | true |
a1377509f1a35d69d6dc94daf54d4dcdc1f46624 | JavaScript | arwatts16/opensphere | /src/os/structs/istatetreenode.js | UTF-8 | 493 | 2.53125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-free-unknown"
] | permissive | goog.declareModuleId('os.structs.IStateTreeNode');
const {default: ITreeNode} = goog.requireType('os.structs.ITreeNode');
/**
* Extends the base tree node interface to include states (e.g. for tri-state checkbox trees)
*
* @interface
* @extends {ITreeNode}
*/
export default class IStateTreeNode {
/**
* Get... | true |