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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c35db12560923e5e6b2bcc9002d23eb3e64dfc04 | JavaScript | FuryNashwaAspirna/tugastest | /arrayConcatSpread.js | UTF-8 | 350 | 3.828125 | 4 | [] | no_license | const arr1 = [1, 2, 3 ];
const arr2 = [4, 5, 6 ];
const obj1 = {name: 'Furry', age: 16 };
const obj2 = {address: 'Jakarta', gender: 'Women'}
//Penggabungan object menggunakan spread operator
const merge = {...obj1, ...obj2};
/*Console log array concat, untuk menampilkn penggabungan arr1&arr2*/
console.log(arr1.conca... | true |
319603deae165ac11ba72702342c0098e21793e8 | JavaScript | jparker15/algorithm | /freeCodeCamp/React/intToReact.js | UTF-8 | 16,439 | 3.75 | 4 | [] | no_license | /**
* React, created by Facebook, is an open-source JavaScript library for building user interfaces.
* It is used to create components, handle state and props, utilize event listeners and certain life cycle methods to update data as it changes.
React combines HTML with JavaScript functionality to create its own mark... | true |
284d3dc6afa3fd7bc8cde8cdfa29f821944fffc5 | JavaScript | vksrinivasan/NutriFHIR | /public/javascripts/nutriSavingsController.js | UTF-8 | 4,148 | 2.703125 | 3 | [
"MIT"
] | permissive | var data = {
COMPANY : [{
CompanyID : 1,
Name : "Google"
}, {
CompanyID : 2,
Name : "Facebook"
}
],
EMPLOYEE : [{
EmployeeID : 1,
CompanyID : 1,
FirstName : "Bob",
LastName : "Smith",
Division : "Product Management",
OfficeID : 4
}, {
EmployeeID : 2,
CompanyID : 1,
Firs... | true |
0ea9c864290a5e0783dd5e29bab57ab3d2eeed9b | JavaScript | cyq333/LeetCode | /reverseInteger.js | UTF-8 | 861 | 3.515625 | 4 | [] | no_license | /**
* @param {number} x
* @return {number}
*/
//7
var reverse = function (x) {
var num = parseInt(x);
if (typeof (x) === "number" && x >= Math.pow(-2, 31) - 1 && x <= Math.pow(2, 31) - 1) {
var splitArr = num.toString().split("");
if (splitArr[0] === "-") {
var backString = splitA... | true |
a0ba64683be69e0f1981ad8f4391c1e5dde66b2b | JavaScript | sabamosleh/turbo | /js/jsmapcss/StyleList.js | UTF-8 | 2,599 | 2.734375 | 3 | [
"MIT"
] | permissive | // ----------------------------------------------------------------------
// StyleList class
import styleparser from "./Style.js";
styleparser.StyleList = function() {
this.shapeStyles = {};
this.textStyles = {};
this.pointStyles = {};
this.shieldStyles = {};
};
styleparser.StyleList.prototype = {
maxwidth:... | true |
9f3d5afce27e5af740c9fd229b3968fb6d5e43f9 | JavaScript | thavixt/custom-elements-collection | /js/customelements/input-switch.js | UTF-8 | 4,815 | 3.140625 | 3 | [
"MIT"
] | permissive | export default class InputSwitch extends HTMLElement {
// Specify observed attributes so that attributeChangedCallback will work
static get observedAttributes() {
// array of attribute names we want to observe
return ['checked', 'disabled'];
}
constructor() {
// You must call su... | true |
1ee6e7b5b9577dc1ec116d09f08a4a260cf883a3 | JavaScript | phamtanphat/reactjs2302 | /src/redux/words.reducers.js | UTF-8 | 880 | 3.015625 | 3 | [] | no_license | // const defaultWords = [
// { id: 'a1', en: 'One', vn: 'Mot', isMemorized: true },
// { id: 'a2', en: 'Two', vn: 'Hai', isMemorized: false },
// { id: 'a3', en: 'Three', vn: 'Ba', isMemorized: true }
// ]
function wordsReducer(state = [] , action){
if(action.type === 'SET_WORDS') return action.... | true |
b048504c6114611e7f5469e82a849b98386ad2ad | JavaScript | Dhriti501/weather_project | /app.js | UTF-8 | 2,696 | 3.25 | 3 | [] | no_license | // const cityname = document.getElementById('w-location');
// const description = document.getElementById('w-desc');
// const temperature = document.getElementById('w-string');
// const icon = document.getElementById('w-icon');
// const feelsLike = document.getElementById('w-icon');
// const humidity = document.ge... | true |
b267eeb139cd42491aaef43d499c868a43c6ee25 | JavaScript | taniaafzal110/final-test | /script.js | UTF-8 | 637 | 2.71875 | 3 | [] | no_license | // Write all your Javascript here!
$.ajax({
url: "https://techkaro-test.herokuapp.com/api/v1/getdata",
success: function(data) {
console.log(data);
document.querySelector(".lotus").innerHTML = `${data.imageURL}`;
document.querySelector(".date").innerHTML = `${data.date}`;
document.querySelector... | true |
6b081655022f7d13b8bdc72ab6afdba614d7dfc9 | JavaScript | jasoncfleeBCIT/COMP-2800-Team-BBY-12-SmartCart | /Javascript/proto.js | UTF-8 | 10,091 | 3.296875 | 3 | [] | no_license | //How to get details about the current user, from the firebase API:
// We want 2 main things from this:
// .displayName and
// .uid
function getUserDetails() {
firebase.auth().onAuthStateChanged(function (user) {
if (user) {
// console.log(user.displayName);
// con... | true |
7ef914ae14c7495981b8c01bba4acf4b1f1987a3 | JavaScript | PeaWarriorLabs/hogwarts-nyc04-seng-ft-053120 | /src/components/App.js | UTF-8 | 1,093 | 2.578125 | 3 | [] | no_license | import React, { Component } from "react";
import "../App.css";
import Nav from "./Nav";
import hogs from "../porkers_data";
import HogContainer from "./HogContainer";
import Options from "./Options"
class App extends Component {
state = {
filtered: false,
sort: "name",
}
renderHogs = () => {
let fil... | true |
83d3f136158ffe2474ef208a0280ee00205dfd68 | JavaScript | flyeven/casper-scripts | /lc/pos/SearchPage.js | UTF-8 | 1,429 | 2.734375 | 3 | [] | no_license | /*
* Search results page object
*
* @package: Blueacorn SearchPage.js
* @version: 1.0
* @Author: Luke Fitzgerald
* @Copyright: Copyright 2015-07-12 13:09:04 Blue Acorn, Inc.
*/
'use strict';
//enables the use of xpath to find selectors
var x = require('casper').selectXPath;
//set screen for better screen shots
casp... | true |
264e8876dbd22c82aaaf78c96841e0c2a3189c1b | JavaScript | cjx913/ExaminationSystem | /src/main/webapp/WEB-INF/js/verifycode.js | UTF-8 | 1,608 | 3.6875 | 4 | [] | no_license | /**
* 往画布中填充随机验证码,并将验证码返回到input,由后台验证
* @param canvas_id 画布id
* @param input_id 隐藏域id
*/
function verifycode(canvas_id,input_id) {
var canvas = document.getElementById(canvas_id);
var context = canvas.getContext("2d");
var canvas_x = canvas.width;
var canvas_y = canvas.height;
context.fillStyl... | true |
0233a61cd3755f88b95286ce1a29459163e4dcdd | JavaScript | Hussamxx/books | /main.js-1.js | UTF-8 | 1,374 | 3.15625 | 3 | [] | no_license | _____________
const books =[['1','Start with why','Simon Sinek',80.0,13],
['2','But how do it know','J. Clark Scott',59.9,22],
['3','Clean Code','Robert Cecil Martin',50.0,5],
['4','Zero to One','Peter Thiel',45.0,12],
['5','You do not know JS','Kyle Simpson',39.9,9],
]
console.log("Add book id=6");
books.push(... | true |
3a7f9e4c88e15d8d780800b04e75a0b5b7bb7308 | JavaScript | ChBernat/sampleapp | /js/login.js | UTF-8 | 890 | 2.546875 | 3 | [] | no_license | 'use strict';
const login = function(navbar) {
const validateEmail = (email) => {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(email);
};
const logUserIn = (e) => {... | true |
db40851fdbe3b2c17a386990beb7d441696f03a6 | JavaScript | ProjectAgri20/newrepo | /ScalableTestFramework/Source/DeviceAutomation/SolutionApps/Blueprint/BluePrintJavaScript.js | UTF-8 | 1,277 | 2.9375 | 3 | [] | no_license | function getDocumentCount() {
var elements = document.getElementsByTagName("input");
var count = 0;
for (var i = 0; i < elements.length; i++) {
if (elements[i].type == "checkbox") {
count++;
}
}
return count;
}
function getDocumentCountUsingImgTag() {
var elements ... | true |
17201fd753fabc324a7e61a91b5254f57ebf33cd | JavaScript | cecelia23/frontend | /scripts/es6/block_function.js | UTF-8 | 159 | 2.8125 | 3 | [] | no_license | // "use strict";
if (true){
console.log(typeof doSomething);
function doSomething(){
console.log('hello world');
}
}
console.log(typeof doSomething); | true |
bee112b99bd4232dc6b90a30b6c7ab7d4c97f4ac | JavaScript | einarcamilo/JavaScript | /tiposdeDatos/concatenacion.js | UTF-8 | 285 | 3.453125 | 3 | [] | no_license | var nombre='juan';
var apellido='Perez';
var nombreCompleto= nombre+' '+apellido;
console.log(nombreCompleto);
var nombreCompleto2= 'Carlos'+ ' '+ 'lara';
console.log(nombreCompleto2);
var x=nombre+1+2;
console.log(x);
x=nombre+(2+4);
console.log(x);
x=2+4+nombre;
console.log(x); | true |
00150ab5809d833d78c286ced8fe1fdc91f9423f | JavaScript | torkelo/ScratchPad | /BBoneTrader/BBoneTrader.Web/Public/js/examples/examples.complete.js | UTF-8 | 3,258 | 2.609375 | 3 | [] | no_license |
//
// Models
//
var Auction = Backbone.Model.extend({
url: "api/auctions"
defaults: {
title: "generic title",
description: "generic description"
},
initialize: function() {
// init code
},
placeBid: function() {
// do something interesting
}
});
var item = new Auction({ title: "some title", des... | true |
ab6ecbc471834c5e01ff0475a0ed18b2ab21d09b | JavaScript | ZhnZhn/news-aggregator | /src/utils/__tests__/getFnByPropName.test.js | UTF-8 | 915 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | import getFnByPropName from '../getFnByPropName';
describe('util getFnByPropName', () => {
const fn = getFnByPropName;
test('should return function from object by propName', () => {
const propName1 = 'propName1'
, fn1 = () => {}
, obj = {
[propName1]: fn1
}
expect(fn(obj, propName1)).toB... | true |
067ae16d5b83b32fdfcfe330ddda8903d544c530 | JavaScript | D-YSF-A/FoodyApp | /frontend/reducers/restaurantReducer.js | UTF-8 | 560 | 2.828125 | 3 | [
"Apache-2.0"
] | permissive | function handleRestaurantActions (state, action) {
switch (action.type) {
case 'REQUEST_ALL_RESTAURANTS':
return {
isFetching: true,
restaurant: []
}
case 'RECEIVE_ALL_RESTAURANTS':
const restaurantDataAll = action.response.data
return {
isFetching: false,
... | true |
edb5b73e22a631cc5efca14a796c75ae9bcbbf1a | JavaScript | davidteddy/lab-06-tcp-chat | /lab-teddy/server.js | UTF-8 | 1,518 | 2.65625 | 3 | [] | no_license | 'use strict';
const Client = require('./model/client');
const net = require('net');
const EE = require('events').EventEmitter;
const ee = new EE();
const server = module.exports = net.createServer();
const PORT = process.env.PORT || 3000;
const pool = [];
ee.on('default', (client, string) => {
client.socket.write(`... | true |
caee8752f92320634a9328ae4ce1e6738cae178a | JavaScript | miguelbustamante/Matriz | /js/main.js | UTF-8 | 685 | 2.515625 | 3 | [] | no_license | $(document).ready(function(){
$("#btnIngresar").click(function(e){
e.preventDefault();
var data = {usuario:$('#txtUsuario').val(), contrasena:$('#txtPassword').val()};
var json = JSON.stringify(data);
$.ajax({
url:"php/validate.php",
type:"POST",
data: {"datos": json},
success: function(respo... | true |
7e9654ec34cfb5d4b271052bf1228c55c6258585 | JavaScript | amdyDiop/QCM_Amdy-Diop | /assets/js/fonction.js | UTF-8 | 1,630 | 2.90625 | 3 | [] | no_license | function connnexion() {
var login = document.forms["connection"]["login"].value;
var password = document.forms["connection"]["password"].value;
if (login === "") {
alert("le login ne doit pas etre vide");
return false;
} else if (password === "") {
alert("le mot de passe ne doit ... | true |
d666539c2a44b1f5835868234998d44d0a82c4c1 | JavaScript | codenation-dev/squad-3-ad-react-softplan-1 | /frontend/src/pages/Profile/index.js | UTF-8 | 2,072 | 2.59375 | 3 | [] | no_license | import React , { useEffect, useState } from 'react';
import { Container } from './styles'
import { Form, Input } from '@rocketseat/unform';
import { register } from '../../services/api.js'
import * as Yup from "yup";
const schema = Yup.object().shape({
name: Yup.string()
.required(`O nome é obrigatório.`),
ema... | true |
780807db1ed10a51c1c1d9914e7fae55ba1a8802 | JavaScript | dl102306/LeetCode | /dp/longestValidParentheses.js | UTF-8 | 993 | 3.484375 | 3 | [] | no_license | /*
* @lc app=leetcode id=32 lang=javascript
*
* [32] Longest Valid Parentheses
*/
/**
* @param {string} s
* @return {number}
*/
/*
s[i] === ')'
s[i-1] === '(' --> dp[i] = dp[i-2] + 2
s[i-1] === ')' --> dp[i] = dp[i - 1] + dp[i - dp[i-1] - 2] + 2
*/
var longestValidParentheses = function (s) {
const dp = {}
... | true |
e2c2c740abe95c53157f8e00a0db8551b180cae7 | JavaScript | fffffff1121/JSlesson | /js/typeof.js | UTF-8 | 2,216 | 3.796875 | 4 | [] | no_license | // function formatDate(date) {
// function type(obj){
// return {}.toString.call(obj).slice(8, -1);
// }
// if(type(date) == 'String'){
// date = new Date(date);
// }else if(type(date) == 'Number'){
// date = new Date(date * 1000);
// }else if(Array.isArray(date) == tru... | true |
ce663f5594dc41d5687be786b75ba6738bb2f55b | JavaScript | AnilMula/HYFSGMS | /src/server/api/routes/skills.router.js | UTF-8 | 1,260 | 2.6875 | 3 | [
"MIT"
] | permissive | const express = require('express');
const router = express.Router({ mergeParams: true });
// controllers
const skillsController = require('../controllers/skills.controller');
/**
* @swagger
* /skills:
* get:
* summary: Get all skills
* description:
* Will return all skills.
* produces: applicati... | true |
84585e9cee1fd9466bedb93ebb6c4277d08d2349 | JavaScript | quangkhait98/Expresspr | /main.js | UTF-8 | 814 | 2.625 | 3 | [] | no_license | var express = require('express');
var app = express();
var bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.get('/', function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<form action="readname" method="post" ... | true |
7f400e6a5283caf01464ca2cecebc019738b365f | JavaScript | GeeksHubsAcademy/react-playground | /src/components/ProgressBar.jsx | UTF-8 | 1,326 | 2.671875 | 3 | [] | no_license | import React, { useEffect, useState } from 'react'
const ProgressBar = () => {
const [progress, setProgress] = useState(0);
const [intervalId, setIntervalId] = useState(null);
useEffect(() => {
const progressIntervalId = startProgressBar();
setIntervalId(progressIntervalId);
consol... | true |
0d13119b2be92c22cf6e0ad4af9878e706e938a6 | JavaScript | Vaagee447/GameProject1 | /app.js | UTF-8 | 4,023 | 3.375 | 3 | [] | no_license | // Тоглогчийн ээлжийг хадгалах, 1r toglogvh 0 , 2r toglogch 1 gj temdeglene
var isNewGame;
var activePlayer;
var score;
var roundscore;
var diceDom = document.querySelector(`.dice`);
initGame();
function initGame(){
isNewGame = true;
// Тоглогчийн ээлжийг хадгалах, 1r toglogvh 0 , 2r toglogch 1 gj temdeglene
... | true |
400509e1cc07d838a22d8614ff31876a12ae866b | JavaScript | mrSerhi/webpack_boilerplate | /src/index.js | UTF-8 | 1,052 | 2.859375 | 3 | [] | no_license | import hi from "./js/sayHi";
import { displayNames, trololo } from "./js/displayNames";
import { button as btn, btnblock } from "./js/buttonView";
// import "./css/main.css";
// styles
import './scss/main.scss';
console.log(hi.call(this, "Serhii"));
console.log(hi.call(this, "Andry"));
const names = ["Bill", "Dilan", ... | true |
906fb4989aa550cf2fbe8ac0e4b13f4a37b2fe99 | JavaScript | 1751510063/cr1994.github.io | /second-book/js/index.js | UTF-8 | 3,697 | 3.015625 | 3 | [] | no_license | //热门推荐轮播
var box1=document.querySelector("div.pic-four");//获取大盒子
var picbox1=box1.querySelector("ul");//获取图片的盒子
var left1=box1.querySelector("div.left");//获取左箭头
var right1=box1.querySelector("div.right");//获取右箭头
var widthj=parseInt(getComputedStyle(box1,null).width);
//获取盒子的宽度,以便在animate中使用
var t1=setInterval(m... | true |
3e858df83101d8fe81dbbf55c6ea67bedb529911 | JavaScript | newyork-anthonyng/react-playground | /src/stories/RadioGroup.js | UTF-8 | 1,853 | 2.515625 | 3 | [] | no_license | import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { withKnobs, number, boolean, text } from '@storybook/addon-knobs';
import glamorous from 'glamorous';
import RadioGroup from '../components/RadioGroup';
import Radio from '../components/... | true |
8cde8e3885e96efa1bcaa7c28e21564fe7345ea0 | JavaScript | Anemos/ProjectWork | /Html5/title.js | UTF-8 | 272 | 2.734375 | 3 | [] | no_license | var element;
show('ddd', 'ddd');
element = document.getElementsByTagName('title').item(0);
show('변경전', element.text);
element.text = '제목변경';
show('변경후', element.text);
show('textContent', element.textContent);
show('document.title', document.title ); | true |
4ecbe0d9ba2c7124aa80f9b48575060b2d158590 | JavaScript | fsp22/picnet_closure_repo | /src/pn/data/BaseFacade.js | UTF-8 | 11,063 | 2.53125 | 3 | [] | no_license | ;
goog.provide('pn.data.BaseFacade');
goog.require('goog.events.EventHandler');
goog.require('pn.app.EventHandlerTarget');
goog.require('pn.data.Entity');
goog.require('pn.data.LocalCache');
goog.require('pn.data.PnQuery');
goog.require('pn.data.Server');
goog.require('pn.log');
goog.require('pn.web.WebAppE... | true |
931751290e14ac0376f22bc06bb97f8c339405f3 | JavaScript | hendrianggaraa/html-css-js | /4.JAVASCRIPT/3.JSADVANCE/latihan1.2Prototype/script.js | UTF-8 | 7,752 | 3.96875 | 4 | [] | no_license | // https://medium.com/koding-kala-weekend/memahami-javascript-sebagai-prototype-based-language-4ea7d18590e7#:~:text=Secara%20sederhana%2C%20semua%20function%20di,akan%20dipanggil%20di%20masa%20depan.
// Javascript adalah bahasa yang asynchronous, non-blocking, dan prototype-based.
// First Class Objects yang artinya ... | true |
2e2f339676f103f384c223739c7b33f7d4149213 | JavaScript | michaeldmoser/Backcountry-Tracks | /htdocs/static/js/tripplanner.js | UTF-8 | 7,648 | 2.546875 | 3 | [] | no_license | /*
* Registration Plugin
*/
(function( $ ){
$.fn.tpRegistration = function(options) {
var $this = this;
this.errorElement = $('<ul/>')
.addClass('register-error ui-state-error ui-corner-all')
.hide()
.appendTo(this);
this.options = $.extend({
thankYouElement: null
}, opt... | true |
527f4ed2d522a5c8a1fee0e17f96c8d92b954901 | JavaScript | bcaudan/appstore-search | /frontend/cypress/integration/scenarios.spec.js | UTF-8 | 1,674 | 2.578125 | 3 | [] | no_license | /// <reference types="Cypress" />
import Page from '../dsl/appstore.page';
context('Appstore search', () => {
let page;
beforeEach(() => {
page = new Page();
page.open();
});
it('should display applications on load', () => {
page.applications()
.its('length')
.should('be.gt', 0)
... | true |
a76a0256dc96193ba14cf127fa822c074d6157b7 | JavaScript | Prince10934/sorting-visualizer | /src/reducers/BarReducer.js | UTF-8 | 251 | 2.515625 | 3 | [] | no_license | const BarReducer = (state = { arr: [], height: [] }, action) => {
if (action.type === "ARRAY") {
return {
arr: action.payload.arr,
height: action.payload.height,
};
} else {
return state;
}
};
export default BarReducer;
| true |
097b1f9cf1a1992940464b3acf2d5e96693be0d7 | JavaScript | skipwhite/ShoppingApp | /src/main/webapp/scripts/script.js | UTF-8 | 3,330 | 2.9375 | 3 | [] | no_license | var carts = document.getElementsByClassName("fas fa-shopping-cart");
var cartContent = document.getElementById("cartContent");
showCart();
function getCookie(cname)
{
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i < ca.length; i++)
{
var c = ca[i].trim();
if (c.indexOf(... | true |
882f77cdeaba109a4fa0989c21bf1cabf86f2383 | JavaScript | ryanbest99/Metube | /backend/src/controllers/youtube.js | UTF-8 | 538 | 2.546875 | 3 | [
"MIT"
] | permissive | require("dotenv").config({ path: "./config.env" });
const fetch = require("node-fetch");
exports.searchVideos = async (req, res) => {
const searchtext = req.params.searchtext;
const url = `https://youtube.googleapis.com/youtube/v3/search?q=${searchtext}&part=snippet&key=${process.env.YOUTUBE_API_KEY}&maxResults=50... | true |
6265e56558fc9a263b362f187baef59cd72bd164 | JavaScript | Rilong/mwcUploader | /mwcUploader.js | UTF-8 | 997 | 2.78125 | 3 | [] | no_license | const mwcUploaderButtons = document.querySelectorAll('.mwcUploader__button')
const mwcUploaderFileInputs = document.querySelectorAll('.mwcUploader__file')
if(mwcUploaderButtons.length && mwcUploaderFileInputs.length) {
mwcUploaderButtons.forEach(mwcButton => {
mwcButton.addEventListener('click', event => {
... | true |
714da18de236f14547717d2c64cdce648a83748f | JavaScript | DimaLitvinenko/goIt-Js-hw-07 | /js/task-08.js | UTF-8 | 2,187 | 3.40625 | 3 | [] | no_license |
// Переписать задание 8, реализовав функционал, при котором дивы не перерисовываются,
// а дорисовываются к отрендеренным ранее.
const controlRefs = {
input: document.querySelector('input'),
render: document.querySelector('button[data-action="render"]'),
destroy: document.querySelector('button[data-action... | true |
ff10f8e9d222617fda430d60795213aa103eb02b | JavaScript | p4ran0id/eeePc_config | /.config/google-chrome/Default/Extensions/pajecklcmiegagoelbbjldmfcbcpdpll/3.1_0/bookmark/merge.js | WINDOWS-1252 | 26,262 | 2.671875 | 3 | [] | no_license |
var merge_buffer={
node_stack: [],
node_delete:[],
node_local_shade:[],
node_local_ids:{},
node_order:[]
};
var sync_buffer={
node_stack_create:[],
node_stack_update:[]
};
function merge_clear() {
merge_buffer.node_stack = [];
merge_buffer.node_delete = [];
merge_buffer.node_local_shade... | true |
e5c25683033275055943eceff572ac8016b74377 | JavaScript | airhorndesign/m_igotdibs | /www/js/photo.js | UTF-8 | 9,268 | 2.5625 | 3 | [] | no_license | // Wait for PhoneGap to load
document.addEventListener("deviceready", onDeviceReady, false);
// PhoneGap is ready
function onDeviceReady() {
// Do cool things here...
}
function takePicture() {
navigator.camera.getPicture(
function(uri) {
var img = document.getElementById('camera_i... | true |
3f2ca72bdd2ded129eb926112b3240ebad226b47 | JavaScript | chiwong08/manoj_tvRemote | /src/tvRemote.js | UTF-8 | 4,233 | 3.3125 | 3 | [
"MIT"
] | permissive | var tvRemote = function (word) {
const keyboard = [
['a', 'b', 'c', 'd', 'e', '1', '2', '3'],
['f', 'g', 'h', 'i', 'j', '4', '5', '6'],
['k', 'l', 'm', 'n', 'o', '7', '8', '9'],
['p', 'q', 'r', 's', 't', '.', '@', '0'],
['u', 'v', 'w', 'x', 'y', 'z', '-', '/']
]
con... | true |
e2b9abc3b2d4ee94046c8f215bb28067508464a4 | JavaScript | KovDimaY/TodoList-React.js | /public/app/create-todo.js | UTF-8 | 1,727 | 2.9375 | 3 | [] | no_license | import React from 'react'
export default class ToDosList extends React.Component {
constructor(props){
super(props);
this.state = {
error: null
}
}
renderError() {
if (!this.state.error) { return null; }
return <div style={{ color : 'red' }}>{this.state.error}</div>
}
render(){
return(
<div... | true |
f3a78cccd466240fd641dc24aa128910ec7f92e6 | JavaScript | Laura-Cindy-Aza/records-store-server | /controllers/usersControllers.js | UTF-8 | 3,991 | 2.890625 | 3 | [] | no_license | const { body } = require("express-validator/check");
const User = require("../models/User");
const bcryptjs = require("bcryptjs");
const cookieParser = require("cookie-parser");
const jwt = require("jsonwebtoken");
const customError = require("../helpers/customError");
// GET /users => get all users
exports.getUsers ... | true |
ec9d01cda149ed323499e36a4857bb25f50fb139 | JavaScript | tool-recommender-bot/ki4so | /ki4so-java-client/src/main/resources/com/github/ebnew/ki4so/client/web/filters/logout.js | UTF-8 | 1,601 | 2.921875 | 3 | [] | no_license |
/**
* 获得当前用户登录的应用列表。
* @param appList 登录的应用列表,json对象。
*/
function fetchAppList(appList) {
//登录的应用不为空。
if (appList) {
for ( var i = 0; i < appList.length; i++) {
var appObj = appList[i];
if (appObj && appObj.logoutUrl) {
//发送请求挨个登出各应用。
addScriptTag(appObj.logoutUrl);
}
}
}
}
/**
* 登出本应用,至少要... | true |
18345b636818902e14f67566db11a16950c969a9 | JavaScript | renegare/cavalier | /test/lib/element.spec.js | UTF-8 | 2,350 | 2.6875 | 3 | [
"MIT"
] | permissive | var test = require('ava')
var sinon = require('sinon')
var src = require('sequire')
var Element = src('index').Element
var co = require('bluebird').coroutine
class MockAdapter {
constructor () {
this.findStub = sinon.stub()
this.findAllStub = sinon.stub()
this.methodsStub = sinon.stub()
this.contextS... | true |
b878b0803a6b5973f3d0ed1f4303f88ac989bb46 | JavaScript | juilianoj/nodeWebsocketChatApp | /server.js | UTF-8 | 6,166 | 2.75 | 3 | [] | no_license | //EXPRESS SERVER*****************************************************
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer();
server.on('request', (app));
//const server = require('http').createServer(app);
/*
server.listen(8080, 'localhost', funct... | true |
313c93532b3dd83b70feeebc11a06b0b280f631d | JavaScript | MarkNijhof/client.express.js | /src/client.express.ondomready.js | UTF-8 | 2,105 | 2.796875 | 3 | [
"MIT"
] | permissive |
/*
* onDOMReady
* Copyright (c) 2010 Ryan Morr (ryanmorr.com)
* Licensed under the MIT license.
*/
ClientExpress.onDomReady = function(fn, ctx){
//Responsible for handling events and each tick of the interval
var onStateChange = function (event){
//IE compatibility
event = event || window.event;
//Mozil... | true |
eb4726923b505144cc3a31b3ea7812fe407e5c75 | JavaScript | NanaAidoo/430-project-1 | /src/jsonResponses.js | UTF-8 | 3,625 | 2.921875 | 3 | [] | no_license | // default values for the app and where the POST data is stored
const users = {
Nana: {
name: 'Nana',
age: '21',
description: 'Basic Workout',
workout: {
monday: 'jogging/stamina training',
wednesday: 'arm training',
friday: 'leg training',
},
},
Walt: {
name: 'Walt',
... | true |
b1f208c2a3020d2b359157082fea3b3199c97d7e | JavaScript | rodrigoljpereira/Etapa-7-Exercicio-Aula-1 | /app.js | UTF-8 | 2,382 | 3.4375 | 3 | [] | no_license | /*
Este exercício será um pouquinho diferente dos anteriores.
Seu desafio é desenvolver uma versão do quiz que:
- Aborda um tema diferente (não pode ser de filmes);
- Tem um tema de cores diferente do que foi apresentado na aula;
- Exibe na tela a pontuação que o usuário fez. Não há certo ou errado, apenas faça. Essa e... | true |
e321bbbee45e17c9f0f78edd9fe59a9ee214e183 | JavaScript | Guiradi/Guia-de-Estudos---Leonardo-Ferreira | /Princípios básicos importantes/modulos.js | UTF-8 | 429 | 3.890625 | 4 | [] | no_license | /*
------- Nomes dos meses -------
var mes = function() {
var nomes = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio","Junho", "Julho", "Agosto", "Setembro", "Outubro","Novembro", "Dezembro"];
return {
nome: function(numero) { return nomes[numero]; },
numero: function(nome) { return nomes.indexOf(nome);... | true |
b54b2defedb9f2e64ffc5c44ecc5addb2c07e166 | JavaScript | iarna/opml-js | /test/spectest-category.js | UTF-8 | 1,471 | 2.609375 | 3 | [] | no_license | "use strict";
var test = require("tape"),
opml = require('../opml'),
fs = require('fs');
test("Specification Examples Test- category.opml", function (t) {
t.plan(12);
opml.parse(fs.createReadStream(__dirname+'/../specex/category.opml'))
(function (e,d) {
t.ok( e===null, 'Load... | true |
3784dabf829c2c233cc0c95cc7b5f09e200b1365 | JavaScript | rduarte25/node-js | /servidor.js | UTF-8 | 2,161 | 2.578125 | 3 | [] | no_license | var http = require("http");
var fs = require('fs');
var host = "127.0.0.1";
var puerto = "9000";
var servidor = http.createServer(function(llamado, respuesta) {
console.log(llamado.method + "- >" + llamado.url);
if (llamado.url == '/') {
fs.readFile("../sgsst-v0.02/AdminLTE-2.4.10/index.html", "UTF-8", functi... | true |
2b9604c61072d792f299e6d7180f938fa3d6cf95 | JavaScript | MrMullac/12COMP-mini-skills-p5-CallumWatson1 | /t04_mouse_X_and_Y.js | UTF-8 | 329 | 3.15625 | 3 | [] | no_license | /********************************************************/
// t04_mouse_X_and_Y.js
/********************************************************/
function setup() {
createCanvas(windowWidth, windowHeight);
background('black');
}
function draw() {
noStroke();
fill(150, 150, 150, 25);
ellipse(mouseX, mouseY, 15,... | true |
086234013330f9a4c9c87e5c93028bddb0999e08 | JavaScript | danillonogueira/react-hooks-advanced | /src/components/contact-form.js | UTF-8 | 1,819 | 2.515625 | 3 | [] | no_license | import React, { useState, useContext } from 'react';
import { Segment, Form, Input, Button } from 'semantic-ui-react';
import _ from 'lodash';
import { ContactContext } from './../contexts/contact-context';
// Function that composes the input handler
const useInputHandler = function(initialValue) {
const [value, set... | true |
9e0bb682782ea425ce208ee31fe01a8bdce4e847 | JavaScript | karpikpl/hapi-with-react-socketio | /client/src/ApiStatus.test.js | UTF-8 | 1,464 | 2.5625 | 3 | [
"MIT"
] | permissive | import React from 'react';
import ReactDOM from 'react-dom';
import ApiStatus from './ApiStatus';
import FetchMock from 'fetch-mock';
it('renders without crashing', () => {
const div = document.createElement('div');
ReactDOM.render(<ApiStatus />, div);
ReactDOM.unmountComponentAtNode(div);
});
it('gets API stat... | true |
3bcae9d1918c736a9cb3031bccd377003bbfeaa4 | JavaScript | alombardo4/BrewFinder | /client/app/location/location.service.js | UTF-8 | 1,312 | 2.640625 | 3 | [] | no_license | 'use strict';
angular.module('brewfinderwebApp')
.service('location', function ($http) {
var location = {};
location.zip = null;
// AngularJS will instantiate a singleton by calling "new" on this function
location.getFullLocationFromBrowser = function(callback) {
return window.navigator.geolocati... | true |
11d7239e4cdc784eb07a316208616e5d1e592a1c | JavaScript | vladimirpanov86/basic-js | /src/dream-team.js | UTF-8 | 610 | 2.78125 | 3 | [
"MIT"
] | permissive | const CustomError = require("../extensions/custom-error");
const testOptional = require("../extensions/it-optional");
module.exports = function createDreamTeam(members) {
if(!Array.isArray(members)) return false;
let result = '';
const sortedArray = members.filter(e => typeof e === 'string').map(e => {return e.t... | true |
80afd43fd1b008b8b0fceba018c329beb41684be | JavaScript | ahmedseragcodes/BackEnd-k | /api/auth/auth-router.js | UTF-8 | 2,177 | 2.53125 | 3 | [] | no_license | const router = require('express').Router();
const jwt = require('jsonwebtoken');
const bcryptjs = require('bcryptjs');
const Users = require('../users/users-model');
const {isValid} = require('../users/users-service');
const {jwtSecret} = require('../config/secret');
router.post('/register', (req, res) => {
const ... | true |
8ff1edc857ad1858acdf60960c611dae4e0e73d2 | JavaScript | jmpaaak/BeaverRising | /BeaverGame/game/js/classes/SoundBox.js | UTF-8 | 1,148 | 2.625 | 3 | [] | no_license | classes.SoundBox = cc.Class.extend({
_sounds: null,
preload: function(argo) {
this._sounds = new Object();
for (var prop in argo) {
var src = soundPath + argo[prop];
this._sounds[prop] = new Audio(src);
this._sounds[prop].load();
console.log(this._sounds[prop]);
}
},
/**
* Play sound
* @... | true |
e2540852992ff22f05cb7630faf616e75d01c230 | JavaScript | Abramov90/digitalwatch | /watch.js | UTF-8 | 1,366 | 2.890625 | 3 | [
"MIT"
] | permissive | (function() {
this.digits = ['zero', 'one', 'two', 'three', 'four', 'five', 'six',
'seven', 'eight', 'nine'],
this.init = function() {
_getClock();
};
var _getClock = function() {
$.ajax({url:'clock.html'}).done(function(data) {
$('.watch-container').html(data);
});
_initClock();
};
var _initCloc... | true |
d2f0e46aa8f08398889adcbf8e4ea33583c00e55 | JavaScript | IamSoPrada/guk-express | /public/js/index.js | UTF-8 | 3,715 | 3.140625 | 3 | [] | no_license | window.addEventListener("DOMContentLoaded", () => {
const cardsContainer = document.querySelector(".cards__container")
function openBurger() {
const burger = document.querySelector(".header__burger")
const menu = document.querySelector(".header__navbar")
const bodyPage = document.queryS... | true |
ad813bdf96c33585de98f12288f10cf53ac0f40d | JavaScript | ste66/MyLibrary | /src/PlayerMap/components/worldBest/worldMap.js | UTF-8 | 2,890 | 3 | 3 | [] | no_license | import React, { Component } from 'react'
import WorldPlayer from "./worldPlayer"
class worldMap extends Component {
// ! State: =================================
// At the beginning input is empty. So we defined empty value!
// state ={
// value : ""
// }
// ! 2nd Way : To create State"Const... | true |
25b4347e77457f9e6cd07ba6ebfd3c4ed195b950 | JavaScript | zirman/xboloweb | /static/awof/js/emitter.js | UTF-8 | 2,122 | 3.046875 | 3 | [
"MIT"
] | permissive | /* Author: Robert Chrzanowski */
/*jslint browser: true, devel: true, indent: 2 */
// Emitter
// Prototype: Object
// Emitters run generator periodicly based on frequency and varience
(function () {
"use strict";
var nmsp = AWOF;
// define array of emitters
nmsp.emitters = [];
nmsp.Emitter =
functio... | true |
4bc9077195a1bd1aa4354f5dedc33e66bdbf33a2 | JavaScript | sriharikapu/stopthevirus | /react_front_end/src/pages/LandingPage.js | UTF-8 | 4,697 | 2.546875 | 3 | [] | no_license | import React, { useRef, useEffect, useState } from "react";
import { Button } from "./components/Button";
import { withStyles } from "@material-ui/core";
// put your custom styles in here
const styles = (theme) => ({});
const LandingPage = () => {
// state
const [yourStateItem, setYourStateItem] = useState();
c... | true |
30a43405961b31bf95333630e6762c42f858ec58 | JavaScript | simonswain/spitfire | /test/node_test.js | UTF-8 | 2,787 | 2.5625 | 3 | [
"MIT"
] | permissive | "use strict";
var util = require('util');
var Node = require('../lib/node.js');
exports['node'] = {
'new': function(test) {
test.expect(3);
var node = new Node({
id: 'test'
}, {
init: function(done){
test.ok(true, 'Init ran');
return done();
}}, function(err){
... | true |
959223f1e90c6634c34862a47ee71a5588b6bc08 | JavaScript | Kamoliddin2222/frtch | /js/main.js | UTF-8 | 2,393 | 2.71875 | 3 | [] | no_license | let elList = document.querySelector("#list");
let elbtnPrev = document.querySelector("#prev")
let elbtnNext = document.querySelector("#next")
let elInput = document.querySelector("#input")
let searchFilim = "hulk"
let apiKey = '8930fd2a'
let filimPage = 1;
elInput.addEventListener("change", (x) => {
let searchI... | true |
b654db75e33e8099b9d219b36031a22210f85dfe | JavaScript | arjun-hari/Luminar-works | /javascript_programs/objectprograms/objectone.js | UTF-8 | 804 | 3.953125 | 4 | [] | no_license | // object
// key value
// array []
// object {} property:value , key:value
// property/keys=>jan feb march april may
// values are fetched by using corresponding key or property
var expens={jan:10000,feb:15000,march:22000,april:23000,may:20000};
// either expens[property/key] or expens.property/key
console.log(e... | true |
63239845bd3cab05aeadf2b3a0a76b6cec70fd84 | JavaScript | Ralev93/HackBulgaria | /week0/fibo/fib-test.js | UTF-8 | 537 | 3.03125 | 3 | [] | no_license | "use strict"
var fibonacci = require("./fib").fib;
/*
nth_fibonacci(1) === 1
nth_fibonacci(2) === 1
nth_fibonacci(3) === 2
nth_fibonacci(10) === 55
*/
exports.testFibonacciForOne = function(test) {
test.equal(1,fibonacci(1));
test.done();
}
exports.testFibonacciForTwo = function(test) {
test.equal(1,fibonac... | true |
0ee7482f3502b2708b1d32f059d4cb4a28c18eea | JavaScript | Financial-Times/o-ads | /test/qunit/utils.responsive.test.js | UTF-8 | 2,723 | 2.796875 | 3 | [] | no_license | /* globals QUnit: false */
'use strict'; //eslint-disable-line
QUnit.module('utils.responsive');
QUnit.test('resizing the browser window, simple config', function(assert) {
const clock = this.date();
this.viewport(1, 1);
const callback = this.stub();
const viewports = {
large: [300, 200],
medium: [200, 100]... | true |
5bb2ac7a6ccf934db3d3fcfa45f16275eb1ac034 | JavaScript | muhammadpauzi/express-rest-api-crud-users | /utils/users.js | UTF-8 | 1,703 | 2.796875 | 3 | [] | no_license | const fs = require('fs');
const { join } = require('path');
const fileData = 'data.json';
const dirPath = './data'
const pathData = join(dirPath, fileData);
// Make a folder data if not exists yet
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath);
}
// Make a file data.json if not exists yet
if (!fs.existsSyn... | true |
dbc4ebf89c383328ae1933ffe40950141f9f7695 | JavaScript | minprogramador/apiPai | /lib/captcha/captcha.js | UTF-8 | 2,514 | 2.734375 | 3 | [] | no_license | "use strict";
const Curl = require('../curl');
const Util = require('../util');
const configDb = require('../../config/dados2Cap.json');
var configCap = configDb.modulos.captcha;
module.exports = function(value) {
const Utill = new Util();
const curl = new Curl();
configCap = Object.assign(configCap, valu... | true |
2f168748dc2b0fa047a66683150b07f899464f1b | JavaScript | computershawn/frontend-nanodegree-feedreader | /jasmine/spec/feedreader.js | UTF-8 | 6,443 | 3.359375 | 3 | [] | no_license | /* feedreader.js
*
* This is the spec file that Jasmine will read and contains
* all of the tests that will be run against your application.
*/
/* We're placing all of our tests within the $() function,
* since some of these tests may require DOM elements. We want
* to ensure they don't run until the DOM is read... | true |
0750b4e4054314cb1bdacaf4cf309b0d7f0c9a8b | JavaScript | RussBeall/fcc-snippets | /sunion.js | UTF-8 | 861 | 4.1875 | 4 | [] | no_license | function uniteUnique(...arrays) {
var args = []; // Empty array, at first.
for (var i = 0; i < arguments.length; i++) {
args.push(arguments[i])
} // Now 'args' is an array that holds your arguments.
let result = [];
args.forEach(vector => {
vector.forEach( value => {
if(result.length > 0) {
... | true |
edbc7fe99fb74be5a13bfdccfb1f50b81800fb7f | JavaScript | ThunbergOlle/backpack.tf-bot | /bot.js | UTF-8 | 3,392 | 2.546875 | 3 | [] | no_license | const SteamUser = require('steam-user'); //Requires a module for login ect.
const SteamCommunity = require('steamcommunity'); //Requires a module for the steam communit
const api = require('./api.js');
const config = require('./config.json');
const client = new SteamUser(); //CREATES A NEW CLIENT FOR SteamTotp
const c... | true |
644da44f07b015363f30780893b6be2ab4c1bcb9 | JavaScript | jacashira/platzi-curso-practico-js | /cuadrado.js | UTF-8 | 547 | 3.40625 | 3 | [
"MIT"
] | permissive | //codigo del cuadrado
console.group('Cuadrados');
const ladoCuadrado = 5;
console.log(`Los lados del cuadrado miden: ${ladoCuadrado} cm`);
const perimetroCuadrado = ladoCuadrado * 4;
console.log(`El perímetro de del cuadrado es: ${perimetroCuadrado} cm`);
const areaCuadrado = ladoCuadrado * ladoCuadrado;
console.log... | true |
7bcd85ff41421e62300066780939322e013e0501 | JavaScript | ngoctuanit07/reactjs | /tutorial/src/index.js | UTF-8 | 471 | 2.90625 | 3 | [] | no_license | import React from "react";
import ReactDOM from "react-dom";
/*
* JSX rules
* return single element
* div /section /article or Fragment
* use cameCase for html attribute
* className instead ofclass
* close every element
* formatting
* */
/*function Greeting(){
return <h4>Hello world</h4>
}*/
const Greeting = () => ... | true |
e2f7c035bbbb52569674022fd2bbb0ec5b347895 | JavaScript | MeronGit/TeamMM | /praks7/main.js | UTF-8 | 476 | 2.828125 | 3 | [] | no_license |
function logIn() {
let emailInput = document.getElementById("email");
let passwordInput = document.getElementById("password");
if (emailInput.value == "asd@asd.ee" &&
passwordInput.value == "asd") {
document.body.className = "loggedIn";
} else {
let pog = document.getElemen... | true |
027b22e989a4a094d3d087ed762e80bf4b0be308 | JavaScript | elehedgehog/zny | /js/latlon.js | UTF-8 | 3,004 | 2.59375 | 3 | [] | no_license |
let layers = L.featureGroup();
const setLatlon = () =>{
let mapBounds = map.getBounds();
let left = mapBounds._southWest.lng,
bottom = mapBounds._southWest.lat,
top = mapBounds._northEast.lat,
right = mapBounds._northEast.lng;
let mapHeight = top - bottom,
mapWidth = right ... | true |
3a9397f833a3a5b6b0489e614399cacfdb59f594 | JavaScript | emyesme/notSoEasyTaxi | /back/queries.js | UTF-8 | 41,107 | 2.59375 | 3 | [] | no_license | const Pool = require('pg-pool')
const {validationResult} = require('express-validator/check')
/*Modo Docker */
const config = require('./configsDocker')
/*Modo Estandar */
/*const config = require('./configs')*/
const poolAdmin = new Pool(config.configAdmin);
const poolClient = new Pool(config.configUserClient);
co... | true |
89b42ff93653c0e4d57c10d4c664e17a8053ad22 | JavaScript | diloretodg/musicbox | /client/src/utils/API.js | UTF-8 | 679 | 2.578125 | 3 | [] | no_license | import axios from "axios";
export default {
/////////////////////////////////
///////// Song API CRUD /////////
// Create Song
createSong: function(songData) {
axios.post("/api/song", songData)
},
// Get all Songs from database
getAllSongs: function() {
return axios.get("/... | true |
259db4345cd873ea5544058eed100c3175933138 | JavaScript | jessler91/javascript-workbook | /02week/pigLatin.js | UTF-8 | 2,514 | 3.5 | 4 | [] | no_license | 'use strict';
const assert = require('assert');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
function pigLatin(word) {
console.log("========wordIndex/firstVowel========");
word = word.trim().toLowerCase();
const vowel = ["a",... | true |
90083eee169348b341b3155db562c8fc334f4823 | JavaScript | evdokimovm/MEAN-Geolocation-App | /public/js/location.js | UTF-8 | 540 | 2.65625 | 3 | [] | no_license | app.factory('myCoordinates', ['$q', function myCoordinates($q) {
var deferred = $q.defer()
if (window.navigator && window.navigator.geolocation) {
window.navigator.geolocation.getCurrentPosition(getCoordinates)
} else {
deferred.reject({ msg: "Browser does not supports HTML5 geolocation" })
}
function getCo... | true |
4b56ee226b6131f44878dd97322c115e58e13223 | JavaScript | JustinThorReid/screeps | /task.move.js | UTF-8 | 1,262 | 2.640625 | 3 | [] | no_license | /**
* Created by phatn on 10/29/2016.
*/
module.exports = function(creep, destPos, inHurry=false, build=true, repair=true, spawn=false) {
// Do things while walking
if(!inHurry && creep.carry.energy > 0) {
var road = _.filter(creep.pos.look(), function (a) {
if(a['type'] == LOOK_STRUCTURES... | true |
299d412cc29907fda4dad59a4bf9f0d3e66ef428 | JavaScript | IP-CAM/Build-iOS-app-Opencart | /platforms/ios/www/js/lib.js | UTF-8 | 3,260 | 2.546875 | 3 | [] | no_license | // Настройки для связи с OpenCart RestAPI
apiKey = "123";
//apiPath = "127.0.0.1";
apiPath = "ocm.lvovych.com";
// Взаимодействие с OpenCart RestAPI
var RestAPI = {
getcategories: function (dataobj) {
$.ajax({
url: 'http://' + apiPath + ':80/index.php?route=extension/feed/rest_api/category&key=' + apiKey,
dat... | true |
3b0d849cbc97fcbbfe2479158ee2dad91a08d62d | JavaScript | master-sebastian/server-express-socketio | /src/databases/scripts/manager_script.js | UTF-8 | 1,082 | 2.515625 | 3 | [] | no_license | const { readFileSync } = require('fs');
const sequelize = require("./../db")
const controlVersion = require("./control_version")
const {FgRed, FgGreen, Reset, Bright, FgBlue } = require('./../../utils/ColorTerminal')
let listRequestScript = process.argv.slice(2);
for (let element of listRequestScript) {
if(contro... | true |
478ba106554b5ffb435463580886f778211942a7 | JavaScript | BYOUINZAKA/LeetCodeNotes | /174.js | UTF-8 | 988 | 3.03125 | 3 | [
"MIT"
] | permissive | /*
* @Author: Hata
* @Date: 2020-07-24 16:12:50
* @LastEditors: Hata
* @LastEditTime: 2020-07-24 17:48:37
* @FilePath: \LeetCode\174.js
* @Description: https://leetcode-cn.com/problems/dungeon-game/
*/
import * as m149 from "/149.js"
/**
* @param {number[][]} dungeon
* @return {number}
*/
var calculateMinimumH... | true |
d673c008f1be6c5c70562d84e4dc39ffa5a9e624 | JavaScript | resilowash/node-sandbox | /reducers.js | UTF-8 | 362 | 4.0625 | 4 | [] | no_license | //illustrate a reducer
const array1 = [1,2,3,4];
//define a reducer function returns the accumulator + the current value
const reducer = (accumulator, currentValue) => accumulator + currentValue;
const reducer2 = (accumulator, currentValue) => accumulator + currentValue.toString();
console.log(array1.reduce(reducer)... | true |
5ae045e4b907993490fcb618a09e553093dd1d02 | JavaScript | garciadiazjaime/d3-chicago-listings | /lib/d3.js | UTF-8 | 3,329 | 2.6875 | 3 | [] | no_license | import { toolTipStyle } from '../styles/main'
function setYAxis(svg, maxValue, height) {
const scale = d3.scale
.linear()
.domain([0, maxValue])
.range([height, 0])
const axis = d3.svg.axis()
.orient('left')
.scale(scale)
const axisGroup = svg.append('g')
.attr('transform', 'translate(70, 2... | true |
4c1a7f32e415aa0df43e7af21fe98d2a11b4a8ee | JavaScript | libbyschuknight/js_files | /1-objects.js | UTF-8 | 1,784 | 3.8125 | 4 | [] | no_license | var getReview = function (movie) {
switch (movie) {
case "Toy Story 2":
return "Great story. Mean prospector.";
case "Finding Nemo":
return "Cool animation, and funny turtles.";
case "The Lion King":
return "Great songs.";
default:
retu... | true |
dadb83fa8b12ab49e359ad27f1b5b7a63857ebf5 | JavaScript | singingwolfboy/react-slate | /packages/react-slate-core/src/utils/stringifyStyledAnsiChars.js | UTF-8 | 842 | 2.984375 | 3 | [
"MIT"
] | permissive | /* @flow */
type StyledChar = {
content: string,
style: string,
};
const RESET = '\u001b[0m';
export default function stringifyStyledAnsiChars(chars: StyledChar[]): string {
let output = '';
let lastStyle = '';
let needsTrailingReset = false;
for (let i = 0; i < chars.length; ++i) {
const char = cha... | true |
82e566e97987de5ad345dd65f9d168ac7d2e52a3 | JavaScript | revelio/revelio-apidoc | /tests/typeFactoryTests.js | UTF-8 | 6,328 | 2.875 | 3 | [
"MIT"
] | permissive | require("jasmine");
describe("create", function() {
var _factory;
beforeEach(function() {
_factory = require("../lib/typeFactory.js");
});
it("object is null - returns null", function () {
//Arrange
//Act
var result = _factory.create(null);
... | true |
01722a28c236876561e58834d9eefa88c5a980b8 | JavaScript | coderbunker/cpp-to-js-example | /store-react/src/App.js | UTF-8 | 1,110 | 2.859375 | 3 | [] | no_license | import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
const storejs = require('storejs');
class App extends Component {
state = {
value: 1
}
componentDidMount() {
storejs().then((m) => {
this.store = m;
this.setState({value: this.store._retrieve_value(... | true |
366a53042161a63b95222372d89c285e099a9615 | JavaScript | GiulianoPrimavera/js-snack-es6 | /js/squadra_calcio.js | UTF-8 | 1,888 | 3.6875 | 4 | [] | no_license | "use strict"
/*
-creare array di oggetti (squadre di calcio)
-assegnare numeri random per punti e falli subiti
-creare array contentente solo nomi e falli subiti
*/
const squadre = [
{
nome : "squadra 1",
puntiFatti : 0,
falliSubiti : 0,
},
{
nome : "squadra 2",
pun... | true |
1605e1798c61718450e8863296bb73c85ca35237 | JavaScript | shubamWanclouds/tasks | /ES6/closures.js | UTF-8 | 615 | 3.671875 | 4 | [] | no_license | let countCallWrapper = () => {
let count = 0;
let countCall = () => {
console.log(`The function has been called ${++count} Times`);
}
return countCall;
}
let functionCallCounter = countCallWrapper();
functionCallCounter();
functionCallCounter();
functionCallCounter();
let hittingApiInLoop = () =>{
f... | true |