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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
b0ce3f5c21df3b5833bda95d4417429e527c9ada | JavaScript | gurumojo/warthog | /system/src/test/jasmine/unit/Corral.js | UTF-8 | 2,120 | 2.859375 | 3 | [
"MIT"
] | permissive | "use strict";
define([
'underscore', 'pattern/Corral', 'pattern/Horse'
], function(_, Corral, Horse){
describe('Corral', function(){
it('exports a Corral constructor', function(){
expect(typeof Corral).toBe('function');
});
describe('constructor', function(){
it('returns {Corral} new instance', functio... | true |
d6c3109669cdc40f968b2ee0fd2712780f0c94c4 | JavaScript | myusuf011/sanbercode-reactjs-0820-1 | /Quiz-1/ESSAY-4.js | UTF-8 | 418 | 2.8125 | 3 | [] | no_license | var pesertaLomba= [["Budi", "Pria", "172cm"], ["Susi", "Wanita", "162cm"], ["Lala", "Wanita", "155cm"], ["Agung", "Pria", "175cm"]];
var arrayOfObject = [];
for(var i = 0 ; i < pesertaLomba.length ; i++) {
var dataObject = {
nama : pesertaLomba[i][0],
jenisKelamin : pesertaLomba[i][1],
tin... | true |
16a1d039a3449c84fa24bdb020b4660df9b5fb4c | JavaScript | cpeterkin1/CodeRemediation | /Back-End/error_handle/ResponseObject.js | UTF-8 | 324 | 2.6875 | 3 | [] | no_license | class ResponseObject{
constructor(httpCode, type, body){
this.httpCode = httpCode;
this.type = type
this.body = body;
}
returnJSON(){
return{
HTTPCode: this.httpCode,
Body: this.body
}
}
}
export default ResponseObj... | true |
fa3dfbe9f835768fda3f06b69a6272480303622a | JavaScript | leeight/email | /src/client/dep/esui/test/SearchBox.js | UTF-8 | 6,127 | 2.796875 | 3 | [] | no_license | define(function (require) {
var SearchBox = require('esui/SearchBox');
function getInputElement(box) {
return box.main.getElementsByTagName('input')[0];
}
function getButtonElement(box) {
return box.main.getElementsByTagName('span')[0];
}
describe('SearchBox', function () {
... | true |
ec371d2471b54edf34c1f01ab63ad03a85423837 | JavaScript | AlexeyRuchkin/js_lesson | /lesson3/src_hard/js/script.js | UTF-8 | 117 | 2.96875 | 3 | [] | no_license |
var num = 33721;
num = 3*3*7*2*1;
console.log(num);
var r = Math.pow(num,3);
console.log(parseInt(r/100000));
| true |
f2d4dc8275ae603eb0ae15b5933b6b7836c5d8e9 | JavaScript | jackbentley/pulsar | /src/Jadu/Pulsar/Twig.js/Extension/ArrayExtension.js | UTF-8 | 1,976 | 2.53125 | 3 | [
"MIT"
] | permissive | var _ = require('lodash');
function ArrayExtension() {
}
ArrayExtension.prototype.getName = function () {
return 'array_extension';
};
ArrayExtension.prototype.excludeFromArray = function (arr, exclude) {
if (arr === undefined) {
return [];
}
if (typeof(arr) !== 'object') {
return ar... | true |
99567ff086d063a0b193409d40fdd1a532ff8afa | JavaScript | amanahmedkhan/searchHotels | /public/components/hotels/searchHotel.js | UTF-8 | 555 | 2.59375 | 3 | [] | no_license | class searchHotelCtrl {
constructor($http){
this.$http = $http
}
$onInit(){
this.hotels = [];
this.nameFilter = '',
this.priceFilter = 200;
this.$http.get('https://api.myjson.com/bins/tl0bp')
.then(res => {
console.log(res)
this.hotels = res.data.hotels
})
}
nameFilterHotel(name) {
ret... | true |
38b4a08b7315f054f5d7cd393b16f9a93d3550da | JavaScript | vkalokyri/OpenArchivalSystem | /web/treeOperations.js | UTF-8 | 2,383 | 3 | 3 | [] | no_license | var intImage = 2;
function swapImage(i, j) {
switch (intImage) {
case 1:
document.getElementById('treeButton_'+i).src = "images/expand1_f.gif";
intImage = 2
for(var k=0; k<j; k++)
document.getElementById('collection_'+i+'_book_'+k).style.display='none';
return(false);
... | true |
a5c4b32a02b754e7d6dbc60822c3f0c51a10a4fa | JavaScript | ShabanovPavel/rn-template-module | /src/core/rest/fetch.js | UTF-8 | 1,927 | 2.890625 | 3 | [] | no_license | import {Log} from '../../library';
const formDataToString = formDataObject => {
this.formDataString = '';
Object.keys(formDataObject).forEach(key => {
if (formDataObject[key] !== null && formDataObject[key] !== undefined) {
if (typeof formDataObject[key] !== 'object') {
this.formDataString += `&${key}=${enc... | true |
9e73775e6675f1b92a6838cb846f88d55664e62e | JavaScript | a-deep97/Maze-Nest | /public/js/game.js | UTF-8 | 5,421 | 2.71875 | 3 | [] | no_license | /*---------------game configuration json-----------------*/
const config={
type: Phaser.AUTO,
parent:'gameWindow',
scale:{
mode: Phaser.Scale.RESIZE,
autoCenter: Phaser.Scale.CENTER_BOTH
},
scene:{
preload,
create,
update
},
physics:{
default: ... | true |
40e1460b003da6f23b29b6416686c254d945e1d6 | JavaScript | orlov0562/TR-Logic-Image-Uploader | /public/media/js/script.js | UTF-8 | 4,104 | 2.546875 | 3 | [] | no_license | var lightbox = null;
var createGallery = function(imageUrls) {
var gallery = $('<div/>',{class:'gallery'});
for (var i=0; i<imageUrls.length; i++) {
var galleryItem = $('<a/>',{
href:imageUrls[i].image,
class:'gallery-item',
target:'_blank'
});
galleryItem.append($('<img/>',{src... | true |
7775a3fbb8362628ef78eb2ce062082064f8f29c | JavaScript | Agcaiyun/TW | /第一期训练营/task9-gpst-oo-step-by-step/main/practice-3/teacher.js | UTF-8 | 1,896 | 3.25 | 3 | [] | no_license | // const Person = require('./person');
// module.exports = class Teacher extends Person{
// constructor(name,age,clazzes,id){
// super(name,age,id);
// this.clazzes = clazzes;
// }
// introduce(){
// if(this.clazzes.length === 0){
// return `${super.introduce()} I am a T... | true |
840a216be1d13f2e84c4e4483c1611fa936b8669 | JavaScript | evansMensahGand/week8-login | /src/context/state.js | UTF-8 | 1,301 | 2.59375 | 3 | [] | no_license | import create from "zustand"
export const useStore = create((set)=> {
return{
counter:0,
increaseCounter:()=>set(state=>({counter:state.counter+1})),
decreaseCounter:()=>set(state=>({counter:state.counter-1}))
}
});
export const useCart = create((set)=>{
return{
items:[],
totalPrice:()=> (s... | true |
f6824dd1f854cacf8072a5ca095e2ef646c1c78f | JavaScript | reshalem/Fase-0_WEEK-2 | /simple_psudocode.js | UTF-8 | 1,184 | 3.3125 | 3 | [] | no_license | // 1. NEWTON SECOND LAW
// STORE "mass" with value 600 (kg)
// STORE "acceleration" with value 2 (m/s2)
// STORE "force" with no value
// CALCULATE "mass" times "acceleration"
// SET "force" value with calculation result
// DISPLAY "force"
// 2. TAHUN KABISAT
// STORE "tahun" with any number value
// IF (("tahu... | true |
b9fcb688c70d9932529c3beda93f3ed21ea061cf | JavaScript | Cisen07/rotating-snowflake | /Snowflake/snowflake.js | UTF-8 | 11,480 | 2.828125 | 3 | [] | no_license | "use strict";
var canvas;
var gl;
var numTimesToSubdivide = 1; // 递归次数
var points = []; // 生成的所有顶点的位置
var program;
var bufferId;
var colorbufferId;
var vertices = [ // 初始顶点位置
vec2( -1.732 * 0.3, -1 * 0.3),
vec2( 0 * 0.3, 2 * 0.3),
vec2( 1.732 * 0.3, -1 * 0.3)
];
var velocities = [ // 可选的几种... | true |
9f8832b2a657548046c4a1ad8b3bd3a1d7c238cd | JavaScript | FishNon/arithmetic-demo | /demo02/demo01.js | UTF-8 | 3,107 | 4.3125 | 4 | [] | no_license | // 实现列表类构造函数
function List() {
this.listSize = 0;
this.pos = 0;
this.dataStore = [];
this.clear = clear;
this.find = find;
this.toString = toString;
this.insert = insert;
this.append = append;
this.remove = remove;
this.front = front;
this.end = end;
this.prev = prev;
... | true |
2d272fe85e557e025f6979a53874c26fc6139682 | JavaScript | klawil/Ionic-Hockey-Score-Watcher | /app/index.js | UTF-8 | 6,963 | 2.78125 | 3 | [] | no_license | import * as messaging from 'messaging';
import document from 'document';
import store from './redux.js';
const elements = {
screens: {
loading: document.getElementById('loading'),
no_games: document.getElementById('no-games'),
game_list: document.getElementById('game-list'),
},
buttons: {
previou... | true |
5a065e66d4488e12408366ca2e3e9117b5a66f99 | JavaScript | Fik-shun/Fik-shoot | /js/components/Coin.js | UTF-8 | 362 | 2.921875 | 3 | [] | no_license |
function Coin(scene, x, z) {
const radius = 0.2;
const geometry = new THREE.SphereGeometry( radius, 16, 16 );
const material = new THREE.MeshBasicMaterial( { color: 0xfbb000 } );
this.model = new THREE.Mesh( geometry, material );
this.model.position.set(x, 0, z);
scene.add(this.model);
this.destroy = funct... | true |
9fd966a46997db0e9d7be64f0a8d370f84ac4e0b | JavaScript | eidietrich/mt-election-maps | /components/Text.js | UTF-8 | 1,183 | 3.25 | 3 | [] | no_license | // Text
// Renders a div with html text
// TODO: Make this use a single string of html stored in props.data
// TODO: Clean up d3 boilerplate
var Text = function (props){
console.log('Text called');
this.data = props.data;
this.element = props.element;
this.height = props.height;
this.heightNotDefined = !pro... | true |
136274352d41e3064c370c19b133b577852be94e | JavaScript | yjsyyyjszf/dicom-react | /src/model/load-selected-files.js | UTF-8 | 449 | 2.703125 | 3 | [] | no_license | const readFileAsBytes = (file) => {
const fileReader = new FileReader();
return new Promise((resolve, reject) => {
fileReader.onload = () => {
resolve(new Int8Array(fileReader.result));
};
fileReader.readAsArrayBuffer(file);
});
};
const loadSelectedFilesAsBytes = async (fileList) => {
const... | true |
38b28f1aac0570a081ce38ced48e2d448d45f6c7 | JavaScript | AmitAnvekar24/code_practice | /01_sliding_window/LongSubstringKDistinct.js | UTF-8 | 1,395 | 4.03125 | 4 | [] | no_license | /*
Problem Statement #
Given a string, find the length of the longest substring in it with no more
than K distinct characters.
*/
// Complexity --> O( N + N ) --> O(N) --> Optimal solution
function LongSubstringKDistinct( str, K ) {
let charFrequency = {};
let ans = 0, diff = 0, startWindow = ... | true |
0d6f86f51cf19d140981f942c76d98a4fa0e01e5 | JavaScript | Mellisah-lisah/pizza-me | /js/script.js | UTF-8 | 2,067 | 3.171875 | 3 | [
"MIT"
] | permissive | function getSizeCost() {
let selectedSize = document.getElementById("size").value;
return parseInt(selectedSize);
}
function getCrustCost() {
let selectedCrust = document.getElementById("crust").value;
return parseInt(selectedCrust);
}
function getNumber() {
var selectedNumber = document.getElementById("numb... | true |
4ad57312c2e5f58724a7959f35869d2c8680d26e | JavaScript | hectorlopezv/javascript-from-zero-to-hero | /objectos/js/12-app.js | UTF-8 | 309 | 3.34375 | 3 | [] | no_license | //Object literal
const pr = {
nombre: "Monitor 20 pulgadas",
precio: 300,
dispoible: true,
}
// Object Constructor
function Producto(nombre, precio)
{
this.nombre = nombre;
this.precio = precio;
this.dispoible = true;
}
const px1 = new Producto("carrito", 500);
console.log(px1); | true |
39741150348b2eb70d42dd4f2c7bc34b1d5eac6d | JavaScript | ajmueller/angularjs-timezone-example | /client/services/events.js | UTF-8 | 510 | 2.71875 | 3 | [] | no_license | (function(angular) {
var EventsService = ['$http', function($http) {
var baseUrl = '/api/events/';
return {
create: create,
getAll: getAll
};
function create(event) {
return $http.post(baseUrl, event)
.then(function(response) {
return response.data;
});
}
function getAll() {
ret... | true |
2f587dd5b0faac1ab79bdd8e3f30aff5ece776d7 | JavaScript | nameofname/phantom-automator | /scripts/googleClicker.js | UTF-8 | 3,572 | 2.8125 | 3 | [] | no_license | "use strict";
var runner = require('../inc/browserRunner');
var _ = require('underscore');
var url1 = "https://accounts.google.com/ServiceLogin?sacu=1&passive=1209600&acui=1#Email=ronald%401stdibs.com";
var url2 = "https://docs.google.com/a/1stdibs.com/forms/d/1nZrshYFmX71G0zq70k2EDM5DzK5jyKMjOtAyq0KeksQ/viewform";
va... | true |
6e2365db63fee018dae85ad40497ab3e6f48d479 | JavaScript | Ehab-Elshahat/Business-Template | /script.js | UTF-8 | 1,808 | 2.9375 | 3 | [] | no_license | // Select Element
const closeBtn = document.querySelector(".close");
const containerMediaMobail = document.querySelector(".container-media-mobail");
const icon = document.querySelector(".close i");
const number = document.querySelectorAll(".counter .number");
const solutions = document.querySelector(".solutions");
cons... | true |
d18859fdf294ebc11efea34f28abdc8cbfe20ecc | JavaScript | expdalex/firstProject | /stage3/timer_task10/js/script.js | UTF-8 | 4,877 | 2.78125 | 3 | [] | no_license | window.addEventListener("DOMContentLoaded", function(){
'use strict';
function ShowHideTabs(tab, headerTabsBox, tabContent){
//hide tabs starting with a
function hideTabContent(a){
for (let i = a; i < tabContent.length; i++){
tabContent[i].classLis... | true |
44691fa71e0056505d4265b7bf4ceddd77c67b25 | JavaScript | alfenner/Jiji.github.io | /Estimation/problems.js | UTF-8 | 3,914 | 2.5625 | 3 | [] | no_license | const SET_ONE_P1 = {
num: 1,
den: 2,
}
const SET_ONE_P2 = {
num: 1,
den: 4,
}
const SET_ONE_P3 = {
num: 2,
den: 4,
}
const SET_ONE_P4 = {
num: 1,
den: 6,
}
const SET_ONE_P5 = {
num: 2,
den: 6,
}
const SET_ONE_P6 = {
num: 4,
den: 8,
}
const SET_ONE_P7 = {
num: 6,
den: 7,
}
const SET_ONE_P... | true |
71e3f91bc55f884313559f51be3070063ba701aa | JavaScript | Emberglo/rockpaperscissors | /app.js | UTF-8 | 4,515 | 3.859375 | 4 | [] | no_license | let playerScore = 0;
let compScore = 0;
let compChoice = computerChoice();
loadScores();
function saveScores() {
window.localStorage.setItem('player', JSON.stringify(playerScore));
window.localStorage.setItem('computer', JSON.stringify(compScore));
}
function loadScores() {
let storedPlayerScore = JSON.parse(wind... | true |
911da7fed40d45ff53ae4d07cbee0a92c9d5e286 | JavaScript | cortezle/Laboratorio_8_00029117 | /asset/js/app.js | UTF-8 | 3,849 | 3.5 | 4 | [] | no_license |
const navSlide = ()=>{
const burger = document.querySelector(".burger");
const nav = document.querySelector(".nav-links");
const navLinks = document.querySelectorAll('.nav-links li');
burger.addEventListener("click", ()=>{
nav.classList.toggle('nav-active');
navLinks.forEach... | true |
f59833d4420339f8d7b2caa90f6bd5ec8e863e7f | JavaScript | FaustinaG/Booking | /ReturnFlightDetails.js | UTF-8 | 3,117 | 2.59375 | 3 | [] | no_license | $(document).ready(function(){
var FromCity = sessionStorage.getItem('FromCityRobject');
var ToCity = sessionStorage.getItem('ToCityRobject');
var ReturnDate = sessionStorage.getItem('ReturnDateRobject');
var Passengers = sessionStorage.getItem('Passengersobject');
document.getElementById("From-City... | true |
fa875b08a16a28905db8f955a70dbb93c9ae960c | JavaScript | prashant9912/photon-server | /static/scripts/qr.js | UTF-8 | 1,373 | 2.921875 | 3 | [] | no_license |
document.getElementById("butt").addEventListener("click", camera);
function camera(){
console.log(1);
document.getElementById("qrsuccess").style.display="none";
document.getElementById("qrfail").style.display="none";
// show the camera element
document.getElementById("preview").style.display="blo... | true |
4a39d51af60c54906e716af89c98cd551d4378cb | JavaScript | jeffersondesouza/cangaceirojs-livro | /client/app-src/domain/negociacao/NegociacaoService.js | UTF-8 | 1,947 | 2.890625 | 3 | [] | no_license | import { HttpService } from '../../util/HttpService';
import { Negociacao } from './Negociacao';
export class NegociacaoService {
constructor() {
this.http = new HttpService();
}
obterNegociacoesDaSemana() {
return new HttpService()
.get('negociacoes/semana')
.th... | true |
bb5196c647af674c342997e36eb3393d64f16fa2 | JavaScript | MMMarcy/hotel | /app/assets/javascripts/currency.js | UTF-8 | 2,135 | 2.546875 | 3 | [] | no_license | $(".test").each(function() {
var el = $(this);
el.css("margin-top", (el.parent().parent().height() - el.height()) / 2);
});
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
var CurCheck = $("#disclaimer-acceptance");
var CurSel = $("#sel-cu... | true |
22216b2bf38e356af4c15014b7405f9ca6cedfec | JavaScript | PaulGirardin/TodoListReactRedux | /src/Todo.js | UTF-8 | 430 | 2.53125 | 3 | [] | no_license | import React from 'react';
class Todo extends React.Component {
constructor(props) {
super(props);
this.toggleTodo = this.toggleTodo.bind(this);
}
toggleTodo(i) {
this.props.onToggleTodo(i);
}
render() {
const todo = this.props.todo;
return (
<li className={(todo.complete ? 'done' : '')} onClick={... | true |
52d56f2d197855ad848cfec86dbe6ec51925e56f | JavaScript | niranjanbala/locality_polygon | /public/app/views/list_single_listing.js | UTF-8 | 1,970 | 2.671875 | 3 | [] | no_license | /**
* Listing a List View
*/
var ListingSingleView = Backbone.View.extend({
tagName : 'li',
//template : _.template('app/templates/listingItem.html'),
initialize: function(options) {
this.marker_view = options.marker; //retain instance of google marker
this.listing = options.model;
this.ren... | true |
b783331d6180ea65903435aa34573c139e1093bd | JavaScript | vebradev/DOM-II | /js/index.js | UTF-8 | 1,961 | 3.203125 | 3 | [] | no_license | // Your code goes here
// Event listeners
const nav = document.querySelector(".nav");
nav.addEventListener("click", (event) => {
nav.classList.add("rotate-center");
event.preventDefault();
});
// mouseover
const img = document.querySelectorAll("img");
function addClass(element) {
element.target.classList.... | true |
3be2e5eec03939bb5f507d0c224439bb52f00778 | JavaScript | stanislavfor/webinar-animation | /homework/script.js | UTF-8 | 1,085 | 3.046875 | 3 | [] | no_license | var elem = document.getElementsByClassName('menu-item');
function startShow(){
var start = document.getElementsByClassName('start');
start[0].style.display = "none";
var delay = 100;
for (var i = 0; i < elem.length; i++) {
var el = elem[i];
el.style.transition = "600ms cubic-bezier(0.215, 0.61, 0.355... | true |
91f6487767f026078aa363e1129f865f690122fd | JavaScript | mariobrusarosco/api-code-notes | /src/index-with-annotations.js | UTF-8 | 3,137 | 2.59375 | 3 | [] | no_license | const PORT = process.env.PORT || 9090
const express = require('express')
const path = require('path')
// App Setitngs
const app = express()
const env = app.get('env')
// -------------- MIDDLEWARES --------------------- //
// Built In Middlewares
app.use(express.json())
// Third Party Middlewares
const helmet = req... | true |
771e99411e2facaadb42cab5e04acd4dc671127f | JavaScript | TalabiDele/CookRecipe | /assets/script/script.js | UTF-8 | 2,549 | 2.765625 | 3 | [] | no_license | const navBar = document.querySelector(".nav_bar");
const getStarted = document.getElementById("get_started_btn");
const body = document.querySelector("body");
const searchBtn = document.getElementById("search-btn");
const recipeInput = document.getElementById("search-recipe");
const output = document.querySelector(".re... | true |
4ab6c0a8048d1ecf7da146f410053766c583bacd | JavaScript | hoshimado/tdd-azure-book | /chapter05/src/api/sql_db_io/shaping_param4db.js | UTF-8 | 5,363 | 2.75 | 3 | [
"MIT"
] | permissive | /**
* [shaping_param4db.js]
*
* encoding=utf-8
*/
require('date-utils'); // Data() クラスのtoString()を拡張してくれる。
// const debug = require("./debugger.js");
var lib = require("../factory4require.js");
var factoryImpl = {};
// UTデバッグ用のHookポイント。運用では外部公開しないメソッドはこっちにまとめる。
exports.factoryImpl = factoryImpl;
var _is... | true |
b1739c38a987737dabfe5836d24bc84294fdbd5c | JavaScript | chenxiaohuan117/learning-javasrcipt-note | /《学习JavaScript数据结构与算法》(第3版)/code/js/recursion/recursion.js | UTF-8 | 3,512 | 3.984375 | 4 | [
"MIT"
] | permissive | /**
* 6. 递归
* 递归是一种解决问题的方法,它从解决问题的各个小部分开始,直到解决最初的大问题。递归通常涉及函数调用自身。
* 每个递归函数都必须有基线条件,即一个不再递归调用的条件(停止点),以防止无限递归。
*
* 1)调用栈
* 在程序运行时,计算机会为应用程序分配一定的内存空间,
* 应用程序则会自行分配所获得的内存空间,
* 其中一部分被用于记录程序中正在调用的各个函数的运行情况,这就是函数的调用栈。
* 常规的函数调用总是会在调用栈最上层添加一个新的堆栈帧(stack frame,也称为“栈帧”或“帧”),
* 这个过程被称作“入栈”或“压栈”(即把新的帧压在栈顶)。
* 当函数的调用层... | true |
b22ecc52b3ec8f19805840e01643a831ac6ddfd4 | JavaScript | NelsonManuelGM/react-weather-forecast | /src/context/reducers.js | UTF-8 | 1,002 | 2.6875 | 3 | [] | no_license | import {REQUEST_API_ERROR, REQUEST_API_PENDING, REQUEST_API_SUCCESS, TRACKING_DAY} from './constants'
const initialState = {
pending: false,
error: '',
data: [],
};
export const requestAPIReducer = (state = initialState, action = {}) => {
switch (action.type) {
case REQUEST_API_SUCCESS:
... | true |
416697711546fa1d9a9457d9e76ca9735dfbea98 | JavaScript | MarcRodrigFelix/fewpjs-js-fundamentals-arrays-lab-onl01-seng-pt-030220 | /index.js | UTF-8 | 415 | 3.453125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive |
const append = ["Milo", "Otis", "Garfield"];
append.push('Odie');
append;
console.log(append);
const prepend = ["Milo", "Otis", "Garfield"];
prepend.unshift('Odie');
prepend;
console.log(prepend);
const removeLast = ["Milo", "Otis", "Garfield"];
removeLast.pop();
removeLast;
console.log(removeLast);
const removeFir... | true |
0fbd61bcbf795e8c20a3ddaf0622af5321f68eba | JavaScript | moonformeli/TIL | /FP/day1.js | UTF-8 | 1,074 | 4.125 | 4 | [] | no_license | /**
*
* 가장 간단한 별찍기부터 작성해보자.
* 절차형 먼저 작성하고 함수형으로 다시 작성해보자.
*
*/
/**
* 절차형
*/
const STAR = '\u2605';
const SPACE = '\u2800';
const star = l => {
for (let i = 1; i <= l; i++) {
let str = '';
for (let j = 1; j <= l - i; j++) {
str += SPACE;
}
for (let j = 1; j <= ... | true |
1c28cdbf6cd4cab5c6ebe0eba77e7cf1b47f4845 | JavaScript | Eickichi/Js_Exo | /script_4.js | UTF-8 | 1,592 | 3.484375 | 3 | [] | no_license | const entrepreneurs = [
{ first: 'Steve', last: 'Jobs', year: 1955 },
{ first: 'Oprah', last: 'Winfrey', year: 1954 },
{ first: 'Bill', last: 'Gates', year: 1955 },
{ first: 'Sheryl', last: 'Sandberg', year: 1969 },
{ first: 'Mark', last: 'Zuckerberg', year: 1984 },
{ first: 'Beyonce', last: 'Knowles', year... | true |
021dd9f81d2dd63e91e3c4d961f66dccb7025507 | JavaScript | Maharramoff/raycast-demo | /js/ray.js | UTF-8 | 5,178 | 3.109375 | 3 | [
"MIT"
] | permissive | class Ray
{
horzWallHitX = 0;
vertWallHitX = 0;
vertWallHitY = 0;
horzWallHitY = 0;
constructor(angle, playerX, playerY, ctx)
{
this.angle = Utils.normalizeAngle(angle);
this.playerX = playerX;
this.playerY = playerY;
this.ctx = ctx;
this.wallHitX = 0;
... | true |
1e372920552514745b596b53cf50565d560d0bf1 | JavaScript | onesword0618/leetcode | /src/test/searchInsert.test.js | UTF-8 | 1,249 | 3.78125 | 4 | [
"MIT"
] | permissive | const searchInsert = require("./../main/searchInsert.js");
// Question
// Given a sorted array and a target value,
// return the index if the target is found.
// If not, return the index where it would be if it were inserted in order.
// You may assume no duplicates in the array.
descri... | true |
ea727d3a3de4977894836078b84a69d5ac8437d8 | JavaScript | 1653009/vncovid | /src/component/Chart.js | UTF-8 | 3,367 | 2.65625 | 3 | [] | no_license | import React, { Component } from 'react'
import {Line} from 'react-chartjs-2'
class Chart extends Component {
constructor(props){
super(props);
this.state = {
vnData: Object,
totalData: Object
};
}
componentDidMount(){
fetch('https://td.fpt.ai/corona/c... | true |
f9bead5b9714bbdd557476be7cc02695e997cbd8 | JavaScript | tariktabakovic/react-demo-review | /src/Counter.js | UTF-8 | 1,497 | 3.234375 | 3 | [] | no_license | import React from 'react';
class Counter extends React.Component {
constructor(props){
super(props);
this.state = {
initialValue: props.value,
// changeBy: props.changeBy
}
}
render () {
return (
<div>
<h1>
... | true |
4dde93516a3e8447d26be414245d76cf6d94d58b | JavaScript | leocss/elibrary-api | /app/library/oauth2/index.js | UTF-8 | 580 | 2.515625 | 3 | [] | no_license | /**
* @author Laju Morrison <morrelinko@gmail.com>
*/
var Grant = require('./grant/base');
var Oauth2 = function() {
this.grantTypes = {};
};
/**
* Registers a new grant type that the server should support.
*
* @param grant
*/
Oauth2.prototype.registerGrant = function(grant) {
if (grant instanceof Grant) {... | true |
b5eb844401fda76bcbb68fe49afbf52568bec4fc | JavaScript | Smayen-2019098/ProyectoFinal-VentaOnline-2019098 | /src/controladores/productos.controlador.js | UTF-8 | 5,643 | 2.59375 | 3 | [] | no_license | 'use strict'
const Productos = require('../modelos/productos.modelo')
const bcrypt = require('bcrypt-nodejs')
const productosModel = require('../modelos/productos.modelo');
const categoriaModelo = require('../modelos/categoria.modelo');
const Categoria = require('../modelos/categoria.modelo')
function registroProduc... | true |
9c0fc5ed8b4cb75dc2cfdc278f425296ba91b8c1 | JavaScript | marinija/davor-mihajleski | /js/main.js | UTF-8 | 1,929 | 2.53125 | 3 | [
"MIT"
] | permissive | // Created by Davor
const viewBtn = document.getElementById('view');
const scrollTop = document.querySelector('#scroll-top');
const bar = document.querySelector('.bar');
const navul = document.querySelector('.toggleNav');
const divHide = document.querySelectorAll('.img-wrap');
viewBtn.addEventListener('mouseover', () =... | true |
3aae1316e7e292730635370333613ee56c39f22d | JavaScript | GiovanniKaaijk/real-time-web-1920 | /controls/mapLayout.js | UTF-8 | 826 | 3.484375 | 3 | [] | no_license | function generateMap(obstacles){
let totalObstacles = 0;
let mapLayout = []
for (let i = 1; i <= 10; i++) {
const row = []
for (let j = 0; j < 10; j++) {
const state = createObstacle(obstacles, totalObstacles)
const x = j+1
const y = i
row.pu... | true |
cf3a571b7090c1185ae75bc76591bf77da7602f9 | JavaScript | chi-squirrels-2017/RecipeForDisaster | /public/js/application.js | UTF-8 | 4,216 | 2.65625 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
// upVote();
// downVote();
showRecipeForm();
voteBest();
// addCommentForm();
// addComment();
clickLogin();
// submitLogin();
});
var upVote = function() {
$('.upvote-form').on('submit', function(e) {
e.preventDefault();
var $form = $(this);
var url = $fo... | true |
b1e0c9d6419ab6202f2973e8099c672e2028dd15 | JavaScript | sergiomt/hipergate | /webapp/en/trunk/lib/dynapi/gui/button.js | UTF-8 | 3,647 | 2.8125 | 3 | [] | no_license | /*
DynAPI Distribution
Button Class
The DynAPI Distribution is distributed under the terms of the GNU LGPL license.
Requirements:
dynapi.api [dynlayer, dyndocument, browser, events]
dynapi.gui [label, dynimage]
*/
// to do:
// do support for new Button(new DynImage()) and new Button(new Label())
funct... | true |
16ad44f6bcfcba85c793b9594b35178d6297a502 | JavaScript | prefertwo/interviews | /js/async-await.js | UTF-8 | 1,653 | 3.6875 | 4 | [] | no_license |
/**
* await会让出线程,阻塞后面的代码(会先执行await紧跟的方法,然后阻塞后面的)
*
*/
function testSometing() {
console.log("执行testSometing");
return "testSometing";
}
async function testAsync() {
console.log("执行testAsync");
return Promise.resolve("hello async");
}
async function test() {
console.log("test star... | true |
72de35ffe37c55c974bb6464440221e9520bdf35 | JavaScript | yichengxian/nodeTool | /core/reg/ReUtil.js | UTF-8 | 571 | 2.546875 | 3 | [] | no_license | 'use strict';
const StringUtil = require("../string/StringUtil");
/**
* @author yichengxian
* @description 正则工具类
*/
class ReUtil {
/**
* 中文正則
* @type {string}
*/
static RE_CHINESE = "[\u4E00-\u9FFF]";
/**
* 內容是否匹配
* @param reg{RegExp}
* @param content {string}
*/
... | true |
491d4ce80fd0945af7d8bdcedbd1bba95004cef1 | JavaScript | aag6z/opendatanetwork.com | /src/autosuggest/autosuggest-source.js | UTF-8 | 4,957 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive |
class AutosuggestSource {
/**
* Constructs an AutosuggestSource given a declaration object.
*
* Declaration object must have at least:
* name, domain, fxf, column, and select
*/
constructor(json) {
this.name = json.name; // required
this.image = json.image;
thi... | true |
4580a6225853cac23593374f2f438dd1ec0cbd9d | JavaScript | HadeerFawzy/table-widgets-dashboard | /src/utils/fetchTableData.js | UTF-8 | 1,142 | 2.5625 | 3 | [] | no_license | import axios from "axios";
import getRandomDate from "utils/getRandomDate";
import moment from "moment";
const fetchTableData = ({ setLoading, successCallBack }) => {
const rowsCount = Math.floor(Math.random() * (100 - 50) + 50);
setLoading(true);
const url = `https://mockend.com/HadeerFawzy/table-widgets-... | true |
634b31c77bff416206b02596f716fd7f942500ed | JavaScript | faithtower/movie-search | /js/app.js | UTF-8 | 3,464 | 3.34375 | 3 | [] | no_license | const title = document.getElementById('title');
const year = document.getElementById('year');
const type = document.getElementById('type');
const searchBtn = document.querySelector('#searchBtn');
const message = document.getElementById('message');
const moviePoster = document.getElementById('moviePoster');
const movieI... | true |
a30b3b94cbdf9bf79a167a6bc545c165d1664c20 | JavaScript | joshu/mars | /themes/intertwingly/personalize.js | UTF-8 | 9,541 | 2.78125 | 3 | [] | no_license | var entries = []; // list of news items
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday"];
var months = ["January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"];
// event complete: s... | true |
5e95a54dc23cb7925d2f7ffa8ec3f5a33ea4cef1 | JavaScript | navarrowebapi/nodejsv1 | /server.js | UTF-8 | 1,935 | 2.875 | 3 | [] | no_license | /**
* Arquivo responsável por subir o servidor
*
*/
//importando os pacotes
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var mongoose = require('mongoose');
var Produto = require('./app/models/produto');
//usando o MLAB
mongoose.connect('mongodb://navas... | true |
9712987d614eb2137e0bde72336113f19b5c40f5 | JavaScript | Rajendra37/assignments | /projectBook mpa/js/bookManager.js | UTF-8 | 2,901 | 2.671875 | 3 | [] | no_license | class bookManager {
show() {
let addbook = JSON.parse(localStorage.getItem("myBooks") || "[]");
let uiString = " ";
for (var i = 0; i < addbook.length; i++) {
uiString += `<tr>
<td>${addbook[i].bookid}</td>
<td>${addbook[i].bookname}</td>
... | true |
f2097b76798f0cbc385614d63cad534cd19e7d7d | JavaScript | davidelrizzo/QuestMaker | /QM/Scripts/Graphics/Canvas2D.js | UTF-8 | 2,730 | 3.1875 | 3 | [
"MIT"
] | permissive | //=====================================================================================
// File: Canvas2D.js
// Desc: This file contains the Canvas2D class which can be instantiated for any canvas
// element. The class provides utility functions for manipulating the canvas.
//====================================... | true |
92782997020cc2bd7f5ec6adece8793e7579acea | JavaScript | SiddharthaSarma/leetcode | /problems/103-binary-tree-zigzag-level-order-traversal/solution.js | UTF-8 | 1,046 | 3.28125 | 3 | [
"MIT"
] | permissive | /**
* Definition for a binary tree node.
* function TreeNode(val, left, right) {
* this.val = (val===undefined ? 0 : val)
* this.left = (left===undefined ? null : left)
* this.right = (right===undefined ? null : right)
* }
*/
/**
* @param {TreeNode} root
* @return {number[][]}
*/
var zigzagLevelOr... | true |
b96bc291bb3927be2d1b8dec4570bbae3ea09951 | JavaScript | simongalvis/allinrecruits-server | /test/submissions.fixtures.js | UTF-8 | 1,405 | 2.609375 | 3 | [] | no_license | function makeSubmissionsArray() {
return [
{
id: 1,
fullname: "Avery Pollack",
phonenumber: "1234567890",
email: "avery@email.com",
interestedposition: "Art instructor",
resumelink: "http://avery.com"
},
{
id... | true |
eda93db70222fb4f61ab2376d50a40344a454ab4 | JavaScript | Torrespain/MorningChallengeAlgorithms | /findSmallestElement.js | UTF-8 | 615 | 4.71875 | 5 | [
"MIT"
] | permissive | /*Write a function called "findSmallestElement".
Given an array of numbers, "findSmallestElement" returns the smallest number within the given array.
Notes:
* If the given array is empty, it should return 0.
var output = findSmallestElement([4, 1, 9, 10]);
console.log(output); // --> 1
Starter Code :*/
function fin... | true |
ed290334d46b4ab12fad4d9e3d2e2beb9e1910c4 | JavaScript | EggTronic/Yang-s-Play-Ground | /Javascript/Algorithm/new.js | UTF-8 | 925 | 3.46875 | 3 | [
"MIT"
] | permissive | let matrix = [
[1,2,3,4],
[5,6,7,8],
[9,10,11,12],
[13,14,15,16]
];
let n = 4;
let xc = 3;
let yc = 2;
let r = 2;
if (xc - r > n || yc - r > n) {
//return -1;
}
let result = [];
for (let row = 0; row < n; row++) {
for (let col = 0; col < n;... | true |
4e46770ff604eb31d50689300d6ae9c944c84f9b | JavaScript | flapjs/FLAPJS-WebApp | /src/app/modules/re/components/views/ExpressionView.js | UTF-8 | 4,431 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from 'react';
import Style from './ViewportView.css';
import ExpressionViewStyle from './ExpressionView.css';
import {EMPTY, CONCAT, UNION, KLEENE, SIGMA, EMPTY_SET, PLUS} from 'modules/re/machine/RE.js';
const UNION_CHAR = '\u222A';
class ExpressionView extends React.Component
{
constructor(props)
... | true |
9435ac11b2cf104c379595f7863a20cab6ccb3ba | JavaScript | Evert-Arends/webshop | /application/assets/custom-js/crud_category.js | UTF-8 | 700 | 2.546875 | 3 | [
"MIT"
] | permissive | // function createCategory(postTo, postData) {
// let sendData = {
// ajax: true,
// create_category: true,
// data: postData
// };
// $.post(postTo, sendData, function (data) {
// console.log(data);
// if (data === "success") {
// console.log("Category ed... | true |
8dd8fbab3afa02f00ad0e991b14d4914e8c152b5 | JavaScript | dojokonojocho/catApp | /script.js | UTF-8 | 15,987 | 3.15625 | 3 | [] | no_license | // Add to editor - opacity, rotation, size
const growSpeed = 0.15;
const shrinkSpeed = 0.2;
function createCat(){
let body = document.querySelector('body');
// Create cat container
let newCat = document.createElement('div');
// Create cat parts
let catHead = document.createElement('div');
l... | true |
607c0a75f67db27d9a6c42d62bcc19fdea9e5ec4 | JavaScript | Slivaboop/Bernie | /commands/roll.js | UTF-8 | 1,188 | 2.65625 | 3 | [] | no_license | module.exports = {
name: 'roll',
description: 'Ping!',
execute(message, args) {
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
const Discord = require('discord.js');
const amount = parseInt(args[0]);
if (!args.length... | true |
703d6dae2f0044b989aa2a53492a6d1c75119570 | JavaScript | svenbs/ai-fun | /role.brawler.js | UTF-8 | 13,574 | 2.734375 | 3 | [] | no_license | var gameState = require('game.state');
var utilities = require('utilities');
/**
* Create priority list of hostile creeps
*/
Creep.prototype.calculateMilitaryTarget = function() {
var creep = this;
var best = utilities.getBestOption(creep.getAvailableHostileCreeps());
if (best) {
var action = 'heal';
if (bes... | true |
1468d44e959929450bd243c11e6e848372cca737 | JavaScript | CindyJS/CindyJS | /plugins/cindyprint/src/js/DownloadFile.js | UTF-8 | 807 | 3.40625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Downloads the specified text file to the computer of the user.
* @arg filename {string} The name of the file (e.g. "mesh.obj").
* @arg fileContent {string} The content of the file (a string).
*/
function downloadTextFile(filename, fileContent) {
let blob = new Blob([fileContent], { type : "text/plain;charset... | true |
fb1bc94a16a078994cdafb465531af415b106e5d | JavaScript | velochy/audio-feeder | /src/flash-backend.js | UTF-8 | 15,314 | 2.671875 | 3 | [
"MIT",
"BSD-3-Clause"
] | permissive | (function() {
/* global ActiveXObject */
var dynamicaudio_swf = require('file?name=[name].[ext]?version=[hash]!../assets/dynamicaudio.swf');
var nextTick = require('./next-tick-browser.js');
/**
* Constructor for AudioFeeder's Flash audio backend.
* @class
* @param {number} numChannels - requested c... | true |
f6f16eeea1ff4b06678f2478eb1305cb56552b76 | JavaScript | alejandrochang/Algorithms | /Practice/prep22/2.5binaryTreeMaxSubtreeSum.js | UTF-8 | 1,712 | 4.25 | 4 | [] | no_license |
class Node {
constructor(val, left = null, right = null) {
this.val = val;
this.left = left;
this.right = right;
}
}
// 10
// 4 20 -> 30
// 5
// 2 8 -> 15
// 1
// -10 8
// -12 4 12 -> 24
// let max = Number.NEGATIVE_INFINITY;
// let chosenNode = null;
/... | true |
ec9b40404ebdf519c2629cc8cddb222b7923c68d | JavaScript | sanjaycrownstack1111/TyepeScript_programee | /enums.js | UTF-8 | 949 | 3.640625 | 4 | [] | no_license | // Enums
var myConstants;
(function (myConstants) {
myConstants[myConstants["pi"] = 3.14] = "pi";
myConstants[myConstants["e"] = 2.73] = "e";
myConstants[myConstants["log2"] = 0.3] = "log2";
myConstants[myConstants["log5"] = 0.7] = "log5";
})(myConstants || (myConstants = {}));
console.log("Findind area... | true |
18c8103c6a514f73fb77957cdfc6d2c8381d74e7 | JavaScript | raccoon1619/Node.js-Homework-1 | /task12.js | UTF-8 | 1,693 | 3.46875 | 3 | [] | no_license | const authCode = '713343203575424550183x70959';
/**
* Display the information about Minsk, Madrid, Rome in format: city - country.
*
* @returns {Promise}
*/
function getCityAndCountry() {
return Promise.all(
['Minsk', 'Madrid', 'Rome'].map((city) => fetch(`http://geocode.xyz/${city}?json=1&auth=${authCode}`)... | true |
1fdebd3c1716e79dc773ba381d13aa576887f4cb | JavaScript | mvslan/designPattern | /发布-订阅模式/2.js | UTF-8 | 856 | 2.671875 | 3 | [] | no_license | // 刚才那个没有一一对应的关系,流程很不清晰,让人怀疑里面有py交易
var salesOffices = {}
salesOffices.clientList = {}
salesOffices.listen = function (key, fn) {
if (!this.clientList[key]) {
this.clientList[key] = []
}
this.clientList[key].push(fn)
}
salesOffices.trigger = function () {
var key = Array.prototype.shift.call(arg... | true |
8d0f34291a83c0b33fdf544a3e345b1bbd25711f | JavaScript | ludde0/1dv021 | /new-classic-ellipse/src/Ellipse.js | UTF-8 | 469 | 3.234375 | 3 | [] | no_license | 'use strict'
class Ellipse {
constructor (a, b) {
this.a = a
this.b = b
}
getArea () {
return Math.PI * this.a * this.b
}
getCircumference () {
return Math.PI * Math.sqrt(2 * this.a * this.a + 2 * this.b * this.b)
}
toString () {
return 'a: ' + this.a.toFixed(1) + ', b: ' + this.b.... | true |
5cd82488d2bd12eef99cbbbd08fda272f32a8356 | JavaScript | Jeroense/BWD | /resources/assets/js/setActiveImage.js | UTF-8 | 157 | 2.53125 | 3 | [
"MIT"
] | permissive | function setActiveImage(imageId) {
const images = document.querySelector('.imageSelector');
images.forEach(function() {
var x = 0;
});
}
| true |
8644737576f90441de3cbdff328b1e532ccb0977 | JavaScript | kareemdjames/findabarber | /models/Barbershop.js | UTF-8 | 1,071 | 2.59375 | 3 | [] | no_license | const db = require('../db/config');
const Barbershop = {};
Barbershop.findAll = () => {
return db.manyOrNone('SELECT * FROM barbershops')
};
Barbershop.findById = (id) => {
return db.one(`
SELECT * FROM barbershops
WHERE id = $1
`, [id]);
};
Barbershop.create = (barbershop, userId) => {
return db.one(... | true |
f32834c58da7073db893a1abcaf476399f297145 | JavaScript | Lalita6030213053/labspm | /converter.js | UTF-8 | 176 | 2.65625 | 3 | [] | no_license | function converter(currency) {
if (typeof currency === 'number'){
return `$${(currency*0.03).toFixed(2)}`;
}else return 'ERROR';
}
module.exports = converter; | true |
0b68668a1144045185dbaa80b47f20d779bb7a3f | JavaScript | shahin1122/es6Practise | /tamplate.js | UTF-8 | 494 | 3.53125 | 4 | [] | no_license | const firstName = 'justin';
const lastName = ' Timberlake';
// const fullName = firstName+' '+lastName + 'Is a amarican singer and scriptwriter' ;
const fullName2 = `${firstName} ${lastName} is a goodboy` ;
console.log(fullName2);
const multiline ='I lives in dhaka\n' + 'I am shahin shah\n' + 'I am 23';
console.log(... | true |
b3566fd277f645fe1a5a289667221b81943ef1c7 | JavaScript | madfrog2000/2018carRental | /Desktop/site2/CarHireWebsite/script.js | UTF-8 | 11,863 | 2.78125 | 3 | [] | no_license | $(function(){
// console.log('Bla');
$('.nav').hide();
$('.bars').on('click',function(){
$('.nav').slideToggle();
});
$('.datepairExample').timepicker();
});
function autocomplete(inp, arr) {
/*the autocomplete function takes two arguments,
the text field element and an array of possible autocompleted val... | true |
45ae8e15bc2ace3af78f10c4f935562fe0cc87b8 | JavaScript | Seasonley/esoo-babel-plugin | /examples/src/Vector.js | UTF-8 | 592 | 3.28125 | 3 | [
"MIT"
] | permissive | module.exports = class Vector {
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
toString() {
return `Vector(${this.x},${this.y})`;
}
__add__(b) {
return new Vector(this.x + b.x, this.y + b.y);
}
__sub__(b) {
return new Vector(this.x - b.x, this.y - b.y);
}
__mul__(b) {
... | true |
dd659134d856ee1a04f95e38cef8bf4d7f91a980 | JavaScript | daisyflemming/delightful | /src/components/sequences/SequenceModal.js | UTF-8 | 717 | 2.578125 | 3 | [
"BSD-3-Clause"
] | permissive | import React from 'react';
import ColorNucleotide from "./ColorNucleotide";
const truncateSequence =(s)=>{
let list = [];
let charPerRow = 50;
let lines = s.length /charPerRow;
for (let i=0; i < lines; i++) {
list[i] = s.slice(i*charPerRow, (i+1)*charPerRow)
}
return list;
};
const SequenceModal = (pr... | true |
0383bf9002a938609e81c4eccf11b39df707f403 | JavaScript | avihirschx/Yeshiva-University-CS | /PL/3/JavascriptOO/OOProject.js | UTF-8 | 5,090 | 2.78125 | 3 | [] | no_license | 'use strict';
let fs = require("fs");
function DocumentProcessor(builder) {
this.lFilterer = builder.lFilterer;
this.cConverter = builder.cConverter;
this.wFinder = builder.wFinder;
this.nonABCFilterer = builder.nonABCFilterer;
this.wCounter = builder.wCounter;
this.process = function(text) {
... | true |
a24972d04f0b0df420ff6fe1b92fba29bd16cf95 | JavaScript | yukaume/AromaAnimations | /layouts/anime/lime/lime.js | UTF-8 | 4,718 | 2.84375 | 3 | [] | no_license | // const lime = document.querySelector('#lime');
// lime.insertAdjacentHTML('afterbegin', htmlCreater('items', 100));
// lime.insertAdjacentHTML('afterbegin', htmlCreater('items1', 100));
// lime.insertAdjacentHTML('afterbegin', htmlCreater('items2', 20));
// const items = document.querySelector('.items');
// const ite... | true |
63a9d96421e41fdc3b506a6f31862379ca3e365e | JavaScript | losingyoung/we-account | /src/views/test/index.jsx | UTF-8 | 1,953 | 2.6875 | 3 | [
"MIT"
] | permissive | import React from 'react'
class Test extends React.Component {
state = {
uploadedImg: null
}
setImgData = () => {
let file = this.inputEl.files
let reader = new FileReader();
reader.onload = e => {
const imgDataUrl = e.target.result;
if (!i... | true |
b767e5b3900ae9543ab8cca74bd2d43cfa71ed42 | JavaScript | jcdev21/jundi.github.io | /app.js | UTF-8 | 860 | 3.078125 | 3 | [] | no_license | var kata = 'Jundi';
var inKata = 0;
var kecepatan = 1000;
function tampilHeader() {
setTimeout(() => {
let target = document.getElementById('jundi');
let textNode = document.createTextNode(kata[inKata]);
target.appendChild(textNode);
inKata++;
if (inKata < 6) {
t... | true |
4533dfaf918109c6f9fc66ef6cd6a59f55cec07c | JavaScript | patteri/slave-cardgame | /client/src/shared/cardHelper.js | UTF-8 | 2,284 | 3.375 | 3 | [
"MIT"
] | permissive | const Card = require('./card');
class CardHelper {
// Tries to find two of clubs from the given cards
// If not found, returns undefined
static findTwoOfClubs(cards) {
return cards.find(item => item.suit === Card.Suits.CLUBS && item.value === 2);
}
// Validates the hit against game rules
static valid... | true |
f02d539b3bbf5efe0d979ac5911a0f6c6559c08b | JavaScript | ggebre/myCalculator | /src/utility.js | UTF-8 | 634 | 2.84375 | 3 | [] | no_license | class Operation {
static add = function (a) {
return function (b) {
return a + b
}
}
static subtract = function (a) {
return function (b) {
return a - b
}
}
static multiply = function (a) {
return function (b) {
return a ... | true |
c7d36b984ecfc32965759243fbebf97850f37a40 | JavaScript | EC-O-DE/straighttoreddit | /bg.js | UTF-8 | 1,260 | 2.90625 | 3 | [
"MIT"
] | permissive | // http://www.reddit.com/search.json?q= link to search for json
var xhttp = new XMLHttpRequest(); //Creating Request Object
var jsonString; //global variable to hold search results
chrome.omnibox.setDefaultSuggestion({
description: 'Type /r/ along with the subreddit page to go stright to that subreddit'
});
xhttp... | true |
9aa6458583262b6d8160b5287ec2c5113537b76f | JavaScript | VikaMalitska/CalculatorAppJs | /index.js | UTF-8 | 2,710 | 2.71875 | 3 | [] | no_license | import { Calculator, Display } from "./calculator.js";
const calc = new Calculator();
let elemNumberBut = document.querySelectorAll(".key-num-btn");
let elemInput = document.querySelector(".display");
let elemDecimal = document.querySelector(".key-decimal");
let elemAC = document.querySelector(".key-clear");
let elem... | true |
9aa7824ce25be70bb3b836536b48c22b0144a6c7 | JavaScript | yimpetit/baekjoon | /sesson2/n2526.js | UTF-8 | 752 | 3.171875 | 3 | [] | no_license | // var input = require('fs').readFileSync('/dev/stdin').toString().split(' ');
var input = require('fs').readFileSync('n2526.txt').toString().split(' ');
var N = input[0]*1;
var P = input[1]*1;
var answer = [];
var answer2 = [];
var map = [];
var cal = N;
var i = 0;
while(1){
cal = cal*N;
cal = cal%P;
if(map[cal]... | true |
b09fdf46ed2ce5dde89289f74242ba0dfb8c43d7 | JavaScript | webextra-solutions/outdoor07 | /app/webroot/js/svg.js | UTF-8 | 243 | 2.59375 | 3 | [
"MIT"
] | permissive | function afficher( ref, type ) {
var region = ref.id.charAt(1);
document.getElementById(region).classList.add("Noir");
}
function masquer( ref, type ) {
var region = ref.id.charAt(1);
document.getElementById(region).classList.remove("Noir");
} | true |
1b6cb912efb009e14e3140ec61c517cff14b930d | JavaScript | simacna/nodets | /Odin/myfirst.js | UTF-8 | 2,377 | 2.796875 | 3 | [] | no_license | // var http = require("http");
// // var dt = require('./myfirstmodule');
// let url = require('url');
// http.createServer((req, res) =>{
// res.writeHead(200, {'Content-type': 'text/html'});
// // res.write(req.url);
// let q = url.parse(req.url, true).query;
// alert(q);
// let text = q.year + " " + q.mon... | true |
9b49efc51c1cf206b9b2644e936becfe60f07b68 | JavaScript | mikeal/interface-ipfs-core | /js/src/utils/connections.js | UTF-8 | 1,208 | 2.53125 | 3 | [
"MIT"
] | permissive | const waterfall = require('async/waterfall')
function waitUntilConnected (fromNode, toNode, opts, cb) {
if (typeof opts === 'function') {
cb = opts
opts = {}
}
opts = opts || {}
opts.timeout = opts.timeout || 30000
opts.interval = opts.interval || 1000
const startTime = Date.now()
const checkCo... | true |