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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7476ba2a0360dc0238112b0d2bfc84593af35195 | JavaScript | AdamCMacKinnon/PythonStudyGroup | /array.js | UTF-8 | 219 | 3.6875 | 4 | [] | no_license |
let array = [1,2,3,4,5];
function reverse(array){
let newArr = [];
for(let x = 0; x < array.length; x++){
newArr.unshift(array[x])
}
return newArr
}
console.log(reverse(array)); | true |
7382dab542483ba409da486e8498bdeae06bb8a7 | JavaScript | Anirban-Ray/Pixlie-Web-Test | /backend/app.js | UTF-8 | 4,631 | 2.5625 | 3 | [] | no_license | const express = require('express');
const path = require('path');
const mysql = require('mysql');
const cors = require('cors')
const app = express();
app.use(cors());
const dbConfig = require('./config/connection')
var connection = mysql.createConnection(dbConfig);
connection.connect();
app.use(express.static(path.join... | true |
58180950ebaec7906c106b4dbf6df0bc6249d6cd | JavaScript | Daron06/my-social-app | /src/pages/Friends.jsx | UTF-8 | 2,365 | 2.5625 | 3 | [] | no_license | import React from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { addFriend, deleteFriend } from '../redux/action/friends';
import { messageFromFriend } from '../redux/action/messages';
const Friends = () => {
const people = useSelector(({ friends }) => friends.people);
const friends = us... | true |
1059c5d43d45790a0cef45e079264d7aa44c8ff9 | JavaScript | andreamartz/sb-47-8-trees | /tree.js | UTF-8 | 4,471 | 3.90625 | 4 | [] | no_license | "use strict";
/** TreeNode: node for a general tree. */
class TreeNode {
constructor(val, children = []) {
this.val = val;
this.children = children;
}
sum(total = 0) {
// can model this using either a stack (DFS) or queue (BFS) ADT
const toVisitStack = [this]; // when we first call sum, `this` ... | true |
0cfe3dc1d4ecd3eedb51750368ebcd8d92a24419 | JavaScript | RaFi166/javascript-dom | /object.js | UTF-8 | 516 | 3.53125 | 4 | [] | no_license | console.log("rafi")
let myObject = {
name:'rafi',
age:24,
occup:'engineer',
address: ['noakhali','tangail','uttara','Gazipur'],
funcone : function(){
console.log('this is function u know');
},
functwo: function(){
console.log(this.age);
}
}
console.log(myObject.occup);
m... | true |
a22364f8932a9e048b994a177ffdc8b48999a262 | JavaScript | markevans/onionjs | /src/onion/set.js | UTF-8 | 1,666 | 2.671875 | 3 | [
"MIT"
] | permissive | if(typeof define!=='function'){var define=require('amdefine')(module);}
define([
'onion/collection',
], function(Collection){
return Collection.sub("Set")
.decorate('__populateItems__', function (souper, items) {
souper(this.__removeDuplicatesOf__(items))
})
.decorate('set', function (souper, ... | true |
23da7f4ef652132abbdc2f83669fbac59722d3af | JavaScript | oneillci/Todos | /express-serve/index.js | UTF-8 | 1,581 | 2.96875 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const port = 3000;
const url = "/api/todos";
let todos = [];
todos.push({id: 1, name: "first", isComplete: false});
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(function(re... | true |
8c3ee5e118297e8dfb1dfbd6e2fc529cd15848ac | JavaScript | Gostis/fullstack-sandbox | /frontend/src/todos/components/ToDoListForm.jsx | UTF-8 | 5,233 | 2.703125 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import { makeStyles } from "@material-ui/styles";
import {
TextField,
Card,
CardContent,
CardActions,
Button,
Typography,
Checkbox,
} from "@material-ui/core";
import DeleteIcon from "@material-ui/icons/Delete";
import AddIcon from "@material-ui/icons/Ad... | true |
9fa0acdb96b75ee6112d1e0963bf87e6a809209f | JavaScript | jmdeldin/content-usability | /spec/interpreters.spec.js | UTF-8 | 1,665 | 2.9375 | 3 | [
"MIT"
] | permissive | /*global buster: true, describe: true, it: true, before: true*/
/*global gradeInterpreter: true*/
"use strict";
var expect = buster.assertions.expect;
buster.spec.expose();
describe('gradeInterpreter', function () {
before(function () {
this.f = gradeInterpreter;
});
it("penalizes content over a... | true |
df6b0bfb27c7f98dcf13b92061dc1d364f325918 | JavaScript | ryan90butler/code-war-solutions | /8 kyu/palindrome-strings.js | UTF-8 | 321 | 3.75 | 4 | [] | no_license | // A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. This includes capital letters, punctuation, and word dividers.
function isPalindrome(line) {
return line.toString() == line.toString().split('').reverse().join('')
}
console.log(isPalindrome('11211')... | true |
186c06ae2f6c0f95683736dd58ce780e8bde156c | JavaScript | QlikExpert/nebula.js | /apis/conversion/src/__tests__/array-util.spec.js | UTF-8 | 751 | 2.75 | 3 | [
"MIT"
] | permissive | import arrayUtil from '../array-util';
describe('array util', () => {
describe('isOrderedSubset', () => {
it('arrays is subset', () => {
const arr1 = [0, 1, 2, 3, 4, 5];
const arr2 = [2, 3];
const arr3 = [0, 3];
const arr4 = [0, 3, 5];
expect(arrayUtil.isOrderedSubset(arr1, arr2)).t... | true |
9178d875fe5eb4abd30132d55283a5c38e58ffb8 | JavaScript | myvisualdna/Weather-Next | /components/navigation.js | UTF-8 | 4,368 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { useDispatch } from "react-redux";
import FetchOneAsync from "../redux/actions/firstFetch";
import FetchOneAsyncImperial from "../redux/actions/firstImperial";
import Link from "next/link";
import styles from "../styles/styling.module.scss";
import axios from ... | true |
e7eda2a8b3c69743bffe9277446685ab6c22ad50 | JavaScript | sebastianandreasson/musicSpace | /src/scene/planet.js | UTF-8 | 798 | 2.578125 | 3 | [] | no_license |
module.exports = (scene, tracks) => {
const planets = []
const r = 50
// const materialNormalMap = new THREE.MeshPhongMaterial( {
// specular: 0x333333,
// shininess: 15
// })
const materialNormalMap = new THREE.PointsMaterial({
size: 50
})
const geometry = new THREE.SphereGeometry( r, 100, 50... | true |
14db08f69f20aeb2e914c90f80059c72bf2900ce | JavaScript | UddhavNavneeth/JavascriptObfuscatorWebsite | /server.js | UTF-8 | 1,382 | 2.625 | 3 | [] | no_license | const express = require('express');
const bodyParser = require('body-parser');
const fs = require('fs');
const path = require('path');
const JavaScriptObfuscator = require('javascript-obfuscator');
var multer = require('multer')
var upload = multer({ dest: 'uploads/' })
let app = express();
let port = process.env.POR... | true |
97c8f8313d8176cb5277e6df18cbd31783263571 | JavaScript | rtsinani/wall | /js/app/wall.js | UTF-8 | 7,276 | 2.90625 | 3 | [] | no_license | // The final result can be found at [https://github.com/rtsinani/wall/blob/master/test/index.html](https://github.com/rtsinani/wall/blob/master/test/index.html).
//
// - Style: all private methods & objects start with underscore (_).
(function () {
// Global namespace
var wall = window.wall = {
// This is the en... | true |
8327d0473e09649a503e72732896f669fcca07dd | JavaScript | dede79/cruise-ships | /__tests__/Itinerary.test.js | UTF-8 | 682 | 2.640625 | 3 | [] | no_license | const Itinerary = require ("../src/Itinerary.js");
const Port = require("../src/Port.js");
describe('Port', () => {
it('can be instantiated', () => {
const port = new Port();
expect(port).toBeInstanceOf(Object);
});
});
describe('Itinerary', () => {
let dover;
let calais;
let itin... | true |
3b38a808c42157eed904c17b633f2e9d7b8d0c78 | JavaScript | karaivanska/JavaScript-Fundamentals | /3.2 Functions-Exercise/06. validityChecker.js | UTF-8 | 1,430 | 4.5 | 4 | [
"MIT"
] | permissive | /*
Write a JS program that receives two points in the format [x1, y1, x2, y2] and checks if the distances between each point and the start of the cartesian coordinate system (0, 0) and between the points themselves is valid. A distance between two points is considered valid, if it is an integer value. In case a distanc... | true |
87a3618719dd1faee51da7e8758388b39a3e05be | JavaScript | pete88b/object-procedural-bridge | /opb-web-demo/trunk/src/main/webapp/scripts/global.js | UTF-8 | 1,624 | 2.921875 | 3 | [] | no_license | /*
Returns an element of the document if the id of the element ends
with a colon followed by shortName.
*/
function getElem(shortName) {
var elements = document.getElementsByTagName("*");
for (var i=0; i<elements.length; i++) {
try {
var fullId = elements[i].id;
if (ful... | true |
bc20356b5c9f676e5d9b9a323a02e6c0e4015cbc | JavaScript | f3dc4r/corso-javascript-avanzato | /Lezione 5/typescript/functions/funzioni.js | UTF-8 | 669 | 3.796875 | 4 | [] | no_license | var miaVar;
function addizione(a, b) {
return a + b;
}
function concatena(a, b) {
return a + b;
}
miaVar = concatena('ciao a tutti', ' questo è il corso di js avanzato');
console.log(miaVar);
// senza tipizzare i nostri argomenti
// e il valore di ritorno
// andiamo facilmente incontro ad errori
function somma(... | true |
64bc24978f9b5c3da4630b8855a8dfd8d4b854cf | JavaScript | iambrian7/aalinks-vue2 | /server/testSlugs.js | UTF-8 | 2,854 | 2.515625 | 3 | [
"MIT"
] | permissive | const MeetingGuide = require("./routes/MeetingGuide");
var { getLocations, getMeetings, distance, getRegions, getSiteNames, writeFile, getFile } = require("./routes/scrapeUtil");
const md = MeetingGuide();
md.MDmeetings();
// const locationSlugs = md.meetingSlugs(md.globalLocations);
// console.log("\n\nlocations\n\... | true |
78204ecac9b61b4fdd7379f6b880609584597e1e | JavaScript | wangbinWSS/wangbinWSS.github.io | /js/index.js | UTF-8 | 4,535 | 2.84375 | 3 | [] | no_license | (function(window,document){
const methods = {//方法
$(selector, root = document) {
return root.querySelector(selector);
},
$$(selector, root = document) {
return root.querySelectorAll(selector);
}
};
let Active = function(options){
this._init()... | true |
14d30ca2c13e6c6d12e953e34e89642cab212049 | JavaScript | CMRandall669/JavaScript-Projects | /Basic JavaScript Projects/Project1_expressions_alert/JS/main.js | UTF-8 | 518 | 3.78125 | 4 | [] | no_license | window.alert("Hello, World!"); //This provides the window alert you have to close
var x = "This is a variable"; //This assign X to the expression "This is a variable"
var x = x.fontcolor("green"); //This assigns the font color to X variable
var y = " and this is the concatenating a string line of the code."; //This is ... | true |
61d079f9ba1f310836f4a034f492ecb0b11b119b | JavaScript | kwonjoseph/x-cell | /client/js/table-view.js | UTF-8 | 3,463 | 3.1875 | 3 | [] | no_license | const { getLetterRange } = require('./array-util');
const { removeChildren, createTR, createTH, createTD } = require('./dom-util');
class TableView {
constructor(model) {
this.model = model;
}
init() {
this.initDomReferences();
this.initCurrentCell();
this.renderTable();
this.attachEventHand... | true |
0a23563ad0a1b8983fca8b56c51eeee71fc4de0f | JavaScript | vega/vega-lite-api | /test/mark-test.js | UTF-8 | 1,301 | 2.734375 | 3 | [
"BSD-2-Clause"
] | permissive | const tape = require('tape'),
vl = require('../');
function equalSpec(t, api, spec) {
t.equal(JSON.stringify(api.toObject()), JSON.stringify(spec));
}
tape('Mark types can be defined by method, string, or object', function(t) {
const spec = { mark: {type: 'bar'} };
[
vl.markBar(),
vl.mark('bar'),... | true |
d5cd50495064063aa579b65130afcb701060d03a | JavaScript | biniek-io/toppler | /src/scripts/assets/player/down.js | UTF-8 | 1,407 | 2.71875 | 3 | [] | no_license | import {ellipse} from '../_ellipse';
/**
* Player looking down
* @type {HTMLCanvasElement}
*/
let canvas = document.createElement('canvas');
canvas.width = 80;
canvas.height = 80;
let ctx = canvas.getContext('2d');
export {canvas as playerDown};
let x = 40;
let y = 40;
ctx.strokeStyle = '#000000';
ctx.lineWidt... | true |
93bbd56611594839916a52b6fcde4332ad42a87d | JavaScript | AgnieszkaJarosik/js-homework | /zjazd 2/9.js | UTF-8 | 585 | 4.625 | 5 | [] | no_license | // Create a function that takes given array. Then takes a random element,
// removes it from the array and pushes it to result arrays.
// This takes place as long as there are elements in source array.
const array = [1,6,23,8,4,8,3,7];
function returnRandomArray (arr) {
const newArray = [];
while (arr.length ... | true |
42a66d3a4a5a7b905ac8dc9221251e185a3cac57 | JavaScript | preethamvishy/node-snippets | /socket.js | UTF-8 | 1,429 | 2.765625 | 3 | [
"MIT"
] | permissive | var http = require('http'),
index = `<html>
<head>
<script src='/socket.io/socket.io.js'></script>
<script>
var socket = io();
socket.on('Hi', function(data) {
addMessage(data.message);
socket.emit('New client', {data: 'foo!', id: data.id})... | true |
f0169d267fd7e50a14f647a5c293715aac1389db | JavaScript | talwaserman/node-nltools | /test/test-token-simple.js | UTF-8 | 1,323 | 2.96875 | 3 | [
"MIT"
] | permissive | var tokenizer = require('../lib/token/simple');
var spaceToken = new tokenizer.SpaceTokenizer()
exports.SpaceToken = function(test) {
test.expect(5);
var tok = spaceToken.tokenize("Elizabeth is hungry");
test.equal(3, tok.length, "Number of Tokens");
var tok = spaceToken.tokenize("He saw the frog with the te... | true |
fd524190c10380f34039b5351e2fe4ef60c2b21a | JavaScript | skalum/js-tictactoe-rails-api-v-000 | /app/assets/javascripts/tictactoe.js | UTF-8 | 2,673 | 3.625 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive |
const WIN_COMBINATIONS = [[0, 1, 2], [3, 4, 5], [6, 7, 8], [0, 3, 6], [1, 4, 7], [2, 5, 8], [0, 4, 8], [2, 4, 6]];
var turn = 0;
var currentGameId = 0;
$(document).ready(function() {
attachListeners();
});
var player = function() {
return turn % 2 === 0 ? 'X' : 'O';
}
function updateState(square) {
$(square)... | true |
907b3f2a8102faf3991557e8e0cb28950d48760d | JavaScript | Charlesincharge43/playground | /Neat_Stuff/Class_Syntax/Mammals_n_Cats_ES6.js | UTF-8 | 2,290 | 4 | 4 | [] | no_license | //-------------------------- ES6 SYNTAX! ----------------------------------
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
//-----------------Mammal: this is the superclass---------------------------... | true |
284fb66cad70abc10be43d498d1a6304482b67f9 | JavaScript | NaldsonChagas/Authentication | /assets/js/controllers/LoginController.js | UTF-8 | 1,087 | 2.5625 | 3 | [] | no_license | import { UserService } from "../service/UserService";
import { User } from "../models/User";
import { View } from "../views/View";
import { ErrorMessage } from "../views/ErroMessage";
export class LoginController {
constructor() {
const $ = document.querySelector.bind(document);
this._form = $('#login-for... | true |
7d8e26bf3cfcb9891ab1a969a003106ccf3845f9 | JavaScript | jlei523/svg-to-png-browser | /index.js | UTF-8 | 1,376 | 2.984375 | 3 | [] | no_license | //open source the following:
//svg string to blob url
//svg string to png blob url
const svgToPngBase64 = (svgString) => {
return new Promise((res, rej) => {
var image = new Image();
let xml = window.btoa(unescape(encodeURIComponent(svgString)));
image.src = "data:image/svg+xml;base64," + xml;
let u... | true |
8b588e1a9561a45e6faae222e8b66443d6e56f01 | JavaScript | vipulsaluja/IPL-Bidding | /public/scripts/pages/Login/controller.js | UTF-8 | 3,407 | 2.625 | 3 | [] | no_license | var myApp= angular.module('IPL');
myApp.controller('loginController', ['$scope','content',
function($scope,content)
{
console.log($scope.$parent.loggedIn);
var userDetails={};
$scope.submitForm=function(values)
{
if($scope.usernameGood && $scope.emailGood && $scope.passwordGood)
{
console.log(values.username+valu... | true |
c495227de621d9bf96eff2d2df1347f0f962ffd8 | JavaScript | cjhensen/thinkful-tube | /js/app.js | UTF-8 | 2,454 | 2.9375 | 3 | [] | no_license |
const searchBtn = '.js-btn-search';
const nextBtn = '.js-btn-next';
const searchInputField = '.js-search-query';
const apiKey = "AIzaSyCEyNr2k3guOCfAsS2WS0Ct8YNjUtWarec";
const YOUTUBE_SEARCH_URL = "https://www.googleapis.com/youtube/v3/search";
function getDataFromApi(searchTerm, callback) {
const settings = {
... | true |
b92627d54e67bdb0cb955d934b7c71c1a79463b4 | JavaScript | Reoup/newReactPractice | /src/componenets/search_bar.js | UTF-8 | 1,238 | 3.125 | 3 | [
"MIT"
] | permissive | import React, {Component} from 'react';
class SearchBar extends Component{
constructor(props){
super(props);
// console.log(props); // Component의 constructor가 있는 것을 확인할 수 있음
//term이라는 정보를 가져오는데 참고로 term은 search term을 의미하는 프로퍼티
// 유저가 검색 인풋에 업데이트를 할 때마다 프로퍼티 term이 업데이트 되거나, 변경사항을 받아옴... | true |
a3656c96cee521b4e99459b05ba6fc78aa29e4a4 | JavaScript | oort7/chrome-webstore-polskie-radio-downloader | /getPagesSource.js | UTF-8 | 979 | 2.5625 | 3 | [] | no_license | function getProgramLink(document_root) {
path = "#articleSoundsList > div > div.swiper-wrapper > ul > li > div.play-wrap";
el = document_root.querySelector(path).innerHTML;
start = el.search("static.prsa.pl");
end = el.search(".mp3");
if (start>=0 && end>=0) {
end+=4;
len = end... | true |
7adbb80c52f75cbc2fbdcd7a3df1f170d4650aca | JavaScript | VNeddy/2048 | /scripts/animate.js | UTF-8 | 1,033 | 3.078125 | 3 | [] | no_license | function showNumberWithAnimation(randx, randy, rand_number) {
number_cell = $('#number_cell_' + randx + '_' + randy);
number_cell.css({
'background': getNumberBackgroundColor(rand_number),
'color': getNumberColor(rand_number),
'font-size': getNumberFontSize(rand_number),
});
... | true |
aa655a2b09d84da2507bad65df96d62cdc0138d1 | JavaScript | Luryy/NodeJs | /02-exiting-process/index.js | UTF-8 | 685 | 2.78125 | 3 | [
"MIT"
] | permissive | const express = require('express')
const app = express()
app.get('/kill-gracefully', (req, res) => {
res.send('Killing proccess gracefully!')
process.kill(process.pid, 'SIGTERM')
})
app.get('/kill-ungracefully', (req, res) => {
res.send('Killing proccess ungracefully!')
process.exit()
})
const server = app.... | true |
3571acca30e65a066084a4106177d110ddec96dd | JavaScript | xunilrj/xunilrj.github.io | /customElements/quotesmall.js | UTF-8 | 1,787 | 2.578125 | 3 | [] | no_license | class QuoteSmall extends HTMLElement {
constructor() {
super();
}
connectedCallback() { this.render(); }
attributeChangedCallback() { this.render(); }
render() {
const title = this.getAttribute("title");
let href = this.getAttribute("href");
... | true |
a535966c88e8ad3f0996c2438ce1e3134f53162e | JavaScript | stalekc/ruby_pw | /app/assets/javascripts/main.js | UTF-8 | 697 | 2.921875 | 3 | [] | no_license | function show_result(data) {
$('#result').empty();
let result = document.getElementById("result");
for(let i=0; i < data.value.length; i = i+2){
let new_row = result.insertRow(result.rows.length);
let cell1 = new_row.insertCell(0);
let text1 = document.createTextNode(data.value... | true |
a9bbd5e9725585933372cba1579683d8f12a7e84 | JavaScript | amerriman/js-jasmine-primer | /spec/spec.js | UTF-8 | 969 | 3.3125 | 3 | [] | no_license | var code = require('../main.js');
describe('Hello World', function(){
it("says 'hello world!' when ran", function(){
expect(code.outputHelloWorld()).toEqual("Hello, world!");
});
});
// describe('Tax Calculator', function(){
// it('should tax 10% on the first $10', function(){
// expect(code.calculate... | true |
f4b79917737c32deb5679461c1a9f66a23a16e21 | JavaScript | Iamheathsmith/401-WhiteBoard | /whiteboard-4/lib/solution.js | UTF-8 | 401 | 2.9375 | 3 | [] | no_license | 'use strict';
const doThing = module.exports = {};
doThing.findMatch = function(arr1, arr2) {
if (!arr1 || !arr2 ) return null;
if (!Array.isArray(arr1) || !Array.isArray(arr2)) return null;
for (let i = 0; i > arr1.length || arr2.length; i++) {
let test = arr1.filter((n) => arr2.includes(n));
if (test... | true |
1f04b52671e03bdd24b0caf48241677db21e4676 | JavaScript | hvilloria/Hack | /Proyecto/shared_content/app/assets/javascripts/components/lib/AcademicWeekServices.es6.jsx | UTF-8 | 1,013 | 2.546875 | 3 | [] | no_license | const searchweeks = () => {
return new Promise((resolve, reject) => {
fetch('/students/academic_weeks')
.then((value) => {return value.json()})
.then((data) => {resolve(data);})
.catch((err) => {reject(err)})
})
}
const searchWeeksnotes = (id) => {
return new Promise((resolve, reject) => {
fe... | true |
dec5b8ecc3ec68910355fa04ebdea18514436ee7 | JavaScript | nmuchiri/project-4-backend | /Unit-Three/Team-5-wrong-repo /src/utilities/functions.utilities.js | UTF-8 | 236 | 2.5625 | 3 | [] | no_license | //takes res error and return it into a readable format
export const resMessage = (err) => {
return (
err.response &&
err.response.data &&
err.response.data.message) || err.message ||
err.toString();
} | true |
964741e1c9dc8e5147c26463300b87574c326d9d | JavaScript | BobbyAD/node_academind | /js_basics/objects.js | UTF-8 | 334 | 4.25 | 4 | [] | no_license | const person = {
name: "Bobby",
age: 29,
greet() {
console.log("Hi, I'm " + this.name + " and I'm " + this.age);
},
};
console.log(person);
person.greet();
// destructuring
const printName = ({ name }) => {
console.log(name);
};
printName(person);
const { name, age } = person;
console.... | true |
0129d406d40d7dbf61b178104b8d6cf7143cd73c | JavaScript | besirgunduz/JavaScriptCoding | /js/033-for-dongusu-kullanimi.js | UTF-8 | 377 | 3.03125 | 3 | [
"MIT"
] | permissive | // For Dongusu
//örnek
for (var i = 0; i < 50; i++) {
if (i % 2 == 0) {
console.log(i);
}
}
//örnek
let users = ["Lorem", "Ipsum", "Dolor"];
const userListDOM = document.querySelector("#userList");
for (index = 0; index < users.length; index++) {
const liDOM = document.createElement("li");
liDOM.innerHT... | true |
d7871512b9484f8cc82e8ed30062696494c1051a | JavaScript | juliomunz/CodingDojo-JS-Mern | /Ninja/ninja.js | UTF-8 | 1,243 | 4.5 | 4 | [] | no_license | // Agregar clase Ninja
// Agregar atributo: nombre
// agrega un atributo: velocidad - da un valor predeterminado de 3
// agrega un atributo: fuerza - dé un valor predeterminado de 3
// agrega un método: sayName () - Esto debería registrar el nombre de Ninja en la consola
// agrega un método: showStats () - Esto debería... | true |
d8068fcf3a8a3c93faa91afa5f3faebf01f5cb40 | JavaScript | jrouly/dispatch | /test/lib/github.test.js | UTF-8 | 5,476 | 2.65625 | 3 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | 'use strict';
const tape = require('tape');
const nock = require('nock');
const githubRequests = require('../../lib/github.js');
const issuesFixtures = require('../fixtures/github.fixtures.js');
/* eslint-disable camelcase */
tape('[github] Receive auth object from request', function(assert) {
let auth = {
type... | true |
a2eabcd0c437ba641002e0d3fd380ca682b130d6 | JavaScript | AdamCarballo/streamdeck-unity-plugin | /pi/js/toggleHide.js | UTF-8 | 738 | 3.046875 | 3 | [
"MIT"
] | permissive | function updateToggleDelayed(toggleId, visibilityId, parent = true) {
setTimeout(function(){ updateToggle(toggleId, visibilityId, parent); }, 500);
}
function updateToggle(toggleId, visibilityId, parent = true) {
if (document.querySelector(`#${toggleId}`).checked) {
if (parent) {
document.q... | true |
b4c5fd4454c41ade4252dd97a42fc32052100df1 | JavaScript | peteyp0pz/underscore_simple_copy_yt | /Arrays/intersection.js | UTF-8 | 369 | 3.234375 | 3 | [] | no_license | const { intersection } = require('underscore');
const data = [
[1, 2, 3],
[101, 2, 1, 10],
[2, 99],
];
console.log(intersection(...data));
function intersection2(...arrays) {
let res = arrays[0]
arrays = arrays.slice(1)
arrays.forEach((e) => {
res = res.filter(Set.prototype.has, new Set(e));
})
r... | true |
4fb5f3fbc05e1e4e040efa6c3cc99c2ca7f4c1ab | JavaScript | pritpal1/JavaScript-Tutorial | /01Advanced/forOf.js | UTF-8 | 922 | 3.71875 | 4 | [] | no_license | var john = {
name:'i m john',
age:24,
isActive:true
}
var marry = {
name:'i m marry',
age:20,
isActive:true
}
var amr = {
name:'i m amr',
age:29,
isActive:false
}
let users= new Map()
users.set('john',john)// 'john user define'
users.set('marry',marry)
users.set('amr',amr)
// for (... | true |
635d795da0b27b6beb15049631a262707b8b45af | JavaScript | repicco/23.Bootstrap-JS.ChurrascoCalc | /js/main.js | UTF-8 | 3,807 | 3.125 | 3 | [] | no_license | const churrasco = {
/* Capturar */
/* Declarar */
carnivoro: null,
criancas: null,
vegetariano: null,
horas: null,
/* Declarar FIM */
getElement(id){
let get = document.getElementById(id).value
let element = get ? pars... | true |
56ec8b91d3dc59f980ff486cda3c64a72195fc11 | JavaScript | imisamarti/videos | /src/components/SearchBar.js | UTF-8 | 727 | 2.578125 | 3 | [] | no_license | import React from 'react';
class SearchBar extends React.Component{
state={term:''};
onInputChange= (event) => {
this.setState({term: event.target.value});
};
onFormSubmit = (event) => {
event.preventDefault();
this.props.onTermSubmit(this.state.term);
};
render(){
return(
<div className='ui segme... | true |
beb7d0edd13f2de3656c6278fc57c64fe677588a | JavaScript | LukeF-stack/car-rentals-frontend | /src/page-controllers/addReview.js | UTF-8 | 2,005 | 2.5625 | 3 | [] | no_license | import { App } from './../components/App.js'
import { Notify } from './../components/Notify.js'
import { Review } from '../components/Review.js';
import { User } from './../components/User.js';
import { Auth } from '../components/Auth.js';
function addReviewPageController(){
// page controller for add revie... | true |
ccf99e49e7bfae4ed50a32185ad7f8140bdebef2 | JavaScript | MayaCaltencoErick/4IV7-PSW-MAYA-CALTENCO-ERICKSEBASTIAN | /JS/cronometro.js | UTF-8 | 1,420 | 3.53125 | 4 | [] | no_license | //obtener variables de los identificadores
let temporizador = document.getElementById("temporizador");
let iniciar=document.getElementById("iniciar");
let resetear=document.getElementById("resetear");
let almacenarTiempos=document.getElementById("AlmacenarTiempos");
let tiempo=0;
let intervalo=0;
let verificador... | true |
b83002e7cbe5d44c0a7431fdbaa2d0aadffa421b | JavaScript | russellgoldman/node-course-2-web-server | /server.js | UTF-8 | 2,322 | 2.875 | 3 | [] | no_license | const express = require('express');
const hbs = require('hbs');
const fs = require('fs');
// stores all environment variables as key value pairs
// Heroku creates PORT, otherwise 3000 is default
const port = process.env.PORT || 3000;
// create an Express app
var app = express();
// takes directory that Handlebars sho... | true |
5db1789c3afe9338e6e0f0fee8ee149aeeb77047 | JavaScript | uros87/task-app | /public/js/profile.js | UTF-8 | 10,956 | 2.984375 | 3 | [] | no_license | // var skip = parseInt(sessionStorage.getItem('skip'));
// let numberOfTasks;
// let numberOfPages;
// var userID;
//fetching user profile
const getProfile = function () {
const name = document.querySelector('.profile__name')
const age = document.querySelector('.age')
const email = document.querySelector... | true |
a5a7c50bfa5bc781e0273451624e4162823f2cbc | JavaScript | kimihito/beyondcode | /source/javascripts/_single.js | UTF-8 | 2,439 | 2.53125 | 3 | [
"MIT"
] | permissive | //= require _episode
function Single() {
this.episode = new Episode("single");
this.episodeInfo = document.getElementById("single-info");
this.prevButton = document.getElementById("player-control-prev");
this.nextButton = document.getElementById("player-control-next");
this.playButton = document.getElementBy... | true |
d27278c28c8559e56c2580be327b938be22a2b0a | JavaScript | Quxiaolei/Study_RN | /Demo3/index.ios.js | UTF-8 | 5,021 | 2.84375 | 3 | [
"MIT"
] | permissive | /**
* Sample React Native App
* https://github.com/facebook/react-native
* @flow
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
Image,
TextInput,
TouchableOpacity,
Navigator,
View
} from 'react-native';
import SecondView from './secondView';
class Greeting ex... | true |
8fc12f41504ce9cbcdc02a6f065e633e9084ead5 | JavaScript | blackpointdev/account-manager-react | /src/services/authentication.service.js | UTF-8 | 948 | 2.8125 | 3 | [] | no_license | export const authenticationService = {
login,
logout
};
function login(username, password) {
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username, password })
};
return fetch("http://localhost:8080/api/aut... | true |
4edc1c693a7825436724bb6471f8485b10fb0a1a | JavaScript | carolguimari/logica-foguete | /lancamento.js | UTF-8 | 831 | 3.09375 | 3 | [] | no_license | const button = document.querySelector("button");
const p = document.querySelector("p");
const img = document.querySelector("img");
let contagem = 10
let lancamentoAutorizado = false
let id;
const lancarFoguete = () => {
img.setAttribute("src", "f48.gif")
button.innerText = "Foguete lançado!"
}
const conta... | true |
8c0b92dd0444d3ea03fd4885132d5dc9f9f30d0a | JavaScript | reshinto/reshinto.github.io | /docs/interviewPrep/designPatterns/Behavioral_patterns/State/javascript/Context.js | UTF-8 | 790 | 3.296875 | 3 | [] | no_license | /**
* The Context defines the interface of interest to clients. It also maintains a
* reference to an instance of a State subclass, which represents the current
* state of the Context.
*/
class Context {
constructor(state) {
/**
* type {State} A reference to the current state of the Context.
*/
... | true |
31fe62212784711db2c9c1f794a31530960ac8bc | JavaScript | dennfen/doc-ed | /frontend/src/components/PieChart/PieChart.js | UTF-8 | 2,791 | 2.90625 | 3 | [] | no_license | import React, { useEffect } from 'react';
import * as d3 from 'd3';
const PieChart = ({ inputData, outRadius, inRadius }) => {
// Define initial data used for pie chart
const data = inputData;
const outerRadius = outRadius;
const innerRadius = inRadius;
useEffect(() => {
// Define margins... | true |
8b572f94eef0d30fbf57733ea2e60a1b2e6a5acb | JavaScript | shuheng-liu/leetcode-js | /p0096-unique-binary-search-trees.js | UTF-8 | 478 | 3.78125 | 4 | [] | no_license | /**
* @param {number} n
* @return {number}
*/
const numTrees = function(n) {
if (n === 0 || n === 1) return 1;
const dp = new Array(n + 1).fill(0);
dp[0] = 1;
dp[1] = 1;
for (let i = 2; i <= n; i ++) {
for (let j = 0; j < i; j ++) {
dp[i] += dp[j] * dp[i - 1 - j];
}
}
return dp[n];
};
... | true |
366fed7aae5624c7f809fad7bcac748e3c4c8d0a | JavaScript | eeedubs/lighthouse-refactor | /loopy-lighthouse-refactor.js | UTF-8 | 528 | 3.03125 | 3 | [] | no_license | function loopyLighthouse(range, multiples, words){
var firstWord = words[0];
var secondWord = words[1];
for (var x = range[0]; x < range[1] + 1; x++){
if (x % multiples[0] === 0 && x % multiples[1] === 0){
console.log(firstWord + secondWord);
}
else if (x % multiples[0] === 0){
console.log... | true |
a8061d2033dd4188d3784532f0307c447f69675e | JavaScript | KatePang13/leetcode-pang | /0538.把二叉搜索树转换为累加树/0538-把二叉搜索树转换为累加树.js | UTF-8 | 492 | 3.34375 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @return {TreeNode}
*/
var convertBST = function(root) {
let accumulator = 0;
var dfs = (root) => {
if(root == null) {
... | true |
3d87c36c5d32b66506a8a63d728ae93a12aead6c | JavaScript | Stef-Lev/SHA_Lessons_JavaScript2 | /Week2/Homework/js-exercises/oddOnesOut.js | UTF-8 | 183 | 3.34375 | 3 | [
"CC-BY-4.0"
] | permissive | "use strict"
const myNumbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let doubleEvenNumbers = myNumbers.filter(item => item % 2 === 0).map(item => item * 2);
console.log(doubleEvenNumbers); | true |
f9df00414380d6db7fe152289ae2ed5f18880211 | JavaScript | Vinu8421293169/to-do-list-redux | /src/redux/reducer.jsx | UTF-8 | 950 | 2.875 | 3 | [] | no_license | import { ADD_TODO, CHANGE_TITLE, DELETE_TODO, ON_COMPLETED, SET_description } from "./actionTypes";
const initialState=JSON.parse(localStorage.getItem("state")) || [];
let count = 0;
function reducer(state = initialState, action) {
switch (action.type) {
case ADD_TODO:
return [...state, {
id: ++c... | true |
bef2fcfc3872911da7b77feb173229a9817ca455 | JavaScript | carlos-palalo/2_DAW | /DWEC/TemarioDWEC/Tema1/teoria/ejemploBucleInfinito.js | UTF-8 | 102 | 2.9375 | 3 | [] | no_license | var i =1;
while(i<=10){
//i++
if(i==5)
continue;
console.log(i);
i++;
} | true |
9820dc4b74a59420c41ff2da92402f487a3495c9 | JavaScript | ThomasLee94/southpark-api | /src/api/episodes/episode.controllers.js | UTF-8 | 507 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const { Episode } = require('./episode.model');
// RETURNS ALL EPISODES FOR ANY GIVEN SEASON
async function GetEpisodesBySeason(req, res) {
const episodes = await Episode.find({ seasonNumber: parseInt(req.params.season) });
res.json(episodes);
}
// RETURNS A SPECIFIC EPISODE
// USER WILL NEED TO PROVIDE EPISODE I... | true |
efc1f144427b0b728ca1423df5c868da69f07e5b | JavaScript | timiscoding/project_2 | /app/assets/javascripts/views/EditUserDetailsPageView.js | UTF-8 | 2,064 | 2.546875 | 3 | [] | no_license | var app = app || {};
app.EditUserDetailsPageView = Backbone.View.extend({
el: '#main',
events: {
'click .editButton' : 'saveEdit'
},
render: function () {
var EditUserDetailsPageViewTemplate = _.template($('#EditUserDetailsPageViewTemplate').html());
this.$el.html(EditUserDetailsPageViewTemp... | true |
1a9ffded23d0707397c5fca271e5f668e3e2e7a3 | JavaScript | nouwatinjacob/project-A | /public/js/d-form.js | UTF-8 | 285 | 2.703125 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
$(".add-more").click(function(){
var html = $(".copy").html();
$(".after-add-more").after(html);
});
$("body").on("click",".remove",function(){
$(this).parents(".control-group").remove();
});
}); | true |
55a3375e9849ffeed9446cfd80defb7042f06ec9 | JavaScript | af/openra_chart | /js/tooltip.js | UTF-8 | 1,738 | 2.6875 | 3 | [] | no_license | var d3 = require('d3');
var RA = require('./ra');
// Tiny templating helper
function t(str, ctx) {
for(var name in ctx) str = str.replace(new RegExp('{'+name+'}', 'g'), ctx[name] || '');
return str;
}
var template = '<h2>{name}</h2>' +
'<div class="description">{description}</div>' +
... | true |
7e7f5f543f832aa7de49b4d5318361d9a1dacdd6 | JavaScript | cuijie324/nodejs-crypto-learn | /src/cipher/des-ecb.js | UTF-8 | 674 | 2.671875 | 3 | [] | no_license | const crypto = require('crypto');
const fs = require('fs');
let test = {
alg: 'des-ecb',
key: Buffer.alloc(8).fill('desdes'),
iv: null,
plaintext: Buffer.alloc(24)
}
let cipher = crypto.createCipheriv(test.alg, test.key, test.iv);
let encrypted = cipher.update(test.plaintext, 'utf8');
encrypted = Buff... | true |
565dc6984b7417bc70da0a30d34df2d05741cb3c | JavaScript | JPTouron/ReactCourseAssignments | /assignment-1/src/features/Expenses/components/NewExpense/ExpenseForm.js | UTF-8 | 3,480 | 2.953125 | 3 | [] | no_license | import React, { useState } from "react";
// import './ExpenseForm.css';
// function formatDate(date) {
// var d = new Date(date),
// month = "" + (d.getMonth() + 1),
// day = "" + d.getDate(),
// year = d.getFullYear();
// if (month.length < 2) month = "0" + month;
// if (day.length < 2) day = "0" ... | true |
88e7814132476cf5f1309aa76f2522dd70966c53 | JavaScript | frangonzalezr/MarvelApp | /src/redux/characters/reducer.js | UTF-8 | 879 | 2.640625 | 3 | [] | no_license | import * as types from './types'
export const initialState = {
loading: false,
page: 0,
total: 0,
list: [],
character: null,
comic: null
}
const reducer = (state = initialState, action = {}) => {
switch (action.type) {
case types.SET_LOADING:
return {
...state,
loading: action.... | true |
46a8454a7a95cf19c554442b19a656628ec8d85b | JavaScript | marticoma99/DisChoices | /main.js | UTF-8 | 1,755 | 2.71875 | 3 | [] | no_license | var buttonClickAudio = getAudio('./sounds/button.wav');
var backgroundAudio = getAudio('./sounds/background.mp3');
backgroundAudio.loop = true;
// ------------ basically a screen changer -----------------------
// from intro to game
var intro7Next = document.querySelector("#nextButton7");
var introStartGame = documen... | true |
fdb45ff23ed9c90db5b589b9d4d36b7edfc317cb | JavaScript | claytonhalllewis/claytonhalllewis.github.io | /shepard/drawField.js | UTF-8 | 1,227 | 3.28125 | 3 | [] | no_license | var SIDE=400; //side of canvas
var SCALE=1/50; //scale for screen coords
//functions that follow are used in visualization of capE
function xC(x) //convert x coord to screen coord
{
return x*SCALE+SIDE/2;
}
function yC(y) //convert y coord to screen coord
{
return -1*SCALE*y+SIDE/2;
}
function drawVatP(v,p) //draw a... | true |
e0cb8b29d37b3fda5a5dbef7a250fe30105b9e45 | JavaScript | dg203087/redux-initial-dispatch-onl01-seng-pt-100619 | /js/reducer.js | UTF-8 | 731 | 3.8125 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | let state //1. We declare but do not assign state - UNDEFINED
function changeState(state = {count: 0}, action){ //4. default argument changes state to 0
switch (action.type) {
case 'INCREASE_COUNT':
return {count: state.count + 1}
default: //5. default executes because type is @@INIT
re... | true |
560b33d65c478b586e3a4de9e92f7da846ee4aa4 | JavaScript | jrocca82/guess-the-word | /js/script.js | UTF-8 | 5,337 | 4.15625 | 4 | [] | no_license | const guessedLetters = document.querySelector(".guessed-letters");
const guessLetterButton = document.querySelector(".guess");
const userInput = document.querySelector("input");
const wordInProgress = document.querySelector(".word-in-progress");
const guessesLeft = document.querySelector(".remaining");
const numGuesses... | true |
e91ac751d6e802b1380032dab53bf931d8e13cd8 | JavaScript | ayadotdev/post-api | /src/App.js | UTF-8 | 1,803 | 3.375 | 3 | [] | no_license | /* eslint-disable */
import { useEffect, useState } from "react";
import "./App.css";
import Post from "./components/Post";
/**
* TODO: Create a newsfeed with posts.
* Use https://jsonplaceholder.typicode.com/
* Each post should be searchable
* Each post has comments, that are loaded on request
* Each post has li... | true |
9a614711a3d71f1b2b050da44a8d8102e288d52a | JavaScript | fugehappy/galleryByReact | /src/components/Main-bak.js | UTF-8 | 2,027 | 2.515625 | 3 | [
"MIT"
] | permissive | require('normalize.css/normalize.css');
require('styles/App.css');
import React from 'react';
import ImgFigure from './imgFigure.js';
//let yeomanImage = require('../images/yeoman.png');
/*业务所需要的数据*/
let imageDatas = [{
filename:'1.jpg',
title:'Heaven of time',
desc:'Here he comes Here comes Speed Racer.'
},{
... | true |
cd86472146c091c25a90ac84bf2a24036b1f5f02 | JavaScript | okunishinishi/node-filemode | /lib/_set_mode.js | UTF-8 | 680 | 2.765625 | 3 | [
"MIT"
] | permissive | /**
* @function _setMode
* @private
*/
'use strict'
const fs = require('fs')
const statAsync = (filename) => new Promise((resolve, reject) =>
fs.stat(filename, (err, state) => err ? reject(err) : resolve(state))
)
/** @lends _setMode */
async function _setMode(filename, mode) {
let from, to
const fromState... | true |
e981ce686a5c344e234712d3d1c5bbc203d2603f | JavaScript | aerisweather/express-custom-router | /lib/util/composeControllers.js | UTF-8 | 534 | 2.546875 | 3 | [] | no_license | function composeControllers(controllers) {
return (req, res, finalNext) => {
const reqControllers = controllers.slice(0); // clone
function nextController() {
const ctlr = reqControllers.shift();
if (!ctlr) {
return finalNext();
}
try {
ctlr(req, res, (err) => {
... | true |
dbf9d60c69ff9083fd6408a12dfbb44a0606b7fd | JavaScript | kui/storage-form | /src/area-handler.js | UTF-8 | 2,714 | 2.65625 | 3 | [
"MIT"
] | permissive | /* global chrome */
import * as utils from "./utils";
const handlers = {};
export function registerHandler(area, handler) {
if (handlers[area]) {
throw Error(`Already registered handler for "${area}"`);
}
handlers[area] = handler;
}
export function findHandler(area) {
return handlers[area];
}
export fu... | true |
74e98b53b08bfafcbe4782d4b6ce9c78f8095bc5 | JavaScript | Blargian/ModernJavaScriptBootcamp | /oop/person.js | UTF-8 | 1,529 | 3.765625 | 4 | [] | no_license | class Person {
constructor(firstname, lastname, age,likes){
this.firstName = firstname
this.lastName = lastname
this.age = age
this.likes = likes
}
getBio() {
let bio = `${this.firstName} is ${this.age}`
this.likes.forEach((like)=>{
bio += ` ${thi... | true |
e79b696441b8fa9ff49f5234acc169085f7ccfbc | JavaScript | Prem4u/webpackBasic | /src/index.js | UTF-8 | 1,391 | 2.8125 | 3 | [] | no_license | import _ from 'lodash';
import './css/style.css';
import Icon from './img/webpack-tuts.jpg';
import Data from './data/data.xml';
function component() {
let div1 = createANode('div');
let div2 = createANode('div');
let div3 = createANode('div');
div1.className='main';
div2.className= 'img-class';
div3.className=... | true |
15506f21a9d1c44ac51b03dc34b8dfa5abccd155 | JavaScript | nutcup74/startProj | /tennis.spec.js | UTF-8 | 463 | 3.125 | 3 | [] | no_license | function TennisGame() {
/*this.temp = () => {
let temp
return temp++
}*/
this.reset = () => {
return 'LOVE-LOVE'
}
this.eco = () => {
return this.reset()
}
}
test('Echo "LOVE-LOVE" ', () => {
let app = new TennisGame
app.reset()
let result = app.eco()
expect(result).toBe('LOVE-L... | true |
ac6f15e0f0e8d14252459be054135023ba17e92f | JavaScript | lshapz/putting-it-all-together-lab-web-0916 | /src/components/user_blackjack.js | UTF-8 | 580 | 2.578125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | import React, { Component } from 'react'
export default function UserBlackjack(props) {
var cards = props.userCards.map( card => {
return <li>{card.name}</li>
})
return(
<div>
<form onSubmit={props.hitMe}>
<button type="submit" id="hit"> Hit Me </button>
... | true |
93f1c5453324a2301fc068bd58894fbc2ee8c63a | JavaScript | PhaZ90771/Space-Shooter | /js/fix.js | UTF-8 | 1,398 | 2.859375 | 3 | [
"MIT"
] | permissive | document.onscroll = function(e) {
if (e && e.preventDefault) {
e.preventDefault();
}
return false;
}
/////////////////////////////////////////
// Canceling drag and selection events //
/////////////////////////////////////////
/*var canvasElement = document.getElementById('gameWindow');
// d... | true |
e3de5de0af7ea67259470967d298bf13253fa27e | JavaScript | kavitasagade/jsassignment | /Day4 Assignment/ass3.js | UTF-8 | 265 | 2.78125 | 3 | [] | no_license | shoppingList =["Apple", "Banana", "Pineapple"];
shoppingList.push("Mango");
console.log("shoppingList :" ,shoppingList);
shoppingBasket = [
"Sugar",
"Rasmalai",
];
shoppingBasket.push("Gulab jamun");
console.log("shoppingBasket :",shoppingBasket); | true |
624d51b8c539f6e9ff83850fd2bd70d9657b7a5c | JavaScript | Omfalos/recruitment-app | /src/components/Weather/index.js | UTF-8 | 2,675 | 2.546875 | 3 | [] | no_license | import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import Grid from "@material-ui/core/Grid";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import groupBy from "lodash/groupBy";
import moment from "moment";
import WeatherPrevi... | true |
d78442545f647bb52c6ccb3c3b83ba1ca3f01ce8 | JavaScript | PerwiPerwi/OwnProjects | /bitBucket/Zajecia SDA/Programowanie srednio-zaawansowane/rok_przestepny/js/script.js | UTF-8 | 412 | 2.9375 | 3 | [] | no_license | (function($) {
function isLeapYear(year) {
if( !(year%4) && year%100 || !(year%400) ) {
console.log('rok jest przestępny');
} else {
console.log('rok nie jest przestępny');
}
}
isLeapYear(... | true |
7db1fcf03347a8e34738834144829c2787ec0529 | JavaScript | teyotan/daskenseru | /modules/preprocesser/stemmer/lib/prefix/lib/derivation-prefix-rules/rule7.js | UTF-8 | 392 | 2.90625 | 3 | [] | no_license | //rule 7 : terCerV -> ter-CerV where C!=‘r’
const rule = /^ter([bcdfghjklmnpqstvwxyz])er([aiueo].*)$/
const ruleMatch7 = function(word){
return word.match(rule) ? true : false
}
const ruleCut7 = function(word){
let temp = Object.assign({}, word)
temp.word = temp.word.slice(3)
temp.removedPrefix = 'ter'
retu... | true |
5bde88752f5d641eebbede896a5f896add0d3ca5 | JavaScript | tiger2877/friendfinder | /app/data/friends.js | UTF-8 | 1,256 | 2.84375 | 3 | [] | no_license | /* ---------------------------------------------
DATA
Below data will hold all of the friends
Initiallized with "dummy" friend
--------------------------------------------- */
var friends = [
{
name: "Jerry Seinfeld",
photo: "https://raw.githubusercontent.com/tiger2877/friendfinder/master/seinfeld.jpg",... | true |
906842f621692669348385c6782b456b7821999e | JavaScript | joshuaaron/udemy-webpack | /Project/Notes-1.js | UTF-8 | 18,629 | 3.4375 | 3 | [] | no_license | /***************************************************
// -----------------------------------------
// WEBPACK UDEMY COURSE
Why use a build tool?
Server Side Templating - Legacy style of creating web apps, and showing HTML docs to users.
Back end server creates an HTML document and sends it to the user
This is a fully r... | true |
f7aff2da9d0141754a782c3f45fc8693760134c9 | JavaScript | adedomin/advent-of-code-2017 | /day-7/circus.js | UTF-8 | 947 | 2.625 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
'use strict'
const fs = require('fs')
var root = { __ROOT: {} }
function createNode(name, weight, children) {
if (!root[name])
root[name] = {}
if (!root[name].parent) {
root[name].parent = '__ROOT'
root.__ROOT[name] = true
}
root[name].weight = weight
... | true |
ea7055ed7d326d42d43d5ddbdf83ad10f14363fd | JavaScript | koskos1986/1489259-keksobooking-21 | /js/filter.js | UTF-8 | 2,080 | 3 | 3 | [] | no_license | 'use strict';
(() => {
const LOW_PRICE = 10000;
const HIGH_PRICE = 50000;
const ANY_VALUE = `any`;
const priceRange = {
ANY: `any`,
LOW: `low`,
MIDDLE: `middle`,
HIGH: `high`
};
const filters = document.querySelector(`.map__filters`);
const filterType = filters.querySelector(`#housing-t... | true |
6b8d6afe0812c001bfabf7ae6f5a4ff72a623159 | JavaScript | Geeker1/ecomtest | /static/js/contact.js | UTF-8 | 569 | 2.578125 | 3 | [
"MIT"
] | permissive | $(function () {
var saveForm = function () {
var form = $(this);
$.ajax({
url: form.attr("action"),
data: form.serialize(),
type: form.attr("method"),
dataType: 'json',
success: function (data) {
if (data.form_is_valid) {
aler... | true |
80a6966330c550469769bd35d9b0be8ae6bfbe1c | JavaScript | CodeByAlex/storybook | /addons/actions/src/lib/util/canConfigureName.js | UTF-8 | 370 | 2.640625 | 3 | [
"MIT"
] | permissive | // IE11 may return an undefined descriptor, but it supports Function#name
const func = function unnamed() {};
const nameDescriptor = Object.getOwnPropertyDescriptor(func, 'name');
// This condition is true in modern browsers that implement Function#name properly
const canConfigureName = !nameDescriptor || nameDescripto... | true |