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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c83088247cc28191c5ba9645e6ed1472b49ca028 | JavaScript | calebadrian/swapi | /swapi-service.js | UTF-8 | 2,005 | 2.734375 | 3 | [] | no_license | function SwapiService() {
var next = ''
var prev = ''
this.getData = function getData(cb, str) {
if (typeof cb != 'function') {
return console.log(cb, 'is not a cb')
}
$.get('https://swapi.co/api/' + str)
.then(function (res) {
prev = res.pre... | true |
ffbb8b38caa646cc6c1d5c998915710ec184bd6b | JavaScript | oderzhanie/1084415-what-to-watch-5--WIP | /src/mocks/films.js | UTF-8 | 2,555 | 2.703125 | 3 | [] | no_license | import {getRandomInteger, getRandomElem, getRandomName, getBoolean, generateId, getRandomDescription} from "../utils/utils.js";
import {TEXT, GENRES, TITLES, POSTERS, FILMS_START_YEAR, FILMS_END_YEAR, ELEMENTS_MIN, ELEMENTS_MAX, START_MONTH, END_MONTH, START_DATE, END_DATE, START_MINUTES, END_MINUTES, RATING_MIN, RATIN... | true |
6bb7848fc1d7917bbcf8ec83c03968886869f8c3 | JavaScript | nejood/udacity_front_end_ND | /project_4(evaluate-news-nlp)/src/server/index.js | UTF-8 | 1,353 | 2.578125 | 3 | [] | no_license |
const path = require('path')
const express = require('express')
const mockAPIResponse = require('./mockAPI.js')
const fetch = require("node-fetch");
const dotenv = require('dotenv');
dotenv.config();
const app = express()
/* Dependencies */
const bodyParser = require('body-parser')
app.use(bodyParser.urlencoded({ e... | true |
b49201e8ea5b7926ea98d4e47abadc86b7c869e5 | JavaScript | YBFACC/MyLeetCode | /JS/208-实现-trie-前缀树-medium.js | UTF-8 | 5,607 | 3.703125 | 4 | [] | no_license | /*
* @lc app=leetcode.cn id=208 lang=javascript
*
* [208] 实现 Trie (前缀树)
*/
// @lc code=start
//参考--前缀树多实现
var TrieNode = function () {
this.next = {}
this.isEnd = false
}
/**
* Initialize your data structure here.
*/
var Trie = function () {
this.root = new TrieNode()
}
/**
* Inserts a word into the tr... | true |
0b1bc5b4af10c5013a1b3ef9a3462a58b03c20b4 | JavaScript | iprskalo/react_node | /3-Contacts/public/js/app.js | UTF-8 | 13,436 | 2.625 | 3 | [] | no_license | class ContactsDashboard extends React.Component {
state = {
contacts: [],
};
handleEditFormSubmit = (attrs) => {
this.updateContact(attrs);
};
handleCreateFormSubmit = (contact) => {
this.createContact(contact);
};
handleTrashClick = (contactId) => {
this.d... | true |
ffe93be206b3e1ed4f2a68f131b9e8503a4dc754 | JavaScript | pacoyass/e-store | /src/component/product/Addnew.jsx | UTF-8 | 2,456 | 2.609375 | 3 | [] | no_license | import React, { useContext, useState } from 'react';
import { Context } from '../../Contextapi/Datacenter';
import { storage } from '../../firebase/Config';
export default function Addnew(props) {
const [newproduct, setnewproduct] = useState([]);
const [Url,setUrl]=useState("")
const { getData } = useContext(Con... | true |
d32565470ffe9120f80b9dc9d5688f0004997eda | JavaScript | rymX/React-recipe-app | /src/App.js | UTF-8 | 1,470 | 2.546875 | 3 | [] | no_license | import React , {useEffect,useState} from 'react';
import Recipe from './recipe'
import './App.css';
const App = ()=>
{
const APP_ID='7781727e';
const APP_KEY='0479edd4de6de7cab4f29478bbe5d5c4';
const [recipes, setRecipes]= useState([]);
const [search, setSearch]= useState('');
const [query , setQuery]= useS... | true |
1b99e3eeba79147fff6a8685e459ab629533f400 | JavaScript | wmyers/ga-fewd-files | /week4_working_files/scroll_animated_header/page.js | UTF-8 | 774 | 3.1875 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | //see https://developer.mozilla.org/en/docs/Web/API/Element/classList
//see https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector
//see https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll
function init() {
window.addEventListener('scroll', function(e){
var distanceY... | true |
6f422bcf7d1c3d5e47c395e0990b10bfa71207e2 | JavaScript | kekee000/node-bloomfilter | /lib/RedisBitSet.js | UTF-8 | 2,028 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* @file redis 的bitset封装
* @author mengke01(kekee000@gmail.com)
*/
class RedisBitSet {
constructor(bitSize, redisProvider, key = 'bloomfilter') {
if (bitSize < 8 || bitSize > 1024 * 1024 * 512 * 8) {
throw new Error('bitSize not validate, 8 <= bitSize <= 512m');
}
if (!re... | true |
b2a2c35eb8f09493474ee58e619fe9fa43be20d7 | JavaScript | DhruvDh/ItForSociety2018 | /analysis/results.js | UTF-8 | 323 | 2.890625 | 3 | [] | no_license | var fs = require('fs');
var path = require('path')
var results = JSON.parse(fs.readFileSync(path.join(__dirname, 'Results.json')), 'utf8');
var acc = 0, opt;
results.forEach(result => {
if (result.acc > acc) {
acc = result.acc
opt = result.opti;
}
})
console.log("Accuracy: " + acc + " \\ " + o... | true |
7298b7ddee55105533bd9d67d7fc6a1c42132f8b | JavaScript | taufikbudianto/upload2 | /src/main/webapp/resources/js/map/earth/marker/GAsset.js | UTF-8 | 2,625 | 2.71875 | 3 | [] | no_license | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
var ASSET = new Hash();
function setNewGAsset(){
ASSET = new Hash();
}
//createGAsset(new GLatLng(5.555833333333333,95.32027777777778),'JKT-1111-2075','Pesud NOMAD P-832,P-841,P-842','0','0','0','0','BAIK','20 OR... | true |
4bc168eba985e9f239b02232a0eb9869e186abb7 | JavaScript | mua22/pakaims-web-design-and-development | /Lecture 6 1-1-2021/Dynamic Binding Clean/bindings.js | UTF-8 | 1,031 | 3.40625 | 3 | [] | no_license | console.log("Js Code Started");
function bindings() {
console.log("I AM doing bindings");
var btnTest = document.getElementById("btnTest");
btnTest.onclick = handleClick;
var btnCelebrate = document.getElementById("btnCelebrate");
btnCelebrate.onclick = handleCelebration;
// console.log(btnTest);
}
// bindi... | true |
9d972e57b043bae167bb10b87d6eee9133fa53bd | JavaScript | sasankgaming/monkey-go-happy | /sketch.js | UTF-8 | 1,833 | 3.0625 | 3 | [] | no_license | var monkey_running,bananaImage,stoneImage,backImage;
var monkey,banana,stone,scene,foodGroup,obstaclesGroup;
var score;
function preload(){
monkey_running=loadAnimation("monkey_01.png","monkey_03.png","monkey_05.png");
bananaImage=loadImage("banana.png");
stoneImage=loadImage("stone.png","stone-1.png");
backImage... | true |
03981455d3315573637c9633f2bfd4882ec69072 | JavaScript | Alec983/javascript | /queue.js | UTF-8 | 424 | 3.53125 | 4 | [] | no_license | function queue() {
var items = []
this.count = 0;
this.push = function (item) {
items.push(item)
this.count++;
}
this.pop = function () {
if (this.count > 0) {
items.unshift()
this.count--
}
}
this.print = function () {... | true |
08c4367df324fe6aad4a6d48549be515999f7ab0 | JavaScript | faraamcode/cbt_with_live_video_supervision | /js/exam.js | UTF-8 | 1,610 | 3.1875 | 3 | [] | no_license | let index = 1;
const question_n = document.querySelector("#question_no");
const question_number= parseInt(question_n.value);
console.log(question_number);
const questions = document.querySelectorAll(".question-id");
const question_no = document.querySelector(".btn-container");
const prevBtn = document.querySelector("... | true |
ab5d009db1bb0f08e379dcba900d62476dbf4cb1 | JavaScript | darren-behan/monash-bootcamp-coursework | /10-OOP/01-Activities/06-Stu_RPG-Prototypes/index.js | UTF-8 | 670 | 3.640625 | 4 | [] | no_license | const rolePlayingGame = function(name, profession, age, strength, HitPoints) {
this.name = name;
this.profession = profession;
this.age = age;
this.strength = strength;
this.HitPoints = HitPoints;
function PrintStats() {
console.log(this.name, this.profession, this.age, this.strength, this.HitPoints);
... | true |
dab88ab05a8f23bb9718b0d89136ae28984dd266 | JavaScript | eyedea-io/glorious-demo | /src/scripts/components/website-application/website-application.js | UTF-8 | 2,850 | 2.828125 | 3 | [
"MIT"
] | permissive | import '@styles/website-application.styl';
import textService from '../../services/text/text';
import { Application } from '../application/application';
import { WebsiteCommandLine } from '../website-command-line/website-command-line';
import { WebsiteResponseLine } from '../website-response-line/website-response-line'... | true |
e8efbad093c055e41fc295de1d703bcee834e13d | JavaScript | andrewsjkang/react-boilerplate | /app/containers/TodoList/reducer.js | UTF-8 | 537 | 2.53125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import { fromJS } from 'immutable';
import { LOAD_TODOS, LOAD_TODOS_SUCCESS } from './constants';
export const todoListInitialState = fromJS({
loading: false,
todos: [],
});
function todoListReducer(state = todoListInitialState, action) {
switch (action.type) {
case LOAD_TODOS:
return state.set('loadi... | true |
cab46f6f116a33b9e2ed70908a0a040813696e6a | JavaScript | ChristopherLlewellyn/tarkov-gunsmith | /server/app/Services/AttachmentUpdaterService.js | UTF-8 | 8,082 | 2.78125 | 3 | [
"MIT"
] | permissive | 'use strict'
const Database = use('Database')
const Attachment = use('App/Models/Attachment')
const TarkovDatabaseService = use('App/Services/TarkovDatabaseService')
const TarkovLensService = use('App/Services/TarkovLensService')
// This service updates the 'attachments' database table by fetching data from Tarkov-Da... | true |
606c9e83a1a0fa75cc63928c2d4f13cc440878b4 | JavaScript | wen-HeBo/CommunityManagementSystem-BC-2020 | /js/admin_main.js | UTF-8 | 1,703 | 2.859375 | 3 | [
"MIT"
] | permissive | // 文件装载完成后,调用initPage函数
window.onload = initPage;
function initPage() {
$(".leftmain a").click(function(){
var titleAttr = $(this).attr("title");
if(titleAttr=="user_admin"){
$(".maincontent").load("user_admin.html");
}
else if(titleAttr=="food_admin"){
$(".maincontent").load("food_admin.html");
}
... | true |
2d6edf2ece3eb5584ebbfff1fca727e156b13769 | JavaScript | kctripathy/react-app-quiz | /src/reducers/classSubject.js | UTF-8 | 1,098 | 2.671875 | 3 | [] | no_license |
export const initialState = {
classSubjects: [],
loading: true,
error: '',
success: ''
};
const classSubjectReducer = (state, action) => {
//debugger;
switch (action.type) {
case 'fetchingApi':
return (
{
...state,
c... | true |
eabd58c539d3e31aca4e7848247b8cd07c66ec75 | JavaScript | marquesdanilocarlos/mini-aplicacao-js | /client/js/app/DAO/NegociacaoDAO.js | UTF-8 | 2,379 | 2.71875 | 3 | [] | no_license | import Negociacao from "../models/Negociacao.js";
export default class NegociacaoDAO {
constructor(connection) {
this._connection = connection;
this._store = "negociacoes";
}
add(negociacao) {
return new Promise((resolve, reject) => {
let addRequest = this._connection
... | true |
71eab163287d38b1fc83999f2ff95d1c4f8a38ab | JavaScript | kogai/tori | /controllers/search.js | UTF-8 | 1,607 | 2.71875 | 3 | [] | no_license | function normalizePost(post) {
return `
${post.name} \`${post.created_by.name}\`\n\
${post.url}\n
`;
}
export function search(bot, msg, tori) {
bot.reply(msg, '記事を探しています...');
tori.api.posts({
q: msg.text,
}, (err, res)=> {
if (err) {
console.log(err);
return bot.reply(msg, err.m... | true |
3ef4a13eb789e918573994759e2c84f4bea8f936 | JavaScript | Yuri-Predborskiy/js-fiddles-for-leetcode | /problems/009. Palindrome Number/string-palindrome.js | UTF-8 | 935 | 4.46875 | 4 | [] | no_license | /*
Write a function to check if number is palindrome
Convert to string and read one digit at a time from both ends, if they are different - return false
If no differences found - return true
Time complexity: O(n) where n - number of digits in the number
Space complexity: O(n)
*/
/**
* @param {number} x
* @return {... | true |
1f563fbf9b0ca8f585c80a1c19cac75f8eac91e1 | JavaScript | mayalexandera/algo-practice | /capitalize/index.js | UTF-8 | 1,111 | 4.78125 | 5 | [] | no_license | // --- Directions
// Write a function that accepts a string. The function should
// capitalize the first letter of each word in the string then
// return the capitalized string.
// --- Examples
// capitalize('a short sentence') --> 'A Short Sentence'
// capitalize('a lazy fox') --> 'A Lazy Fox'
// capitalize('lo... | true |
b5d566432d586ade28183945a6fc31ce4b12ab85 | JavaScript | amitdumka/eStore_Ver_6 | /eStoreWebUI/ClientApp/src/app/modules/Payrolls/_redux/salaryPayments/Slice.js | UTF-8 | 3,267 | 2.53125 | 3 | [] | no_license | import {createSlice} from "@reduxjs/toolkit";
//SalaryPayment
//salaryPayment
const initialSalaryPaymentsState = {
listLoading: false,
actionsLoading: false,
totalCount: 0,
entities: null,
salaryPaymentForEdit: undefined,
lastError: null,
employeeEntities: null,
totalCountEmp:0
};
export const cal... | true |
93ce6fd625ba2c9ee5ae73c6fbe0f5d9e4ab9999 | JavaScript | n0tybynature/rickandmorty | /src/components/CharacterList.js | UTF-8 | 776 | 2.609375 | 3 | [] | no_license | import React, {useState, useEffect} from "react"
import axios from "axios"
import Character from "./Character"
export default function CharacterList (props){
const [info, setInfo] = useState([]);
const {link} = props;
useEffect(() => {
axios.get(`${link}`)
.then( (res) ... | true |
b7abf7703c6f02b1498677a8b3997b127357a748 | JavaScript | adam-singer/dart-js | /rpc/async.js | UTF-8 | 1,689 | 3.046875 | 3 | [] | no_license | async = (function() {
function Future() {
this.listeners = [];
}
Future.prototype.onComplete = function(callback) {
this.listeners.push(callback);
};
function Completer(future) {
this.future = (future == null) ? new Future() : future;
this.complete = this.complete.bind(this); // Make it pass... | true |
421bb67883e735f99a87860edaccf0f34adc4719 | JavaScript | CodeAcademy2019/Gurrehmat | /promises/importantRule.js | UTF-8 | 649 | 3.234375 | 3 | [] | no_license | const outputArray = [];
const alwaysThrows = () => {
throw new Error('OH NOES');
}
const iterate = (val) => {
outputArray.push(val);
console.log(val);
return val+1;
}
const onReject = (error) =>{
outputArray.push(error.message);
console.log(error.message);
return error.message;
}
const p... | true |
77e40f59abb72e5a91ea0d5f490d9f04ef2c63a3 | JavaScript | kant/react-css-themes | /test/src/utils.js | UTF-8 | 2,223 | 2.84375 | 3 | [
"ISC"
] | permissive | import expect from 'must'
import {
withDefaults,
mergeWithStrings
} from '../../src/utils'
describe('mergeWithStrings', () => {
it('returns `src` when `dest` is undefined', () => {
const dest = undefined
const src = {}
const result = mergeWithStrings(dest, src)
expect(result).to.be.equal(src)
... | true |
78d66dfc29ab2ea3fdfca8e3e8430bb5d5b79997 | JavaScript | Wscats/node-tutorial | /middlewareAgent/browserAgent/http/http.js | UTF-8 | 1,449 | 2.75 | 3 | [] | no_license | const http = require('http');
const url = require('url');
let httpMitmProxy = new http.Server();
// 启动端口
let port = 6789;
httpMitmProxy.listen(port, () => {
console.log(`HTTP中间人代理启动成功,端口:${port}`);
});
// 代理接收客户端的转发请求
httpMitmProxy.on('request', (req, res) => {
// 解析客户端请求
var urlObject = url.parse(req.url);... | true |
83bc77dbebedd5901efbf4c72d399c7b44ce1127 | JavaScript | diogo405/charles | /app/js/info-panel.js | UTF-8 | 2,536 | 2.90625 | 3 | [
"MIT"
] | permissive | var CharEngine = require('./char-engine.js');
var self;
function InfoPanel() {
self = this;
this.NUMBER_OF_LIFES = 4;
this.infoPanel = $('.infoPanel');
this.lifeBar = $('.infoPanel-life');
this.score = $('.infoPanel-score');
this.scorePoints = 0;
this.level = $('.infoPanelLevel-text');
this.pointsEarned ... | true |
d947a0117c43f6c8d277354d45b1fac717126e1d | JavaScript | ThoquenneMargaux/SiteHerv- | /assets/js/app.js | UTF-8 | 291 | 2.765625 | 3 | [] | no_license | var dropdown = document.getElementById("dropdown");
var container = document.getElementById("dropdownContainer");
container.addEventListener("mouseenter",()=>{
dropdown.style.display = "flex";
});
dropdown.addEventListener("mouseleave",()=>{
dropdown.style.display = "none";
}); | true |
6ebc28cbfbfe03ce47023a69b17f7fa9fde73f0c | JavaScript | BaronBeans/AdventOfCode2018 | /2/part1.js | UTF-8 | 780 | 3.46875 | 3 | [] | no_license | const data = require('./input');
var globalTwo = [];
var globalThree = [];
data.forEach(item => {
var list = [];
var twocount = [];
var threecount = [];
item.split('').forEach(x => {
var count = (item.split(x).length - 1);
if (count > 1) {
if (list.includes(x) == false) {
... | true |
feafd419c3f7f48b876692f1741a545b91f47f52 | JavaScript | Gnu-Sauvage/miaou | /plugins/graph/client-scripts/graph-renderer.js | UTF-8 | 12,199 | 2.640625 | 3 | [
"MIT"
] | permissive | // renders tables as bar graphs in messages containing #graph
// Right now, this isn't terribly generic. I'll make it more capable
// if the need arises
miaou(function(fmt, fish, md, plugins){
var colors = [
'#e9967a', '#9cd3d3', '#e91e63', '#795548', '#8bc34a', '#00bcd4',
'#ffc107', '#4e5050', '#317334', '#7126... | true |
5b394933b59c70f8aff28110cec42160004b06f3 | JavaScript | ZakharovMaxim/admin-panel | /src/app/js/components/Table.js | UTF-8 | 6,394 | 2.703125 | 3 | [] | no_license | export default class Table {
constructor(el) {
this.table = el;
this.rows = Array.prototype.slice.call(this.table.querySelectorAll('.tbody .tr'));
this.order = '';
this.headers = this.table.querySelectorAll('.thead .th');
this.headers.forEach(th => {
th.addEventListener('click', (e) => this.... | true |
2f719fb5027a1cae497d5c5d70e5dfee9b645253 | JavaScript | nguyenthanhtung11298/QLUsers | /app/services/Validation.js | UTF-8 | 4,290 | 2.828125 | 3 | [] | no_license | function Validation(){
//Phương thức
//Kiểm tra ô nhập liệu có bị trống hay k
this.checkEmpty = function(inputVal,spanID,message){
// .trim(): Xóa khoảng trắng ở trước và sau chuỗi
if(inputVal.trim()==""){
//không hợp lệ
document.getElementById(spanID).innerHTML = mes... | true |
901fab257e19b6ed2004ea5bc4648f8e6191e3bf | JavaScript | peterapps/peterapps.github.io | /minisites/games/shuttle/main.js | UTF-8 | 1,595 | 3.40625 | 3 | [] | no_license | // Important constants
var g = 9.80665; // meters per second squared or Newtons per kilogram
var G = 6.67408e-11; // N * m^2 / kg^2
var M = 5.9723e24; // kilograms
var rE = 6.378e6; // meters
// Details about our shuttle (Shuttle Atlantis)
var m = 122683; // kilograms
var y = 0; // meters
var v = 0; // meters per seco... | true |
a512ac9cb05157d41073a31107d93e686bb0035e | JavaScript | Melina-w/weather-react-netlify-template | /src/Weather.js | UTF-8 | 4,570 | 2.8125 | 3 | [] | no_license | import React, { useState } from "react";
import "./Weather.css";
import WeatherInfo from "./WeatherInfo";
import axios from "axios";
import DailyForecastData from "./DailyForecastData";
let apiKey = "49e74429d3a2f98000aa1a8e998c37eb";
let days = ["Sun", "Mon", "Tues", "Wed", "Thurs", "Fri", "Sat"];
export default fu... | true |
35f156c44b29d80e7754219ca1492598e1d608ac | JavaScript | mandulaj/wake-cli | /test/dataGetter-test.js | UTF-8 | 24,769 | 2.59375 | 3 | [
"MIT"
] | permissive | var expect = require("expect.js");
var config = require("../config.json"); // the real config
var utils = require("./utils.js");
var basePath = __dirname;
// TODO: add more tests!
describe("Helper Functions", function() {
// set up the local testing config
var conf = utils.clone(config);
conf.wakefile = "./... | true |
77e8b89d11368aaa6d2b539cff7f2afea2f4a3fd | JavaScript | vk93/gilded-rose-javascript | /src/normalitem.js | UTF-8 | 264 | 2.578125 | 3 | [] | no_license | 'use strict'
class NormalItem extends Item
{
update_quality()
{
if (this.sell_in < 0) {
(this.quality -2 >= 0) ? this.quality -= 2 : this.quality = 0
}
else {
(this.quality -1>= 0) ? this.quality -= 1: this.quality = 0
}
this.sell_in -=1
}
}
| true |
3d401e1453a3d9a67804698331e39212dd3d52c2 | JavaScript | timofurrer/hslu-cg-webgl | /part2/Exercise1.js | UTF-8 | 4,108 | 3.234375 | 3 | [
"MIT"
] | permissive | //
// Computer Graphics
//
// WebGL Exercises
//
// Register function to call after document has loaded
window.onload = startup;
// the gl object is saved globally
var gl;
// we keep all local parameters for the program in a single object
var ctx = {
shaderProgram: -1, //wird unten wieder überschrieben
aVert... | true |
713bb13312dfdd83a51eef53c97946a004c70e56 | JavaScript | paramore2k/AEC_Front_End | /Programmation1/Examen1/Q2.js | UTF-8 | 903 | 4.125 | 4 | [] | no_license | /* Question 2
Faire le code qui permet de lire au clavier la valeur de la variable âge et afficher tranche d'âge en fonction de l'âge. Pour faire ce choix, utiliser la table suivante :
tranche à afficher age
enfant 0 <= age <= 12
adolescent 13 <= age ... | true |
0f3ad3c8f1658dc8636962006ce920d0a1600c1d | JavaScript | bendrendel/mobile-tabs | /script.js | UTF-8 | 482 | 3.078125 | 3 | [] | no_license | const images = document.querySelectorAll('img');
const tabs = document.querySelectorAll('nav li');
tabs.forEach((tab, index) => {
tab.addEventListener('click', () => {
clearTabs();
tab.classList.add('active');
clearImages();
images[index].classList.add('show');
})
});
function... | true |
6e9da54c46aee21e066a3109e097d783ec6eacc0 | JavaScript | krystianopryszek99/TypeScript_Lab1 | /functions.js | UTF-8 | 746 | 3.96875 | 4 | [] | no_license | //Ex 5 - (a) and (b)
function wordCount(word) {
var count = word.replace(/\s/g, "").length;
return count;
}
var myCount = wordCount("test 1");
console.log(myCount);
// 5(c)
function str_len_both(value, spaces) {
var num;
if (spaces) {
num = value.replace(/\s+/, "").length;
}
else {
... | true |
d73744d4e37c79cd264cd6c678147f013deb8864 | JavaScript | aabhinavjs/searchgithub | /src/store/reducers/App.js | UTF-8 | 1,056 | 2.515625 | 3 | [] | no_license | import {
FETCH_START,
FETCH_END,
FETCH_ERROR,
SET_SEARCHED_USER_DATA,
SET_USER_REPO_DATA
} from "../../constants/ActionTypes";
let initState = {
isFetchingData: false,
serachedUserData:{},
userRepoData:[]
};
const app = (state = initState, action) => {
switch (action.type) {
case FETCH_START:
... | true |
f890b63ea07ec721e0681199dc20c4c3690be803 | JavaScript | ksm0207/increpasWebProgramming | /0914/js/jquery6.js | UTF-8 | 293 | 2.890625 | 3 | [] | no_license | $(function(){
$("#btn").click(function(){
console.log("Click");
let list = "";
$("li").each(function(){
list+= $(this).text()+"<br>";
console.log(`${$(this).text()}`);
})
$( "#box" ).html(list);
});
});
| true |
2cfc207cefbd6b6b7cc3d1c08322df3e9134407f | JavaScript | patriziosbr/balance | /script.js | UTF-8 | 2,009 | 2.875 | 3 | [] | no_license | var app = new Vue({
el: "#root",
data: {
valueOne: 500,
valueTwo: 500,
maxValueOne: 1000,
maxValueTwo: 1000,
wave: "",
waveArr: [],
valueArr: [],
maxIndexWave: ""
},
methods:{
//balance scale on drag
movingPlateOne() {
this.valueTwo = this.maxValueTwo - this.valueO... | true |
969aff82823b75c2c9de0534029a8552784ff5d6 | JavaScript | IT-xzy/Task | /Web/zhuyao/JS-2/js/gameover.js | UTF-8 | 506 | 3.21875 | 3 | [] | no_license | var result = document.getElementById("result");
var killer = document.getElementById("killer");
var civilian = document.getElementById("civilian");
var people = JSON.parse(sessionStorage.getItem("people"));
var killerNum = 0, civilianNum = 0;
for(var i = 0; i < people.length; i++){
if(people[i].id === "杀 手"... | true |
0b908663e5b0ad24f091fa21e54b68dcac47f754 | JavaScript | khteh/Node.JSRestAPI | /BusinessLogic/fibonacci.js | UTF-8 | 1,247 | 2.984375 | 3 | [] | no_license | import express from 'express'
import url from 'url'
function Fibonacci(req, res, next) {
var url_parts = url.parse(req.url, true);
var query = url_parts.query;
var message = "";
console.log('GET /api/fibonacci query: ' + JSON.stringify(query));
if (query.n !== undefined && query.n.length > 0 && !isN... | true |
3ef154bbe01f4ffd103a0c99270ab473683e7fbf | JavaScript | TTumyr/Canvaz | /src/art/ekta2901-3/script.js | UTF-8 | 1,157 | 3.5625 | 4 | [
"MIT"
] | permissive | var canvas = document.getElementById("my-canvas")
var ctx = canvas.getContext("2d");
var circleBtn = document.getElementById("circle-btn");
var rectangleBtn = document.getElementById("rectangle-btn");
var squareBtn = document.getElementById("square-btn");
var colorInput = document.getElementById('color');
var color = ... | true |
69b53680a42c3f0961529b4983ddcedc54b786c4 | JavaScript | nivb52/NodeJs-Concepts | /04-more-streams/05a-stream-advance.js | UTF-8 | 1,032 | 3.109375 | 3 | [] | no_license | // we can think on STREAMS as Water and Buckets
// it is also the way most of the option and action called :
// like 'drained' for stop pressure and 'highWaterMark' for bytes limit
const { createWriteStream, createReadStream } = require("fs");
const readStream = createReadStream("./assets/surfing_waves.mp4");
const wr... | true |
1f7d72583d6a143974166d56608a27d59af98b66 | JavaScript | nzukoff/gray_area | /node/code_node3/sensor_threejs/app.js | UTF-8 | 777 | 2.53125 | 3 | [] | no_license | var com = require("serialport");
//import express
var express = require('express');
//create express object named app
var app = express();
//instantiate a server on port 3000
var server = app.listen(3000);
var io = require('socket.io')(server);
var serialPort = new com.SerialPort("/dev/tty.usbmodem3013421", {
ba... | true |
9cb8083db0095dea9611fd8c721f4a0c4268abe0 | JavaScript | wycka0214/16-grupe-js-intro | /js/div-count.js | UTF-8 | 634 | 3.4375 | 3 | [] | no_license | "use strict";
const from = 0;
const until = 11;
const divider = 7;
let count = 0;
// logic
for ( let i=from; i<=until; i++ ) {
if ( i % divider === 0 ) {
count++;
}
}
console.log( `Skaičių intervale tarp ${from} ir ${until}, besidalijančių be liekanos iš ${divider} yra ${count} vienetai.` );
const... | true |
d9a581c48742bf3184f1692ab5f92a755468cc41 | JavaScript | idkjs/ppx-install-test | /src/FooBindBar.bs.js | UTF-8 | 3,649 | 2.65625 | 3 | [] | no_license | // Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
var Curry = require("rescript/lib/js/curry.js");
console.log("Hello, ReScript!");
function $$return(x) {
return x;
}
function bind(x, f) {
return Curry._1(f, x);
}
function map(x, f) {
return Curry._1(f, x);
}
function both(x, y) {
return [
... | true |
3bd96d4f77ebd699a8bef08e1c976f6f8632d6c2 | JavaScript | kacoulib/boltInfluence | /server/models/Article.js | UTF-8 | 2,591 | 2.578125 | 3 | [] | no_license | const mongoose = require('mongoose');
const generateSlug = require('../utils/slugify');
const { Schema } = mongoose;
const { ObjectId } = Schema.Types;
const mongoSchema = new Schema({
title: {
type: String,
required: true,
},
picture: {
type: String,
},
slug: {
type: String,
required: ... | true |
ee64ca8215789f95fcba2c16ff487afe7850f21b | JavaScript | rajapragadeshpandian/Tab-Plug-in | /js/plugin.js | UTF-8 | 14,647 | 2.6875 | 3 | [] | no_license | var show = (function (){
var i;
var rptabs = document.getElementsByClassName('rp-tabs');
var len = rptabs.length;
console.log(rptabs.length);
console.log(rptabs);
console.log("hi bud");
/* var options =
{
vertical:"vertical",
horizontal:"horizontal",
addtab... | true |
319ba3df02255ebf7e897d001373faeb78a2ac38 | JavaScript | sanjanamarce/CodingChoreography | /Distance/sketch.js | UTF-8 | 4,385 | 3.078125 | 3 | [] | no_license | /**
* Maps distance between left hand, head, and right hand with a
* colored circle of oscillating size centered at the base of the
* spine (pelvis). The color of the circle becomes more red the closer
* the left hand gets to the head and more blue the closer the right
* hand gets to the head.
Mimi Yin NYU-... | true |
277f1a4f7fa2fa0a2c2e730ab705d036034b587e | JavaScript | BP2014W1/JodaEngine | /engine-web-gui-prototype/src/main/webapp/javascripts/resources/participants.js | UTF-8 | 2,600 | 2.59375 | 3 | [] | no_license | $().ready(function() {
//
// refresh the participants table
//
loadOverviewTable();
//
// register the refresh overview handler
//
$('#participants-overview-refresh').click(function(event) {
event.preventDefault();
loadOverviewTable();
});
//
// re... | true |
6c512bb4a5043464806055f0d10ce8ae67d9f4cb | JavaScript | darrenjsmith/pillowmodulus | /client/views/home.js | UTF-8 | 653 | 2.59375 | 3 | [] | no_license | Template.home.helpers({
randomUrl: function() {
var tipCollection = [];
var currentId = this._id;
var i = 0;
// for each item in Tips, apart from current tip, put the url in tipCollection
Tips.find().forEach(function (tip) {
if (tip._id != currentId) {
tipCollection.push(tip... | true |
24425bda9879945da83895d54c2d79647cd803ac | JavaScript | evejweinberg/programming-design-systems-projects | /WEEK4_color/Color_01/color.js | UTF-8 | 1,938 | 3.203125 | 3 | [] | no_license | /*//////////////
http://printingcode.runemadsen.com/examples/color/scheme_complementary.html
*/ //////////////////
var r = new Rune({
container: "#canvas",
width: 600,
height: 800
});
// ////////////////////////
// var black = 0;
// var white = 255;
// var h = 10;
// var s = 100;
// var v = 100;
// var a... | true |
cb5591d7045e29a0e25c0b21e87a1e14df785589 | JavaScript | m84013885/h5-easy | /app/utils/sig.js | UTF-8 | 1,111 | 2.8125 | 3 | [] | no_license | import md5 from 'md5'
/*
对象排序拼接成字符串
*/
function sigSortObj (obj) {
if (!obj) { return '' }
const arr = []
let sigString = ''
for (const key in obj) { arr.push(key) }
arr.sort()
for (let i = arr.length - 1; i >= 0; i--) {
const key = arr[i]
let tail = '&'
if (i === 0) { tail = '' }
sigStrin... | true |
ae5f74cce46bc980af1e690df3cc18bfff4cfd34 | JavaScript | shakerSarwar/jquery-practice | /Part-1/main.js | UTF-8 | 5,072 | 3.15625 | 3 | [] | no_license | document.write("helloooooo")
$(document).ready(function() {
$("div").click(function() {
console.log("Div is Clicked")
});
});
/*
$(document).ready(function() {
$("id,class,tag etc").click(function() {
});
});
/*First Element
$(document).ready(function() {
$("id or class:first").click(f... | true |
0755bb78afa20c70090e037ab2a6663654bf4886 | JavaScript | illfixit/js-algorithms-and-data-structures | /02 Big O Notation.js | UTF-8 | 7,699 | 4.375 | 4 | [] | no_license | /* TIMING OUR CODE */
(() => {
// function addUpTo(n) {
// let total = 0;
// for (let i = 1; i <= n; i++) {
// total += i;
// }
// return total;
// }
// console.log(addUpTo(3)); // 6
// console.log(addUpTo(100)); // 5050
})();
(() => {
// function addU... | true |
be19523d887e9fac3324b025de2c24f17d3eca7d | JavaScript | manjeshbhargav/Puzzles | /BitManipulation/bitSwap.js | UTF-8 | 439 | 3.34375 | 3 | [] | no_license | /**
* Created by malavallim on 5/19/16.
*/
const bitSwap = (num, i, j) => {
var bi = (num >> i) & 1;
var bj = (num >> j) & 1;
if (bi === bj) {
return num;
}
return num ^ (1 << i | 1 << j);
};
const main = () => {
var num = parseInt(process.argv[2], 10);
var i = parseInt(process.argv[3], 10);
v... | true |
afb3640ff10115e9ac664c61286461134f38e234 | JavaScript | hmdroh/TraveJournal | /assets/javascript/app.js | UTF-8 | 10,297 | 2.671875 | 3 | [] | no_license |
// Initialize Firebase
var config = {
apiKey: "AIzaSyC9W6aHLQG_E1_OtEpNonHfIlun9l5-ikw",
authDomain: "mytraveljournal-c5500.firebaseapp.com",
databaseURL: "https://mytraveljournal-c5500.firebaseio.com",
projectId: "mytraveljournal-c5500",
storageBucket: "",
messagingSenderId: "670018236818"... | true |
9f39b851c718e6a8dbb39a7a59e241be52efe8ed | JavaScript | YuraMalahov/algorithms | /src/quizzes/flat-2d-array.js | UTF-8 | 667 | 3.515625 | 4 | [] | no_license | "use strict";
class D2Array {
constructor(type, y, x) {
this._y = y;
this._x = x;
this._array = new type(y * x);
}
getItem(y, x) {
return this._array[y * this._x + x];
}
setItem(y, x, number) {
this._array[y * this._x + x] = number;
}
}... | true |
ca4414daa992546e9a603a02f6ad2857af827808 | JavaScript | shannahutch/tester | /js/main.js | UTF-8 | 1,723 | 2.875 | 3 | [] | no_license | // main.js
// "use strict";
//check to see if doc is loaded
$(document).ready(function(){
var contacts = [];
var counter = 0;
var addContact = function(newContact){
var contactString = ["<li id='", newContact.id, "' class='contact'>",
"<div>", newContact.name, "</div>",
... | true |
99814d3549b392753cebf49d9f84d94e71414a16 | JavaScript | Thihasoehlaing/Rockstar4 | /API/index.js | UTF-8 | 1,504 | 2.53125 | 3 | [] | no_license | var express = require('express');
var app = express();
var cors = require('cors');
var mongojs = require('mongojs');
var db = mongojs('todo', ['tasks']);
var BodyParser = require('body-parser');
app.use(cors());
app.use(BodyParser.urlencoded({extended: false}));
app.use(BodyParser.json());
app.get('/task... | true |
3f00c88781771b59ff407ccf7f4a24d2f6c91b4b | JavaScript | Iliakra/Socket-frontend | /src/js/ChatWidget.mjs | UTF-8 | 5,770 | 2.9375 | 3 | [] | no_license | /* eslint-disable no-console */
import formatDate from './formatDate.mjs';
export default class ChatWidget {
constructor(url, nickForm) {
this.url = url;
this.nickForm = nickForm;
this.userID = null;
this.userName = null;
this.container = null;
this.element = null;
this.userEls = [];
... | true |
07633c6a5c922dbcb90e7b1d998175e6e290ecb6 | JavaScript | speedtreammanga/UBIke | /src/js/components/SignUpModal.js | UTF-8 | 5,106 | 2.828125 | 3 | [] | no_license | /* @flow */
import $ from 'jquery';
import Modal from '../models/Modal';
import MembersService from '../service/Members.service';
import Member from '../models/Member';
import Alert from './Alert';
/**
* SignUpModal component.
*/
class SignUpModal extends Modal {
formIsInvalid: boolean = false;
errorMessage:... | true |
82990d170c7c01bf942e82ef543537807b256ec3 | JavaScript | itsg2jakhmola/ReactRedux | /src/reducers/ProductReducer.js | UTF-8 | 1,314 | 2.65625 | 3 | [] | no_license | const initialState = {
products: [{id: 1, name:'prod'}]
}
const ProductReducer = (state = initialState, action) => {
switch(action.type){
case 'ADD_PRODUCT' :
return {
products: state.products.concat([action.products])
}
case 'DELETE_PRODUCT':
... | true |
b58c6652ac3819fc39166251be9f17dc7f36838a | JavaScript | abdulhannanali/todo-react | /src/components/TodoForm.js | UTF-8 | 1,062 | 2.734375 | 3 | [
"MIT"
] | permissive | var React = require("react")
class TodoForm extends React.Component {
constructor(props) {
super(props)
// binding this to methods
this.textChange = this.textChange.bind(this)
}
state = {
description: ""
};
textChange (el) {
this.setState({
description: e... | true |
7c4ac679173042a46de2cf555dcfbea5a6c6ab91 | JavaScript | vyanev1/apis-and-microservices-projects | /exercise-tracker/routes/api.js | UTF-8 | 2,815 | 2.59375 | 3 | [] | no_license | const Users = require('../models/users');
const Exercises = require('../models/exercises');
const router = require('express').Router();
// POST Requests
router.post('/new-user', (req, res, next) => {
if (req.body.username) {
const user = new Users({ username: req.body.username });
user.save((err, createdUs... | true |
65982361a9f1805b50dea884f41cb28bec2447e7 | JavaScript | adecrown/Work-Live | /js/controls.js | UTF-8 | 3,670 | 2.71875 | 3 | [] | no_license |
function __(id)
{
return document.getElementById(id);
}
var canvas = new fabric.Canvas('c', {
isDrawingMode: true,
//backgroundColor: 'white',
// selectionColor: 'blue',
// selectionLineWidth: 5
});
canvas;
/// ////////////////////////////////////////////////////
///
/// CONTROLS ... | true |
ea6ea7f11a15f61365f0942ab474915b7beb1c34 | JavaScript | chenhongdong/play | /2020开始/不能错/深拷贝/深拷贝4.js | UTF-8 | 486 | 3.453125 | 3 | [] | no_license | let o = {a: 1, obj: {num: 2}, arr: [1,2]};
o.o = o;
function deepClone(obj, map = new Map()) {
if (typeof obj === 'object') {
if (map.has(obj)) {
return map.get(obj);
}
let data = Array.isArray(obj) ? [] : {};
map.set(obj, data);
for (let k in obj) {
... | true |
f6b814838c1c19ac54c7c434655c7c755000f503 | JavaScript | owl990/secondReact2020M04 | /src/App.js | UTF-8 | 3,171 | 2.734375 | 3 | [] | no_license | import React, { useState } from 'react';
import './App.css';
function PostControlPanel(props) {
return (
<div>
<button onClick={props.addPost}>Add Post</button>
<button onClick={props.removePost}>Remove Post</button>
</div>
);
}
function AddPostPanel(props) {
const objTitle = React.crea... | true |
3a2d61d9f8a68834154e2d901f87014487684ae5 | JavaScript | Anthonymoe/mr-blue-sky | /src/components/MoodPage/MoodPage.jsx | UTF-8 | 2,110 | 2.671875 | 3 | [] | no_license | import {useState} from 'react';
import {useHistory} from 'react-router-dom';
import {useDispatch, useSelector} from 'react-redux';
import Swal from 'sweetalert2';
import './MoodPage.css'
const moment = require("moment");
function MoodPage() {
//renaming functions to make easier to call
const history = useHist... | true |
ed482e1ec01c5788b0277c138dbdeaa48cf8b42e | JavaScript | Tanmay53/cohort_3 | /submissions/sm_033_surya/week_03/day_5/session_1/findAverageMarks2.js | UTF-8 | 464 | 3.625 | 4 | [] | no_license | var student = {
name:'name',
marks: [50,30,100,80],
average: function(){
var sum = 0
var avg = 0
for ( i = 0 ; i < this.marks.length ; i++)
{
var sum = sum + this.marks[i];
}
var avg = sum / this.marks.length
console.log("The average of ma... | true |
c9f5d337beca84bdc289e74fa3cb88ff354e092d | JavaScript | jaywhang83/pizzaPlace | /js/scripts.js | UTF-8 | 3,253 | 3.171875 | 3 | [
"MIT"
] | permissive | function Pizza (pizzaSize, selectedToppings) {
this.pizzaSize = pizzaSize;
this.selectedToppings = selectedToppings;
};
Pizza.prototype.priceOfPizza = function() {
var priceOfPizza = 0;
this.selectedToppings.forEach(function (topping) {
if (topping === "mushroom" || topping === "onion") {
priceOfPizz... | true |
4b06f63a608190eed59ac0877605e897b8371bc3 | JavaScript | MirinaeMiREU/DoLiA | /graph.js | UTF-8 | 4,545 | 2.921875 | 3 | [
"MIT"
] | permissive | function Graph(game, mound) {
this.xSize = 360;
this.ySize = 175;
this.ctx = game.ctx;
this.mound = mound;
this.antData = [];
this.larvaData = [];
this.foodData = [];
// this.antData.push(mound.antCount);
// this.larvaData.push(mound.larvaCount);
// this.foodData.push(Math.floor(mound.foodStorage/EAT_AMOUNT));
... | true |
506279f1ec5102024e27b4249cd072d8cff91858 | JavaScript | ipansubastian/ninpo | /res/js/Canvas.js | UTF-8 | 323 | 2.546875 | 3 | [] | no_license | class Canvas {
constructor()
{
this.canvas = document.querySelector('canvas');
}
setCanvasSize()
{
this.canvas.width = window.innerWidth - (window.innerWidth / 100 * 15)
this.canvas.height = window.innerHeight - (window.innerHeight / 100 * 5 )
}
}
// export default Canv... | true |
305bedc54e25af962ab9d7b8fc89c84f6075ce97 | JavaScript | CharlotteBones/Codewars | /Javascript/8-Kyu/Quarter-of-the-year.js | UTF-8 | 219 | 3.890625 | 4 | [] | no_license | // Quarter of the year
const quarterOf = (month) => {
return Math.ceil(month / 3);
};
// Tests
console.log(quarterOf(3)); // --> 1
console.log(quarterOf(8)); // --> 3
console.log(quarterOf(11)); // --> 4
| true |
2f12fd9a486f8e47220cdd3d57ce3b2da10bad4a | JavaScript | inab/Scientific_Barplot | /src/table.js | UTF-8 | 2,100 | 2.9375 | 3 | [
"MIT"
] | permissive | import * as JQuery from "jquery";
const $ = JQuery.default;
export function transform_classif_to_table(
divid,
data,
quantile_1,
quantile_2,
quantile_3
) {
// split participants according to quartiles
for (var i = 0; i < data.length; i++) {
var participant = data[i];
if (participant.metric_value... | true |
26700564a5a4a35d91457d7c06ea2484a19b1bfd | JavaScript | ahmadaburezeq1998/busmall | /app.js | UTF-8 | 7,242 | 3.078125 | 3 | [
"MIT"
] | permissive |
let limg=document.getElementById("leftimg");
let mimg=document.getElementById("midimg")
let rimg=document.getElementById("rightimg");
console.log(limg);
let limgindex;
let mimgindex;
let rimgindex;
let maxattempts=10;
let userattempts=0;
let namesarray=[];
let votesarr=[];
let shownarr=[];
function Product(name,s... | true |
ed1a74a8f8438e0b2194f1071e484309229e1cea | JavaScript | jameslin3263/dissertation | /src/js/temp.js | UTF-8 | 22,180 | 2.75 | 3 | [] | no_license | function formater(domEle, prop, color) {
if (prop == border) {
count++
sessionStorage.setItem('count', count)
if (play == true) {
$(domEle)[0].style.borderColor = color
}
} else if (prop == bgc) {
count++
sessionStorage.setItem('count', ... | true |
c7f92db86961cfa8a0fcae41c33ad12bf8f0e5d5 | JavaScript | im30337/dessert-shop | /js/product.js | UTF-8 | 2,930 | 2.75 | 3 | [] | no_license | $(function () {
var productsRef = db.collection("dessert-products");
var cart;
if (localStorage.getItem("sweetasteCart") == undefined) {
cart = {};
} else {
cart = JSON.parse(localStorage.getItem("sweetasteCart"));
//cartItemCount(cart);
}
cartItemCount(cart);
//繪製產品資... | true |
02abf3c42ae209d44eb783d2072b48863edfcd55 | JavaScript | jpmbvistro/codewars | /katas/kyu6/3-23-2021-0.js | UTF-8 | 537 | 3.15625 | 3 | [] | no_license | /*******************************************************
=======================Codewars=========================
Perimeter of squares in a rectangle
https://www.codewars.com/kata/559a28007caad2ac4e000083
********************************************************/
function perimeter(n) {
let lastSide = 0
let currentS... | true |
c05c1f1627a787879ff628523f1222dde5c9117a | JavaScript | GeorgAllemann/nba-predictor | /main.js | UTF-8 | 4,224 | 2.5625 | 3 | [] | no_license | import fs, { stat } from 'fs'
import Papa from 'papaparse'
import nba from 'nba'
import brain, { likely } from 'brain.js'
const east = []
const west = []
async function main () {
/*
try {
const test = await nba.stats.teamSplits({ TeamID: 1610612739, PaceAdjust: 'Y', Rank: 'Y' })
console.log(test)
} cat... | true |
d4bcd43f82e28540cc16f98369c3892f4d7a5a29 | JavaScript | 12345Emilia/MillionaireQuiz | /src/App.js | UTF-8 | 9,273 | 2.703125 | 3 | [] | no_license | import './App.css';
import { useEffect, useMemo, useState } from 'react';
import Timer from './components/Timer';
import Trivia from './components/Trivia';
import Start from './components/Start';
function App() {
const [username, setUsername] = useState(null);
const [questionNumber, setQuestionNumber] = useState(1... | true |
95968e35fd1b40e5988fabc8f07bc6cd06e9ad34 | JavaScript | lachrist/candlekeep | /test.js | UTF-8 | 591 | 2.578125 | 3 | [
"MIT"
] | permissive |
var fs = require("fs");
function assert (test, message) {
if (!test)
throw "Assertion error: "+message;
}
function test (dirname) {
if (fs.lstatSync(dirname).isDirectory()) {
var names = fs.readdirSync(dirname);
for (var i=0; i<names.length; i++)
if (names[i].endsWith(".js")) {
var path... | true |
825d492b7c6865f024c6e3a40be124108c681263 | JavaScript | jckw/Little-Modern-Man | /js/usability.js | UTF-8 | 6,646 | 2.703125 | 3 | [
"MIT"
] | permissive | /*global $:false, jQuery:false, window:false */
$(window).load(function () {
$(window).resize(function() {
drawConnections();
});
// Usability: improving how the user codes with the site
drawConnections();
test();
$("#input textarea").keydown(function (e) {
if (e.keyCode == 189 && ($("#input textar... | true |
e540a086b607a1f0a5b01dff5a9a666bffd6c3e1 | JavaScript | samriddhac/loctrack | /subscriberapp/src/js/reducers/loc-reducer.js | UTF-8 | 290 | 2.625 | 3 | [] | no_license | import {ACTION_TYPE_LOC_UPDATE} from '../actions/action-types';
const INITIAL_STATE = {}
export default function(state=INITIAL_STATE, action) {
switch(action.type) {
case ACTION_TYPE_LOC_UPDATE: {
return { ...state, location:action.payload}
}
default: {
return state;
}
}
} | true |
d6f0ddd10cc92f80fbc66bceab06ef25986bb32d | JavaScript | piratar/grasrotarinn | /assets/js/src/task-filter/components/FilterList.js | UTF-8 | 1,940 | 2.53125 | 3 | [] | no_license | // import dependencies
import React, { Component } from 'react';
import PropTypes from 'prop-types';
// import modules
import FilterCategory from './FilterCategory';
class FilterList extends Component {
/**
* constructor method
*
* @since 1.0.0
* @param {Object} props
*/
constructor( ... | true |
a1321abc719a1618d3ce0a3688fb8268e5624524 | JavaScript | Alyssonprr7/covid-tracker | /src/App.js | UTF-8 | 1,963 | 2.5625 | 3 | [] | no_license | import React from 'react';
//Consigo fazer o código abaixo por causa do arquivo index.js
//Que se encontra no Components
import {Cards, Chart, CountryPicker} from './Components'
import styles from './App.module.css'
import {fetchData} from './API'
import {Typography} from '@material-ui/core'
import coronaImage from '... | true |
e5aefd22246acbf913d94a6541e1013daa86aafc | JavaScript | jschfflr/cashtrack | /lib/formatters.js | UTF-8 | 534 | 2.6875 | 3 | [] | no_license | function formatJSON(req, res, body) {
if (body instanceof Error) {
// snoop for RestError or HttpError, but don't rely on
// instanceof
res.statusCode = body.statusCode || body.status || 500;
} else if (Buffer.isBuffer(body)) {
body = body.... | true |
b638cdd7076330d5c6a7cd9dfb370533f4c43186 | JavaScript | kerighan/ritual | /ritual/static/js/blueprint.js | UTF-8 | 32,983 | 2.640625 | 3 | [
"MIT"
] | permissive | // blueprint DOM
var blueprint = document.getElementById("blueprint");
var blueprintInfo = document.getElementById("blueprint-info");
var svg = d3.select(blueprint);
var contentGroup = svg.append("g");
var nodeGroup = contentGroup.append("g").attr("id", "nodes");
var lines = contentGroup.append("g").attr("id", "lines")... | true |
7eb92f0b6c80bfe9d96f6102d4c593825594cdc5 | JavaScript | celesterobinson/assignments | /exercises/if-statement-olympics/prelim.js | UTF-8 | 242 | 4.15625 | 4 | [] | no_license | if (5 > 3) {
console.log("is greater than");
}
var cat = "cat";
if (cat.length === 3) {
console.log("is the length")
}
var dog = "dog";
if (cat === dog) {
console.log("are the same");
} else {
console.log("not the same");
} | true |
7b6430db1b57fb006b52c837b194dbd0c7c5ecf3 | JavaScript | z0le12/ZoranoviotRepoZitory | /FRONTend/javaScript/Procedural programing/range.js | UTF-8 | 368 | 4.46875 | 4 | [] | no_license | // Write a JavaScript program to get the integers in range (x, y).
// Input the range as parameters (start and finish).
// Print the sum of the numbers as a string.
function range(x, y) {
var result = 0;
for (var i = x; i <= y; i++) {
result = result + i;
}
console.log("The result of the numb... | true |
edf26d0ae7afaae81e85c2b647915591f9174c4a | JavaScript | samueljmillward/cruise-ships | /src/Port.js | UTF-8 | 422 | 2.984375 | 3 | [] | no_license | const Ship = require("../src/Ship.js");
const Itinerary = require("../src/Itinerary.js");
class Port {
constructor(name) {
this.name = name;
this.ships = [];
}
addShip(ship) {
this.ships.push(ship);
}
removeShip(ship) {
if (this.ships.indexOf(ship) === -1) {
throw new Error("That ship i... | true |