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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
fdca22df4c9c230ab932954c7d2786459c966240 | JavaScript | gabrielseco/learnseries | /sample.js | UTF-8 | 3,330 | 2.765625 | 3 | [
"MIT"
] | permissive | 'use strict';
import { Actions } from 'flummox';
import axios from 'axios';
import uuid from '../utils/uuid'
import Router from 'react-router';
//we return our films from our database
let serverFetchFilms = async function(apiendpoint) {
console.log('fetching films in film actions');
let films = await ax... | true |
f652dc6f38ea674206ee46ea88175e568cd46954 | JavaScript | ahklump/battleship-game | /battleship/public_html/js/AJAXinit.js | UTF-8 | 1,202 | 3.1875 | 3 | [] | no_license | /**
* CSC 220 Final Project
* Battleship
* Allie Klump, Tasaday Green, Denise Nava
*/
//Initialize IDs
var gameID;
var clientID;
var IDs;
//Send initialization request to server
function init() {
AJAXObj = new XMLHttpRequest();
AJAXObj.onload = initLoad;
AJAXObj.onerror = function() {... | true |
bb22db8a97f2d9b7c8c29f6341da894b5b297db2 | JavaScript | muellmatto/damnthepage | /damn95/static/damn.js | UTF-8 | 10,903 | 2.90625 | 3 | [] | no_license | "use strict";
/*
clock
*/
function startTime() {
var today = new Date();
var h = today.getHours();
var m = today.getMinutes();
var s = today.getSeconds();
m = checkTime(m);
s = checkTime(s);
document.getElementById('clock').innerHTML =
h + ":" + m + ":" + s;
var t = setTimeout(startTime, 500);
}
f... | true |
3a0d4d5e0588753df9a148579762f240515c4b42 | JavaScript | sodes-proxy/D3-Labs | /brewery/js/main.js | UTF-8 | 2,049 | 3.015625 | 3 | [] | no_license | var margin = {top: 10, right: 10, bottom: 100, left:100};
var width = 600;
var height = 400;
var svg = d3.select("#chart-area").append("svg")
.attr("width", width + margin.right + margin.left)
.attr("height", height + margin.top + margin.bottom);
var group= svg.append("g")
.attr("transform","translate("+margin.lef... | true |
62d543dcc747d2e78d81f2a2bc7d1206fb7f484e | JavaScript | shambakey1/writing | /DAC2012/registeration/roundtrip_flight/Flight Details_files/custom-script.js | UTF-8 | 17,987 | 2.65625 | 3 | [] | no_license | //Baynote custom.js for Expedia
//2:34 PM 09/02/2010
//Version 0.0.0
function bnCustomSearchPolicyCheck() {
return true;
}
var BN_BASE_URL = "http://www.expedia.com/pub/agent.dll";
//JS StringBuffer
function baynote_StringBuffer() {
this.buffer=[];
}
//Append a string to the current buffer
baynote_StringBuffer.pro... | true |
e46c3ebcfb55562f3f01701d2b6b44e9fd0b033c | JavaScript | oksanashvets/studyproject | /W3/W3D2/password.js | UTF-8 | 789 | 3.59375 | 4 | [] | no_license |
var allArgs = process.argv;
var password = allArgs[2];
function obfuscate(subStr) {
let obfuscatedPassword = "";
for (let currentChar = 0; currentChar < subStr.length; currentChar++) {
let currentLetter = subStr[currentChar];
if (currentLetter === "a" || currentLetter === "A") {
currentLetter = ... | true |
52c33978c44f6b5bedea05102ea201ed6c3e36e2 | JavaScript | maangeloatienza/yummy-pizza-admin-ui | /src/components/users/Users.js | UTF-8 | 3,083 | 2.53125 | 3 | [] | no_license | import React, {useState,useEffect} from 'react';
import {getUsers} from './../../api/apiCall';
import Pagination from './../pagination/pagination';
import UserItem from './UserItem';
const Users = () =>{
const [users,setUsers] = useState([]);
const [count, setCount] = useState(0);
const [currentPage, setCu... | true |
f4a3fcd97644fd3df6fff80e4d2acdde98852ace | JavaScript | imagentleman/reactjs-time-picker | /index.js | UTF-8 | 3,906 | 2.75 | 3 | [
"MIT"
] | permissive | import React from "react";
const leftPad = (number) => {
return number.toString().padStart(2, "0");
};
const generateList = (start, end, step) => {
let list = [];
for (let i = start; i <= end; i = i + step) {
list.push(leftPad(i));
}
return list;
};
const TimePicker = (props) => {
const {
class... | true |
0a3ac518cc0bcdc596b3a938f7260c7d2fec3136 | JavaScript | sparkskapil/P5Basics | /Amazing-brick/columns.js | UTF-8 | 443 | 2.890625 | 3 | [] | no_license |
hurdle = function(){
this.width = 20;
this.pos = createVector(width-this.width,0);
this.vel = createVector(-1.5,0);
this.height = floor(random(1,8))*50;
this.gap = 140;
this.update=function(){
this.pos.add(this.vel);
}
this.show=function(){
fill(0,200,0);
rect(this.pos.x,this.pos.y,this.wid... | true |
0d8b5ff1a46392c9f436c7e3b0ba9ed68a8f0dd1 | JavaScript | ariutta/cross-platform-text | /gulp/util/notification.js | UTF-8 | 2,100 | 2.671875 | 3 | [
"Apache-2.0"
] | permissive | var _ = require('lodash');
var highland = require('highland');
//var inquirer = require('inquirer');
var notifier = require('node-notifier');
/* Neither of these work on Mac OS X 10.8 because this.options.customPath
* causes an error to be thrown because this.options does not exist
var notifyA = highland.ncurry(1, not... | true |
41d9e19703cf41e2315b955a91459d7f56e77b1e | JavaScript | telujyothsna/module1-solution | /app.js | UTF-8 | 1,045 | 2.75 | 3 | [] | no_license | (function () {
'use strict';
angular.module('LunchCheck', [])
.controller('LunchCheckController', LunchCheckController);
function LunchCheckController ($scope) {
$scope.inputText = '';
$scope.class = '';
$scope.getStrCount = function() {
var inputText_length;
var inputElements;
if($scope.inputText !... | true |
1e380be0ff141f61e588f58088d6a7fce1924d41 | JavaScript | loggar/js | /js-es.async-promise/promise-race-any/promises.race.4.js | UTF-8 | 301 | 2.875 | 3 | [
"MIT"
] | permissive | var foreverPendingPromise = Promise.race([]);
console.log(foreverPendingPromise);
setTimeout(function () {
console.log('the stack is now empty');
console.log(foreverPendingPromise);
});
// logs, in order:
// Promise { <state>: "pending" }
// the stack is now empty
// Promise { <state>: "pending" } | true |
5da63d6c95f991f9448b9569640cad925f10104d | JavaScript | yeahJwczjzlTest/git4jwczjzl | /old_demos/movie/scripts/player.js | UTF-8 | 2,576 | 3.21875 | 3 | [] | no_license | /**
* Created by u._.u on 2016/11/28.
*/
function createVideoControls() {
// 获取所有的 video 标签
var vids = document.getElementsByTagName("video");
//遍历 vids 每个 video 标签执行一下 addControls()函数;
for (var i=0;i<vids.length;i++){
addControls(vids[i]);
}
}
function addControls(vid) {
// 移除video标... | true |
5e03c97ed8f7968f8e0f8a0050d194ccd5d95656 | JavaScript | Hitagi710/Estudo_JS | /Curso Udemy JS/fundamentos/nullUndefined.js | UTF-8 | 468 | 3.53125 | 4 | [] | no_license | let valor//nao inicializada
console.log(valor)
valor=null//ausencia de valor
console.log(valor)
//console.log(valor.toString()) Erro!
const produto={}
console.log(produto.preco)
console.log(produto)
produto.preco=3.50
console.log(produto)
produto.preco=undefined//evite atribuir undefined
console.log(... | true |
bc7c39ba4f68273f49f69fa48deb2f8d421a4b5c | JavaScript | paulchan14/no-db-project | /server/controllers.js | UTF-8 | 1,195 | 2.84375 | 3 | [] | no_license |
////User Data///
var playlistData = {
playlistName: "GamerTrax Playlist",
playlistContents: []
}
////////////
///////////////
module.exports = {
create: (req, res) => {
playlistData.playlistContents.push(req.body);
res.status(200).send(playlistData);
console.log('New track added... | true |
3ad44eca21e981d76ec5675ef66623cb8e5a3e08 | JavaScript | minhpvtfx00930/Algorithm-Training | /Codelearn/Sasuke 31/firstBigger.js | UTF-8 | 90 | 2.65625 | 3 | [] | no_license | function firstBigger(a,b){
return b %a == 0 ? b+a : Math.ceil(b/a)*a;
} | true |
6d9a47263309384d6d464962822557e98d2c152f | JavaScript | pataiadam/data-server | /assets/js/custom.js | UTF-8 | 2,436 | 2.8125 | 3 | [
"Apache-2.0"
] | permissive | function selectSeason(){
var matchesNumber = parseInt($('.'+$( ".liga:checked")[0].value+'-matches')[0].innerText);
console.log(matchesNumber);
$( "#slider-range" ).slider( "option", "max", matchesNumber ).slider( "option", "values", [ 0, matchesNumber ] );
$( "#amount" ).val( $( "#slider-range" ).slider( "val... | true |
f0588fc662bb909a186e793e4e3ba63f701008fa | JavaScript | mariazangelova/cool-story-client | /src/components/StoryCarousel.js | UTF-8 | 2,861 | 2.546875 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
//import Carousel from "react-bootstrap/Carousel";
import { useDispatch, useSelector } from "react-redux";
import { Container, Button } from "react-bootstrap";
import { likeStory, deleteStory } from "../store/user/actions";
import { getHomepageThunk } from "../store/p... | true |
c43e0f2e60c8d83e0c2af41a46303ec6a1d83ecc | JavaScript | eduvallejo/sightReading | /js/init1.js | UTF-8 | 1,480 | 2.875 | 3 | [] | no_license | function init(argument) {
audio.play();
//eventos asociados a teclas
// left arrow 37
// up arrow 38
// right arrow 39
// down arrow 40
window.onkeydown = function(e) {
// console.log("keyDown");
var timestamp = new Date().getTime();
// console.log("timestamp : " + timestamp);
//13 enter, 8 backs... | true |
8fe67d6523f59b6593ee8e6cc29e530bb4632c40 | JavaScript | million17/learn-nodejs | /javascript-tutorial/challenges/template_literals.js | UTF-8 | 544 | 3.390625 | 3 | [] | no_license | console.log(`first line
second line`);
const a = 5;
const b = 6;
console.log(`This a + b : ${a+b}
This a * b : ${a * b}`);
console.log('--------------Tagged Template Literals---------');
var c = 6;
var d = 12;
function foo(strings, ...value) {
console.log('.' + strings[0] + '.');
console.log('.' + strings[1] ... | true |
f77a5a92c1992e6e6fa9da335fe8c4b3d541380c | JavaScript | Kejjden/kejjden.github.io | /game/js/classes/ext/door.js | UTF-8 | 273 | 2.765625 | 3 | [] | no_license | var Door = (function () {
function Door(x, y) {
this.state = 0;
this.x = 0;
this.y = 0;
this.x = x * 32;
this.y = y * 32;
this.image = new Image();
this.image.src = "images/door.png";
}
return Door;
})();
| true |
2fb954bfc4a1a82f81c76e3dbe739b32f855322d | JavaScript | ApostolSavov/SoftUni-JavaScript-courses | /JS Advanced/function context/fifthlecex.js | UTF-8 | 1,991 | 3.625 | 4 | [] | no_license | class Company {
constructor() {
this.departments = []
}
addEmployee(name, salary, position, department) {
if (!name || !position || !department || [null, undefined, ""].includes(salary) || salary < 0) throw new Error("Invalid input!");
let obj = this.departments.find(x => x.departm... | true |
f765901448d4e1e927eb483f0647207badb62e5e | JavaScript | HernanEduardoGonzalesFranco/TallerPaginasProyectos | /src/componentes/tareas/MostrarTareas.js | UTF-8 | 2,297 | 2.5625 | 3 | [] | no_license | import React, { Fragment } from 'react'
import Tarea from './Tarea'
const MostrarTareas = () => {
/* Crea un objeto tareas*/
const tareas =[
{nombre:'Elegir Sistema Operativo', estado:true},
{nombre:'Elegir Base de datos', estado:false},
{nombre:'Elegir Lenguaje', estado:true},
... | true |
aa632c762475e211fe2c0a96b0dfba2331df6a79 | JavaScript | nolangendron/dangerrator | /src/weatherForecast.js | UTF-8 | 1,384 | 2.703125 | 3 | [] | no_license | const request = require('request');
const cheerio = require('cheerio');
export const formatWeather = ($) => {
const data = {
rain: [],
snowFall: [],
highTemp: [],
lowTemp: [],
freezingLevel: [],
wind: []
}
$('.forecast__table-rain > td > span.forecast__table-value').each((i, el) => {
... | true |
bca7e1cb47435d5e88201d03c2232daea558d22a | JavaScript | benjaminkwhite/chromeZoom | /js/background.js | UTF-8 | 1,568 | 2.671875 | 3 | [] | no_license | var currentRatio = 1;
var ratio = 1;
function zoom(ratio) {
currentRatio = ratio / 100;
chrome.tabs.query({
active: true,
currentWindow: true
}, function(tabs) {
zoomtab(tabs[0].id, currentRatio);
});
}
function zoomtab(a, b) {
localStorage.setItem("number", Math.round(b * 100));
chrome.tabs.q... | true |
39e32247d6240e7986c7e83c85e9c651ad826e15 | JavaScript | Jordang3177/Learning | /react/anniversary-present/src/Components/Modules/Year1/October/October.js | UTF-8 | 946 | 2.578125 | 3 | [] | no_license | import React from "react";
import classes from "./October.module.css";
import Puppy1 from "../../../../Assets/Pictures/Year 1/October/Puppy1.jpg";
import Puppy2 from "../../../../Assets/Pictures/Year 1/October/Puppy2.jpg";
import Puppy3 from "../../../../Assets/Pictures/Year 1/October/Puppy3.jpg";
import Messy1 from ".... | true |
bf422e0151a7a6436d07547fa6cc8c5b73944a33 | JavaScript | codaxy/cxjs | /packages/cx/src/svg/util/Rect.js | UTF-8 | 2,055 | 3.125 | 3 | [
"BSD-3-Clause",
"MIT"
] | permissive | import {isNumber} from '../../util/isNumber';
import {isArray} from '../../util/isArray';
export class Rect {
constructor(config) {
Object.assign(this, config);
}
width() {
return this.r - this.l;
}
height() {
return this.b - this.t;
}
valid() {
return this.r > this.l &... | true |
5acd8bee594aded63819a964897a42f7df4671b1 | JavaScript | raduseremet/QuizGame-JS | /script.js | UTF-8 | 2,411 | 3.625 | 4 | [] | no_license | var currentQuestion = 0;
var score = 0;
var questionEl = document.getElementById('question');
var container = document.getElementById('quiz-container');
var opt1 = document.getElementById('opt1');
var opt2 = document.getElementById('opt2')
var opt3 = document.getElementById('opt3')
var opt4 = document.getElementById... | true |
18046b869c2f09037d50897e4c119435e745143e | JavaScript | Xia-Ao/wukong_web | /src/common/auth.js | UTF-8 | 1,228 | 2.765625 | 3 | [] | no_license | /**
* @author: xiaao
* @data: 2019/6/26 22:42
* @description:
*/
/**
* 用户角色值get set方法
* @type {{set: roleTypeStorage.set, get: (function(): (string | any))}}
*/
export const roleTypeStorage = {
/**
* 设置role值
* @param {string/Number} value
*/
set: (value) => {
window.sessionStorage.setItem('roleT... | true |
3dfd60f07b2cc7a26442928416b7b0a501ef553e | JavaScript | majid-binary/binary-next-gen | /src/_utils/DateUtils.js | UTF-8 | 198 | 2.75 | 3 | [] | no_license | export const epochToDateString = (epoch) => {
if (!epoch) {
return 'YYYY-MM-DD';
}
const d = new Date(epoch * 1000);
const s = d.toISOString().slice(0, 10);
return s;
};
| true |
4e6a9c9f147f674ebddeef86e2376433b6c99e1c | JavaScript | sajjadmrx/discord.js-banner | /index.js | UTF-8 | 1,222 | 2.75 | 3 | [] | no_license | const axios = require('axios');
class banner {
constructor(token) {
if (!token)
throw new Error('Token is required')
this.token = token;
}
async get(userID, size = 4096) {
try {
if (!size)
size = 4096
if (!parseInt(size))
... | true |
ea84aae86ed0b939c5ef47426c19316de3545d45 | JavaScript | ojaswa1942/hn-search | /API/controllers/query.js | UTF-8 | 739 | 2.5625 | 3 | [
"MIT"
] | permissive |
const handleQueryUpdate = (req,res,db)=>{
const {query, email} = req.body;
const queryInsert = {
text: 'INSERT INTO history(email, query, date) VALUES($1, $2, $3)',
values: [email, query, new Date()]
}
db.query(queryInsert)
.then(() =>{
return res.status(200).json('Updated');
})
.catch(err => res.status... | true |
ab7d94c8a8b9eda534a72b27827bc3b87d187cb3 | JavaScript | olehanyak/gromCode-JS | /lesson_6/hw8/index.js | UTF-8 | 246 | 3.8125 | 4 | [] | no_license | const array = [1, 2, 3, 4];
function cloneArr(arr) {
let newArr = [];
for (let i = 0; i < arr.length; i++) {
newArr.push(arr[i]);
}
return newArr;
}
const myArr = cloneArr(array);
console.log(myArr);
console.log(array); | true |
efb05e32cb78a4fa6a8d8e457a75c558f0b59a39 | JavaScript | arunprabu/blog-crud-redux-trivium | /src/reducers/postReducer.js | UTF-8 | 2,213 | 3.6875 | 4 | [] | no_license | /*
What's a Reducer?
It is a function that takes the current state and
an action that was dispatched as it’s parameters and returns the new state.
*/
import { ADD_POST, DELETE_POST, EDIT_POST, GET_POSTS, GET_POST_BY_ID } from "../actions/types";
// initialState for Posts Feature
const initialState = {
loa... | true |
c3d1f148702d7e770c9175058ca609d9891f010e | JavaScript | amanvojha/kayak_prototype | /admin_frontend/src/reducers/home.js | UTF-8 | 4,785 | 2.578125 | 3 | [] | no_license | import initialState from './initialState';
const reducer = (state = initialState, action) => {
switch (action.type) {
case "GET_REVENUEBYTYPE_SUCCESS" :
var totalRevenue=0,totalOrders=0;
for(var i=0; i<action.payload.revenueByType.length; i++){
totalRevenue += action.payload.reve... | true |
d8988f76830ffd9c4063bcaf6ea28bc8799a41c1 | JavaScript | jussijartamo/docs-editor | /dist/numberRange.js | UTF-8 | 785 | 2.75 | 3 | [
"MIT"
] | permissive | "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
// @overflow
function numberRange(from, to, increment) {
if (increment && Math.round(increment) !== increment) {
// increment has decimal, need to fix the float point adding issue.
var scale = 100000;
var range = numberRange(... | true |
a0b7e2677588671536ab272c5a423d3f46da69b2 | JavaScript | liyanyan19940914/react-redux-todolist | /public/js/index.js | UTF-8 | 2,569 | 2.796875 | 3 | [] | no_license | import React from 'react';
import {render} from 'react-dom';
import {createStore} from "redux";
import reducer from './reducers/reducer';
const store = createStore(reducer);
class App extends React.Component {
add(text) {
store.dispatch({type: 'ADD', text});
}
toggle(index){
store.dispatch... | true |
9c00d1e1d742078a791a1580ad927d6891e5e4fd | JavaScript | codewithamitpatil/Authentication-2.0 | /models/user.model.js | UTF-8 | 2,857 | 2.59375 | 3 | [] | no_license |
const mongoose = require('mongoose');
const bcrypt = require('bcrypt');
const httpErrors = require('http-errors');
// User Schema
const UserSchema = mongoose.Schema({
username : {
type:String,
required:true,
unique:true
},
... | true |
6827fd1e748ee544d180b7f4e7084b03988fe4ab | JavaScript | XIOZ119/JS-final | /js/background.js | UTF-8 | 817 | 2.890625 | 3 | [] | no_license | const colors = [
"#ef5777",
"#575fcf",
"#4bcffa",
"#34e7e4",
"#0be881",
"#f53b57",
"#3c40c6",
"#0fbcf9",
"#00d8d6",
"#05c46b",
"#ffc048",
"#ffdd59",
"#ff5e57",
"#d2dae2",
"#485460",
"#ffa801",
"#ffd32a",
"#ff3f34"
];
const backgroundColor = docu... | true |
ebf108ba565ed00742a3eecec12de48938d7b2ed | JavaScript | jason-nordheim/healthy | /server/tests/api.routes.foods.test.js | UTF-8 | 12,890 | 2.65625 | 3 | [] | no_license | const supertest = require("supertest");
const prettyFormat = require("pretty-format");
const app = require("../src/api");
const { disconnect, connect } = require("../src/config/config.mongoose");
const { createTestUser, createTestFood } = require("./helpers");
describe("FOOD Routes", () => {
let bearerToken = undefi... | true |
d8f85bf456e5ed1ce681f89a07d44a7f595e321e | JavaScript | safurazaheer/Realtime-Pizza-Delivery-App | /app/models/menu.js | UTF-8 | 593 | 2.515625 | 3 | [] | no_license | //model ka naam singular h toh table ka naam pulral hoga, eg menus hoga yaha table(collection) ka naam
const mongoose = require('mongoose')
const Schema = mongoose.Schema
const memuSchema = new Schema({
name:{type: String, required : true},
image:{type: String, required : true},
price:{type: Number, requi... | true |
135934fc9bed0aafd8fd9c99367eec4c75b088b3 | JavaScript | alvarol87/mis_proyectos | /api/app.js | UTF-8 | 1,294 | 2.84375 | 3 | [] | no_license | //configuracion de express
//se importa al index
'user strict'
var express = require('express');
//convierte las peticiones a obejto de javascript
var bodyParser = require('body-parser');
var app = express();
//cargar rutas
/* una vez que se tenga las clases con rutas se deben cargar */
var user_ro... | true |
956063686e266d7cec77972318a2beb91e65fcb7 | JavaScript | travisoneill/Paratrooper | /lib/turret.js | UTF-8 | 1,089 | 3.140625 | 3 | [] | no_license | //draws stationary pieces of turret
class Turret {
constructor(canvas){
this.canvas = canvas;
this.ctx = canvas.getContext('2d');
this.status = true;
}
draw(){
let center = this.canvas.width / 2;
let width = 96;
let height = 48;
let ground = 40;
let top = this.canvas.height - grou... | true |
6c9f790afadf37fda5f2e87904aed2e9ba251e92 | JavaScript | lsylvain1726/petfinder | /src/components/ListPets.js | UTF-8 | 1,780 | 2.640625 | 3 | [] | no_license | import React, { useEffect, useState, Fragment } from 'react';
import Pet from "./Pet"
import HeroHeader from "./HeroHeader"
const ListPets = props => {
const [petType, setPetType] = useState([])
useEffect(() => {
fetch('/api/v1/pets')
.then(response => {
if (response.ok) {
... | true |
6cffdca74509be7691923cdc01689f4df1db55ec | JavaScript | Julie2107/936943-cinemaddict-11 | /src/components/menu/menu.js | UTF-8 | 2,368 | 2.8125 | 3 | [] | no_license | import AbstractComponent from "../abstract-component.js";
const MenuClass = {
MOVIES: `main-navigation__item`,
STATS: `main-navigation__additional`
};
const MenuItem = {
MOVIES: `movies`,
STATS: `stats`
};
const createNavItem = (filter) => {
const isCreateCount = filter.name !== `All movies` ? `<span class... | true |
214045d397979a2a1dd8c15cdbf35617376b1fb1 | JavaScript | lucassoares-eng/prati-corollas | /scripts/grafico_de_linha.js | UTF-8 | 4,567 | 3 | 3 | [] | no_license | function grafico_de_linha(div, dados) {
apagar_grafico(div)
// set the dimensions and margins of the graph
var margin = {top: 20, right: 10, bottom: 20, left: 40},
width = 370 - margin.left - margin.right,
height = 145 - margin.top - margin.bottom
// append the svg object to the body of the pa... | true |
5bdac9a487e95c2638734dad2f635f6775f2eb97 | JavaScript | mtalarczyk/Organizer | /js/app-calendar.js | UTF-8 | 21,317 | 3.0625 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", function(){
//Funkcja odpowiedzialna za pobranie aktualnej daty z serwera
var newDate = function(){
var tmp = null;
$.ajax({
'async': false,
'url': "./php/date.php",
'data': {},
'success': function(data){
tmp = da... | true |
91156b457899737edbb23fc48d1a6f3615bcb667 | JavaScript | nngocjade/cd-w9-tues-express-js | /controllers/user.controller.js | UTF-8 | 863 | 3.015625 | 3 | [] | no_license | const fs = require("fs");
const userController = {};
userController.register = (req, res, next) => {
//Check whether email exists
//Read data in db.json and find the user with that email
const { name, email, password } = req.body;
const rawData = fs.readFileSync("db.json");
let data = JSON.parse(rawData);
... | true |
a167c57c3c627f4790fadff1dcd239ed582ca769 | JavaScript | Montana-Code-School/nxtlvlgame | /src/states/Breakout.js | UTF-8 | 3,458 | 2.546875 | 3 | [
"MIT"
] | permissive | import Phaser from 'phaser';
export default class Breakout extends Phaser.State {
constructor () {
super();
this.score = 0;
}
preload () {
this.load.image('paddle', 'assets/breakout/paddle.png');
this.load.image('brick', 'assets/luigi/star.png');
this.load.image('sky', 'assets/breakout/starsB... | true |
79799382c3370592d1f6196a08041d1d4800417f | JavaScript | JoaoPMGI/Exercicios-com-ReactJS | /src/App21.js | UTF-8 | 702 | 3.5 | 4 | [] | no_license | import './App.css';
/*
Efetuar o cálculo e a apresentação do valor de uma prestação em atraso, utilizando a fórmula
PRESTACAO ← VALOR + (VALOR * TAXA/100) * TEMPO).
*/
// vars space
var tempo = prompt("Informe o tempo de atraso: ");
var valor = prompt("Informe o valor: ");
var taxa = prompt("Informe o valor da taxa:... | true |
d867419166b46d286a2eee6a58d2972ff393a7c9 | JavaScript | bilasyurii/asteroids_youtube | /js/utils/vec2.js | UTF-8 | 762 | 3.46875 | 3 | [] | no_license | export default class Vec2 {
constructor(x, y) {
this.x = (x === undefined ? 0 : x);
this.y = (y === undefined ? this.x : y);
}
set(x, y) {
this.x = x;
this.y = y;
return this;
}
add(v) {
this.x += v.x;
this.y += v.y;
return this;
}
sub(v) {
this.x -= v.x;
this.y ... | true |
7f1641c28576bd3326afa4eec598728476334854 | JavaScript | Matheus216/task-trello | /frontend/js/Panel.js | UTF-8 | 3,549 | 2.6875 | 3 | [] | no_license | function searchPanel() {
searchPanelPromise()
.then(response => {
response.panel.map(panel => {
appendHtmlPanel(panel);
})
});;
}
function searchPanelPromise() {
return new Promise((resolve, reject) => {
document.getElementById("painel").innerHTML... | true |
3c48e7abac8cfe11228ba10d58e6b8ddc13ed52a | JavaScript | niagr/reels-electron | /build/js/GenreSelector.js | UTF-8 | 2,071 | 2.84375 | 3 | [] | no_license | var ITEM_ALL = {
id: -1,
name: "All"
};
var NavBar = (function () {
function NavBar(_$container, callback) {
if (!_$container) {
throw new Error('Invalid container element.');
}
else
this.$container = _$container;
this.$container.addClass('n... | true |
4557b899eb63b10d38fe3d19bb7adfbadf3d00b3 | JavaScript | JamesTanGit/GUI | /HW7/js/index.js | UTF-8 | 2,100 | 3.5 | 4 | [] | no_license | /*
James Tan
James_Tan@student.uml.edu
UMass Lowell - COMP 4610 GUI Programming I
November 24 2019
*/
/*Sources: W3Schools*/
/*This function will be executed on click of the submit button*/
function myFunction() {
/*These represent the horizontal and vertical boundary data from the form*/
var... | true |
410e5c37b50e963134d6557c31c9bd202e493410 | JavaScript | hhking/leetcode-javascript | /utils/linked.js | UTF-8 | 606 | 3.734375 | 4 | [] | no_license | // 生成链表节点
function ListNode(val) {
this.val = val;
this.next = null;
}
// 数组转成链表结构
function array2Linked(arr) {
let head = new ListNode(arr[0]);
let i = 1;
let curr = head;
while (i < arr.length) {
let val = arr[i];
curr.next = new ListNode(val);
curr = curr.next;
i++;
}
return head;
}... | true |
cb0c217a05da8b05a59a2922b09ca26abf24b174 | JavaScript | slaveofgod/sog-validator | /src/framework/validator/l/size-validator.js | UTF-8 | 6,120 | 3.125 | 3 | [
"MIT"
] | permissive | Object.assign(sogv, function () {
'use strict';
/**
* @constructor
* @name sogv.SizeValidator
* @extends sogv.BaseValidator
* @classdesc
* <p>The field under validation must have a size matching the given value.</p>
* <p>For <code>string</code> data, value corresponds to the numbe... | true |
d2f73c0bca7be5a62b2fefea1ca17175c4ce5428 | JavaScript | APatrucco/JavaScript | /playing_with_objects.js | UTF-8 | 601 | 3.78125 | 4 | [] | no_license | var users = [{name: "Michael", age:37}, {name: "John", age:30}, {name: "David", age:27}];
console.log(users[1].age);
console.log(users[0].name);
for(var user in users){
console.log(users[user].name +" - "+ users[user].age);
}
// The Peeps We Got At National Harbor
var peeps = [{type: 'chick', color: 'w... | true |
05c5ab9cfffd94366c03772185fc47ea608241e9 | JavaScript | junya-gera/node.myapp | /server/index2.js | UTF-8 | 475 | 2.546875 | 3 | [] | no_license | const http = require("http");
// index1とは別の書き方
// "request"イベントを作成する
const server = http.createServer();
server.on("request", (request, response) => {
// ヘッダー書き込み
// (statusCode, キーバリューでheader)を指定
response.writeHead(200, {"content-Type": "text/plain"});
// 書き込み完了
response.end("Hello Wor... | true |
65f69ea81d52b87ca1a66db2a65e97b55d9b094a | JavaScript | coykitten/gil | /bot.js | UTF-8 | 2,893 | 2.796875 | 3 | [] | no_license | const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === '!ping') {
msg.reply('pong');
}
});
client.on('message', msg => {
if (/^!spongecase/i.test(msg.co... | true |
98dde38bbcf9fce6665c393ec42e9c380841a2ba | JavaScript | RomanJohnson/js-deli-counter-web-062617 | /index.js | UTF-8 | 695 | 3.5 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | console.log ('hello')
var katzDeli = [];
function takeANumber(katzDeliLine, newPerson){
katzDeliLine.push(newPerson);
return (`Welcome, ${newPerson}. You are number ${katzDeliLine.length} in line.`)
}
function nowServing(line){
if (line.length===0) {
return "There is nobody waiting to be served!"
} else{
... | true |
7652bd3e7cf237b35091ddb08898c99241fbd229 | JavaScript | jeonEK/JaviS | /src/KimKyeongEun/table/table.js | UTF-8 | 8,181 | 2.71875 | 3 | [] | no_license | var createTable = function(){
var v = {
codeHtml : '',
codeContent : document.querySelector('.table_code'),
captionText : document.getElementById('captionText'),
colCount : document.getElementById('colCount'),
colsetBox : document.getElementById('colsetBox'),
colBox :... | true |
3118ad518d63d0bb895c39ae73f52e448e01de1c | JavaScript | green-fox-academy/Hedvegia | /week-07/day1/04.js | UTF-8 | 361 | 4.0625 | 4 | [] | no_license | 'use strict';
// Write a program that prints a few details to the console about you
// It should print each detail to a new line.
// - Your name
// - Your age
// - Your height in meters (as a decimal fraction)
//
// Example output:
// John Doe
// 31
// 1.87
let name = 'Germus Hédi'
let age = 22
let height = 1.... | true |
ed4563be9ba2254d3fd9a94123262bd6b24674fc | JavaScript | jsp117/Note-Taker | /server.js | UTF-8 | 1,159 | 2.671875 | 3 | [
"MIT"
] | permissive | var express = require("express");
var path = require("path");
const app = express();
const store = require("./db/store.js");
const unique = require("uniqid");
const fs = require("fs");
var PORT = process.env.PORT || 3000;
// process message as json
app.use(express.json());
// have specific url
app.use(express.urlenco... | true |
3d7248476f781b8508886fb9d7372a1a2371128d | JavaScript | kadamwhite/grunt-codeblock-jscs | /tasks/lib/checker.js | UTF-8 | 1,653 | 2.53125 | 3 | [
"MIT"
] | permissive | 'use strict';
var JSCS = require( 'jscs' );
var extend = require( 'lodash' ).extend;
/**
* Augment a provided configuration object with context-specific rule overrides
*
* @param {Object} jscsOptions A JSCS configuration object
* @return {Object} A JSCS configuration object with specific rules disabled
*/
funct... | true |
0964ab4807322ef99900cd49d7ff4a6972abf047 | JavaScript | Mayadayacoub/my-app | /ReactTenHourCourse/ConditionalRenedraing/ShortCircut.js | UTF-8 | 707 | 2.8125 | 3 | [] | no_license | import React, { useState } from "react";
//short circut evaluation
const ShortCircut = () => {
const [text, setText] = useState("");
const [isError, setIsError] = useState(true);
// const firstValue = text || "Hello first";
// const secondValue = text && "Hello second";
return (
<div>
... | true |
e66841a0809d5a150145d3590f9183bdcca5a168 | JavaScript | ivanyapeter/WDI4_homework | /Ivan_Yapeter/01-javascript/callbacks/callbacks.js | UTF-8 | 718 | 3.65625 | 4 | [] | no_license | console.log('call me back');
// setTimeout(function, miliseconds);
var someTask = function() {
console.log('eat cake');
};
var otherTask = function() {
console.log('drink water');
};
var doSomething = function(task) { // Task argument is just a name, for doSomething function use.
console.log('hey');
console.lo... | true |
18e438ffb715dcaaf9f9ba9e082bf90ec57ab394 | JavaScript | awto/effectfuljs | /packages/core/test/samples/do-while-stmt/body-eff/test1-in.js | UTF-8 | 83 | 2.671875 | 3 | [
"MIT"
] | permissive | (function() {
do {
if (eff(2)) continue;
eff(3);
} while (eff(1));
});
| true |
a4cf98415d721a17ce2c5539ebb2850d4035cfa2 | JavaScript | massimo-cassandro/m-utilities | /archiviati/js-utilities/_fontfaceobserver_loader.js | UTF-8 | 1,653 | 2.84375 | 3 | [
"MIT"
] | permissive | /* global FontFaceObserver, Cookies */
/*
Font face observer loader
Con impostazione manuale dei font da caricare
la funzione va chiamata impostando la variabile font_arry in questa forma:
[
['family', font_properties_obj ],
...
]
in cui:
* family è il nome della famiglia di font
* font_... | true |
00e3fbd19237b82c7cb1d21f71ca35993b1e20a1 | JavaScript | CodeImmersives/es6-classes | /blender-solution.js | UTF-8 | 1,632 | 3.921875 | 4 | [] | no_license |
// ====================BLENDER EXERCISE============================================
// blender class , constructor will take a array of strings ['apple', 'orange']
// have method that turns the blender on or off
// second method called mix that will take the array of strings and blend the words to return a single stri... | true |
933791d76b68ff4207a2f2155d16ed2297d25b79 | JavaScript | dtipson/Maybe | /src/other-types/Coyoneda.js | UTF-8 | 801 | 2.640625 | 3 | [] | no_license | const {I} = require('../../src/other-types/pointfree.js');
function Coyoneda(x, fn) {
if (!(this instanceof Coyoneda)) {
return new Coyoneda(x, fn);
}
Object.assign(this, {x,fn});
}
Coyoneda.prototype.map = function(f){
return Coyoneda(this.x, (...args) => f(this.fn(...args)) );
};
Coyoneda.prototype.... | true |
9674aaeddc57f9ee16d5ae5240e9304fae4ade22 | JavaScript | Dev-Dominic/virtual-memory-visualizer | /OS_frontend_web/js/utils.js | UTF-8 | 3,936 | 3.140625 | 3 | [
"MIT"
] | permissive | // Defines all storage types used within software
// Can be used to emulate basic functioality of Main and Secondary Memory
class BasicMemory {
constructor(MemorySize) {
// Initiallzing memory location
this.memory = [];
for (let i = 0; i < MemorySize; i++) {
this.memory[i] = null;
}
}
// A... | true |
6bb601fc542c7caad80576e11777337b1913a0b2 | JavaScript | Combii/node-todo | /public/index.js | UTF-8 | 3,998 | 3.125 | 3 | [] | no_license | $(document).ready(function () {
var localTodoList = [];
get_todos();
setInterval(get_todos, 5000);
function get_todos() {
$.ajax({
type: 'GET',
contentType: 'application/json',
url: '/todos',
success: function (object) {
setup_t... | true |
97a5a5c8e4d41439cf66ee09d8a8fecea7c9e120 | JavaScript | Dani3lByrne/temp-mode | /12-http.js | UTF-8 | 527 | 2.75 | 3 | [] | no_license | // HTTP module
const http = require('http');
const server = http.createServer((req,res)=>{
if(req.url === '/'){
res.end('HOME PAGE TEST')
}
if(req.url === '/about'){
res.end('this is the about page')
}
// res.end('page not found') not working!
})
server.listen(5000)
// req and res is common practice... | true |
94cd5f80ab497f4f60a9cf36898f71744917656c | JavaScript | r-e-stern/ranked.choice | /src/rcv.js | UTF-8 | 1,929 | 2.9375 | 3 | [] | no_license | function Ballot(a){
this.choices = a;
this.rejectedChoices = [];
this.curr = a[0];
this.currIndex = 0;
this.elimCand = elim => {
this.rejectedChoices.push(elim);
if(this.curr==elim){
do{
this.currIndex++;
this.curr = (this.currIndex<=this.c... | true |
0fc1dcabe457b2de5d082a48c8b6d7102cb8541a | JavaScript | ishwarjagdale/lottie-animation | /assets/js/tests.js | UTF-8 | 863 | 2.734375 | 3 | [] | no_license | var scrollableElement = window; //document.getElementById('scrollableElement');
scrollableElement.addEventListener('scroll', navBack);
function navBack() {
var container = document.getElementById("secNav");
var navbar = container.parentElement;
if (window.pageYOffset >= 40) {
navbar.classList.add(... | true |
06b21d22866651f1c249ee5b2ade128f7ee67d7f | JavaScript | iagokrt/code-katas | /dna.js | UTF-8 | 623 | 3.75 | 4 | [] | no_license | function DNAStrand(dna){
// pega a string DNA
// por exemplo ATGC
// retorna o complemento
// TACG
const complemento = [];
for (let i = 0; i < dna.length; i++) {
// dna = 'AACC'
// must return 'TTGG'
const currentDNA = dna[i];
if (currentDNA == 'A') {
complemento.push('T');
... | true |
1364701fb8db4b8598e9d60884a224423daf9eb3 | JavaScript | rehabcoder/notesnode | /playground/debugging.js | UTF-8 | 104 | 2.953125 | 3 | [] | no_license | var person = {
name: 'MJ'
};
person.age=25;
debugger;
person.name='Malijha';
console.log(person);
| true |
bb0f3fb6b8c9f6b1f4df6ecb4f34061fa5b97ed4 | JavaScript | yamini01020/progressivewebapps | /main.js | UTF-8 | 1,589 | 3.046875 | 3 | [] | no_license | function getfile(file,callback) {
var xhr = new XMLHttpRequest();
xhr.overrideMimeType("application/json");
xhr.open("GET",file,true);
xhr.onreadystatechange=function(){
if(xhr.readyState===4 && xhr.status=="200"){
callback(xhr.responseText);
}
};
xhr.send(null);
}
getfile("data.json",function(text){
... | true |
8513ec8ac6cae811f55c6d963ef7317fdd44f57d | JavaScript | jambion/webdev_bootcamp | /Section 10 - JavaScript Basics Functions/exercises.js | UTF-8 | 542 | 3.8125 | 4 | [] | no_license | console.log("isEven(): ");
function isEven(num) {
if(num % 2 === 0){
return true;
} else {
return false;
}
}
isEven(4);
isEven(21);
isEven(68);
isEven(333);
console.log("factorial()");
function factorial(num) {
// var fact = num;
console.log(num);
if(num === 0){
return 1;
}
for(var i = num; i > 0; i-... | true |
4cbd7258cf9fef89f9cbcabb04191127e3768434 | JavaScript | mounikanarla/algorithms | /primenumber.js | UTF-8 | 1,406 | 3.140625 | 3 | [] | no_license | /**********************************************************************************************
* Execution : 1. default node cmd> node primenumber.js
* @purpose : Display the primenumbers in the range of one to thousand
* @module : primenumbers within the given range
* @au... | true |
f9108a2431433e856f6f163a536cf90cdef23340 | JavaScript | shreekanthsenthil/Nutrichon | /frontend-js/modules/posts.js | UTF-8 | 1,791 | 3.046875 | 3 | [] | no_license | import axios from "axios";
export default class Posts{
constructor(){
this.newPostBtn = document.querySelector(".newpost-create")
this.newPostCloseBtn = document.querySelector(".newpost-modal-close")
this.newPostModal = document.querySelector(".newpost-modal")
this.form = document.q... | true |
310689662a8c24ff7ae8a97a404766702d3c9437 | JavaScript | Brito2327/porjetoWes | /Reservas/WebApp/Content/tests/example/foo.test.js | UTF-8 | 539 | 3.28125 | 3 | [] | no_license | //Documentação: https://www.chaijs.com/guide/styles/
describe('Verifica se os valores são iguais', () => {
test('Um é gual a um', () => {
expect("um").toBe("um");
});
test('dois mais dois é quatro', () => {
expect(2 + 2).toBe(4);
});
test('dois mais três é maior que quatro', () =>... | true |
a735f01c0190ae3f161e27501d1419e4f0b80a81 | JavaScript | rahulr0801/NUCES-circle | /models/applyjob.js | UTF-8 | 6,715 | 2.546875 | 3 | [] | no_license | var mysql = require('../models/mysql');
postApplication = function (req, res) {
if (!req.body.userid || !req.body.jobid) {
res.status(400).json({status: 400, message: "Bad Request"});
} else {
console.log("postApplication " + JSON.stringify(req.body));
var data = {
userid: req.body.userid,
jobid: req.bod... | true |
841a56f82de6325f8b26c04665432cfb95c84f23 | JavaScript | digideskio/first-kingdom | /unit.js | UTF-8 | 1,824 | 2.921875 | 3 | [] | no_license | var hexagon = require('./hexagon.js')
var world = require('./world.js')
exports.createModel = function (x, y, playerId) {
var unitModel = {}
unitModel.type = 'unit'
unitModel.x = x
unitModel.y = y
unitModel.z = -x - y
unitModel.id = Math.round(Math.random() * 1000000000)
unitModel.playerI... | true |
79e2335b99ed745d6cfa20fd6e37089b699fb8fc | JavaScript | pebriv/RandomBot-100Feature | /commands/🎁 Giveaway/start.js | UTF-8 | 4,492 | 2.609375 | 3 | [] | no_license | const { Client, Message, MessageEmbed } = require('discord.js');
var ee = require('../../config/embed.json');
var config = require('../../config/config.json');
const ms = require("ms");
module.exports = {
name: 'g-start',
aliases: ['start', 'giveway'],
category: '🎁 Giveaway',
memberpermission... | true |
26ec004391d017e6d2775ce7f6fcde8b295e74a7 | JavaScript | photographerori/vending-machine | /main.js | UTF-8 | 1,911 | 3.875 | 4 | [] | no_license | // DOM要素の取得
const coin10 = document.getElementById("coin10");
const coin50 = document.getElementById("coin50");
const coin100 = document.getElementById("coin100");
const coin500 = document.getElementById("coin500");
const display = document.getElementById("display");
const colaButton = document.getElementById("cola-but... | true |
460269dd0dd81bcaf8c44a09a5897402f5581b05 | JavaScript | Abidu1/projectFiveMakeup | /src/App.js | UTF-8 | 1,291 | 2.796875 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import axios from 'axios';
import Header from './Header.js';
import DropDown from './DropDown'
import DisplaySection from './DisplaySelection.js'
import Footer from './Footer'
class App extends Component{
constructor() {
super()
this.state = ... | true |
8e77412d54336d8b2f574f91ae200ca99ae224ae | JavaScript | Paratron/JAIL | /spec/jailSpec.js | UTF-8 | 6,471 | 2.625 | 3 | [
"MIT"
] | permissive | describe("JAIL plugin", function(){
afterEach(function(){
$('#container').empty();
});
it("should load the images when visible", function(){
loadFixtures('myfixture.html');
runs(function(){
$('#container img').jail();
});
waitsFor(function(){
return (!!$('img#img1').attr("src").match("sample1.jpg... | true |
0514f665489404d4f6b4cace0f1276461538e42e | JavaScript | Vladi96/JS-Core | /Fundamentals/JS Fundamentals Exam - 10 June 2018/03.Minke Decode.js | UTF-8 | 971 | 3.046875 | 3 | [] | no_license | function minke(input) {
let cuntry = /\b([A-Z]+[a-z]+[A-Z]+)\b/gm
let startIndex = Number(input.shift()), endIndex = Number(input.shift())
let replace = input.shift()
let result = ''
result = cuntry.exec(input)[0].toLowerCase()
result = result.replace(result.substring(startIndex, endIndex + 1),... | true |
3db327462ccf42af18373838aa5d1b1d12c0037b | JavaScript | sarthakgdeveloper/chat-app | /public/js/chat.js | UTF-8 | 4,793 | 2.6875 | 3 | [] | no_license | const socket = io();
const { userName, room } = Qs.parse(location.search, { ignoreQueryPrefix: true })
if ('scrollRestoration' in window.history) {
window.history.scrollRestoration = 'manual'
}
socket.emit('join', { userName, room }, (error) => {
if (error) return console.log(error);
return console.log("... | true |
62243b9d8c100812e0ae8d9212dbac3bf9bbc577 | JavaScript | Huldoser/react-redux-snake | /src/actions/player.js | UTF-8 | 1,763 | 2.59375 | 3 | [
"MIT"
] | permissive | import {EXTEND_TAIL, MOVE_PLAYER, SET_VELOCITY, RANDOMIZE_PLAYER} from "./actionTypes";
import {VALID_MOVES} from "../helpers/constants";
import {
getNewSnakeHeadGridPosition,
newGridPositionIfPlaygroundExceeded,
moveTail,
extendTail
} from '../helpers/player';
export const movePlayer = (currentHeadGri... | true |
8296beb183ce84104fdd42a6c20a291542be4eaf | JavaScript | VaniArora09/payment_gateway | /admin/validator/validator.js | UTF-8 | 1,913 | 2.5625 | 3 | [] | no_license | let responses = require('./../../modules/responses');
let Joi = require('joi');
module.exports ={
adminRegister : adminRegister,
adminLogin : adminLogin,
addItems : addItems,
validateFields : validateFields
};
function adminRegister(req, res, next) {
let schema = Joi.object().keys ({
fi... | true |
dbeaaba1fe034c0935456870f636e9c088a76992 | JavaScript | jorgetejeda/nextjsComponents | /components/Ui-Element/Table_Ui-Element.js | UTF-8 | 2,307 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import { Table } from "react-bootstrap";
import { Pagination } from "react-bootstrap";
// TODO: Create pagination function
class TableUiElement extends Component {
constructor(props) {
super(props);
}
state = {
headers: this.props.headers,
data: this.props.da... | true |
669d3b223b130c11c730de2a96d64117420f643a | JavaScript | johnpcole/Download-Manager | /webassets/javascript/torrent/change_torrenttype.js | UTF-8 | 1,454 | 2.609375 | 3 | [] | no_license |
// Change torrent type
function changeTorrentType(newtype)
{
if (newtype == "movie") {
setFieldValue('moviename', '');
setFieldValue('movieyear', '');
changeAreasState('unknownonlyfields', "Hide");
changeAreasState('tvshowonlyfields', "Hide");
changeAreasState('movieonlyfie... | true |
3bacac7f66cffb1f4274f14f5fbfc10efa233baa | JavaScript | johnathanetchart/LeetCode | /find-smallest-letter-greater-than-target/find-smallest-letter-greater-than-target.js | UTF-8 | 1,279 | 4.1875 | 4 | [] | no_license | /**
* @param {character[]} letters
* @param {character} target
* @return {character}
*/
//input: array of letters
//output: smallest character greater than target
//NOTE: letters wrap around
//if answer index > letters.length - 1 -> subtract letters.length -1 to get index
var nextGreatestLetter = function(let... | true |
87f6dcf76946beca2da6e4f793b031edba8f3074 | JavaScript | markevans/onionjs | /src/onion/router.js | UTF-8 | 3,120 | 2.84375 | 3 | [
"MIT"
] | permissive | define([
'onion/type',
'onion/event_emitter',
'onion/plugins/class_declarations',
'onion/utils/regexp_escape'
], function (Type, eventEmitter, classDeclarations, regexpEscape) {
function Route(name, pattern){
this.name = name
this.pattern = pattern
this.__parsePattern__()
}
Route.prototype = ... | true |
5cd97b46e2002cbc9a39aebe03267349aa159be3 | JavaScript | mont1985/graphql-js | /src/type/__tests__/scalars-test.js | UTF-8 | 15,308 | 2.59375 | 3 | [
"MIT"
] | permissive | // @flow strict
import { expect } from 'chai';
import { describe, it } from 'mocha';
import { parseValue as parseValueToAST } from '../../language/parser';
import {
GraphQLID,
GraphQLInt,
GraphQLFloat,
GraphQLString,
GraphQLBoolean,
} from '../scalars';
describe('Type System: Specified scalar types', () =... | true |
89868306de74d26970e7642a9a23b892bc80dc0f | JavaScript | MHUS25/Notes | /spec/note-list-model-tests.js | UTF-8 | 738 | 2.90625 | 3 | [] | no_license | function testNoteListStartsWithNoNotes() {
var noteList = new NoteList();
assert.isTrue(noteList.getNotes().length === 0);
};
testNoteListStartsWithNoNotes();
function testCanAddAndStoreNewNotes() {
var noteList = new NoteList();
noteList.addNote('My Favourite drink: Fanta');
assert.isEqualTo(noteList.getNo... | true |
a617ce986d5013eebc57a6598b64ca8eb8b88b50 | JavaScript | lanjz/Hello-Word | /blog/docs/React/Demo/like_button.js | UTF-8 | 513 | 2.765625 | 3 | [] | no_license | 'use strict';
const e = React.createElement;
class LikeButton extends React.Component {
constructor(props) {
super(props);
this.state = { count: 0, liked: 'liked' };
}
componentDidMount(){
this.setState({ count: this.state.count + 1 })
this.setState({ count: this.state.count + 1 })
}
updateC... | true |
7df688b7a7c61f429c36b241b5fb3f95befa5af3 | JavaScript | NikolayPaskulov/TankArena | /TanksArena/Scripts/v1/PhysicsEngine.js | UTF-8 | 3,629 | 2.640625 | 3 | [] | no_license | /// <reference path="~/Scripts/libs/babylon.max.js" />
var PhysicsEngine = (function () {
function PhysicsEngine(gravity, ground, scene) {
this.gravity = gravity || BABYLON.Vector3.Zero();
this.ground = ground;
this.scene = scene;
this.meshes = [];
}
PhysicsEngine.protot... | true |