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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
cf131c04aaceb2409d66b3f8d2fd6eeea121af7f | JavaScript | Eonsenix/eonsvue | /src/utils/readFile.js | UTF-8 | 481 | 2.796875 | 3 | [] | no_license | /*
1.export default 就获取default
2.直接输出就func(key)
3.export xxx const = {} 就 func(key).xxx
*/
export const readFile = (func) => {
let list = []
func.keys().map(key => { // func.keys() 输出文件名称的数组
let modules = func(key).default || func(key)
// 是数组就遍历 否则直接push
if (modules.length) {
for (let i of ... | true |
88efc23bcc76b65029973a0e0ebde3805b481906 | JavaScript | vin100zz/lvdlom | /app/utils/formatters.js | UTF-8 | 8,877 | 2.578125 | 3 | [] | no_license | app.service('Formatter', function (Bom, Dictionary, $filter, Countries) {
var _this = this;
var removeDuplicates = function (result, item, index) {
if (result.indexOf(item) === -1) {
result.push(item);
}
return result;
};
this.int = function (value) {
return parseInt(value, 10) || 0;... | true |
ea12e03d27195d689fb1efdfb2e4c43af35b725d | JavaScript | RolandSandorNagy/SokoBoy | /js/framework.js | UTF-8 | 11,322 | 2.703125 | 3 | [] | no_license | (function () {
var fw = {};
fw.image = function (src) {
var img = document.createElement('img');
img.src = src;
return img;
};
fw.load = function (images, onLoad, onProgress) {
var loaded = 0;
function checkLoaded() {
if (onProgress) {
... | true |
e2fb8838d7c3cfab94355319c4ed78e3cb7f00cc | JavaScript | KateYachmeneva/ahj-dnd | /src/js/drawCard.js | UTF-8 | 498 | 2.5625 | 3 | [] | no_license | export default class DrawCard {
constructor(container) {
this.container = container;
}
static markup(title, type, id) {
return `<li class="card" data-type = "${type}" data-id = "${id}">
<div class = "card-header">
<h4>${title}</h4>
<button class="card-delete hidden"><span></span... | true |
1ae043f35732aa53bac46cd6812510b0e0241466 | JavaScript | tediyaki/week-3 | /exercise-13.js | UTF-8 | 1,174 | 3.671875 | 4 | [] | no_license | function targetTerdekat(arr) {
// you can only write your code here!
var findX = false;
var findO = false;
var o = 0;
var findingRightX = false;
var leftX = 0 - arr.length;
var rightX = arr.length * 2;
for(var i = 0; i < arr.length && !findingRightX; i++) {
if(arr[i] === 'o') ... | true |
6d078bb63d1fdd34455cc63f347848018c4739f6 | JavaScript | yugandhar-pathi/MyPREstimate | /www/app/utils/lead_util.js | UTF-8 | 2,223 | 2.625 | 3 | [] | no_license | define([],function(){
var lead_util = {
getLeadDetailsForCode : function(leadCode){
/* seigCharges are from SSR
* This is temporary code, This should be converted to database later.
*/
var leadMap = {
"B":{
"material":"Bricks",
"seigCharges":"",
"unit":"tonne"
},... | true |
9b8fc61aed74108d59e3a11da093ef6600f4ee35 | JavaScript | bt3ze/pcflib | /betteryao/webapp/static/js/sharing.js | UTF-8 | 2,543 | 2.6875 | 3 | [
"BSD-2-Clause"
] | permissive | var address1 = "http://127.0.0.1:5000/submit/";
var address2 = "https://www.terner.co";
var words = 4;
//var wordlength = 12;
$(document).ready(function (initfn) {
console.log("hello world!");
console.log(initfn);
sjcl.random.startCollectors();
$('#submitbtn').click(function () {
var secretsha... | true |
8949eb2a514726c04ef3d6ce9063853e2152d9a7 | JavaScript | ankitg/BIGdata | /SemantriaJavaScriptSDK/SerializerTest.js | UTF-8 | 22,018 | 2.640625 | 3 | [] | no_license | SerializerTest = TestCase("SerializerTest");
SerializerTest.prototype.testJsonSerializingConfiguration = function() {
var expectedResult = "{" +
"\"added\":[" +
"{" +
"\"name\":\"A test configuration\"," +
"\"is_primary\":true," +
"\"one_sentence\":true," +
... | true |
44439d1f01155d77fe6bc883bda987f3a3646d77 | JavaScript | jboctor/jboctor.github.io | /wordsearch/search.js | UTF-8 | 5,012 | 2.90625 | 3 | [] | no_license | var wordSearch = {
possibleChars : [
['a', 8.12],
['b', 1.49],
['c', 2.71],
['d', 4.32],
['e', 12.02],
['f', 2.30],
['g', 2.03],
['h', 5.92],
['i', 7.31],
['j', 0.10],
['k', 0.69],
['l', 3.98],
['m', 2.61],
... | true |
ca518c0895e632978c4b5fce8e1d29f9a6cd58bc | JavaScript | Bhupindergne/DSAndAlgo | /LeetCode/findMaxAverage.js | UTF-8 | 405 | 3.546875 | 4 | [] | no_license | const findMaxAverage = (nums, k) => {
let i=0;
let tempSum = 0;
while(i < k){
tempSum += nums[i++];
}
let result = tempSum / k;
for(let i =k; i < nums.length; i++){
tempSum = tempSum + nums[i] - nums[i-k];
result = Math.max((tempSum/k), result);
console.l... | true |
b96579ee6a6985aa4c9e6996749e76329d5f3d10 | JavaScript | Michael-Earley/Coding-for-Kids | /Project 3 - Sound Machine/scripts/april.js | UTF-8 | 729 | 2.953125 | 3 | [] | no_license | // stuff that happens when all the elements on the page are loaded in the browser
$(document).ready(function () {
// audio player and source
var audioPlayer = $("#audioPlayer");
var audioSource = $("#audioSource");
var audioSelection = $("#audioSelection");
// folder where images are located
var folder = "soun... | true |
ad582b1407fc874e2dd60fb41ceb38383d74aa21 | JavaScript | barisvelioglu/iostocky | /tests/salt_hash.js | UTF-8 | 556 | 2.921875 | 3 | [] | no_license | var bcrypt = require('bcrypt');
const saltRounds = 10;
const myPlaintextPassword = 's0/\/\P4$$w0rD';
const someOtherPlaintextPassword = 'not_bacon';
bcrypt.hash(myPlaintextPassword, saltRounds, function(err, hash) {
// Load hash from your password DB.
bcrypt.compare(myPlaintextPassword, hash, function(err, res) {
... | true |
83be1730c463a3686af8a843883f035ac4472d00 | JavaScript | jackowacko83/simcell | /example1/src/Chunk.js | UTF-8 | 505 | 3.171875 | 3 | [
"MIT"
] | permissive | function Chunk (x, y) {
this.x = x;
this.y = y;
}
function getChunk (x, y) {
var chunkX = Math.floor(x / CHUNK_SIZE);
var chunkY = Math.floor(y / CHUNK_SIZE);
return chunks[chunkX + CHUNK_AMOUNT * chunkY];
}
function getChunks (x, y, radius) {
var chunkTop = getChunk(x, y - radius);
var ch... | true |
55f922bcbeaec731f8f80b61437f7c7a341f9a32 | JavaScript | Nick-S7/PTWD-06-2020-Project-1 | /script/stopwatch.js | UTF-8 | 2,710 | 3.234375 | 3 | [] | no_license | const chronometer = new Chronometer();
let score = document.getElementById('targets_clicked');
let targetsParent = document.querySelector('#targets')
let targets = document.querySelectorAll(".target");
let total = score;
// get the DOM elements that will serve us to display the time:
let minDec = document.getElementB... | true |
dbf3f48b1722c4f56ffcee56bdc560ff1d311154 | JavaScript | dvadee/customFramework | /core/form/field/base/form-field-base.js | UTF-8 | 2,866 | 2.515625 | 3 | [] | no_license | import Component from '@/core/component';
import InputLabel from '@/core/input/label/input-label';
const inputTpl = '<input data-ref="input-el"/>';
const renderTpl = `
<div class="form-field form-group">
<div class="form-field__label-ct" data-ref="label-ct">
<label class="form-field__label" data-ref="l... | true |
7993249f454b536056aa6b3c1b001dfcc9c3aaee | JavaScript | craigbuckler/cityscience | /js/main.js | UTF-8 | 4,047 | 2.75 | 3 | [
"MIT"
] | permissive | /*
City Science data visualisation code
By Craig Buckler
*/
var cs = cs || {};
cs.main = (function() {
'use strict';
// dependencies
if (!window.addEventListener) return;
// configuration
var
cfg = {
map: {
init: {
center: { lat: 50.714785, lng: -3.9747587 },
zoom: 9,
... | true |
eb200d800eb883ee5e717f02caa6122523e4ec08 | JavaScript | hectorcorrea/intro-to-coffeescript | /24_class_inheritance.js | UTF-8 | 1,516 | 3.1875 | 3 | [] | no_license | // Generated by CoffeeScript 1.3.1
(function() {
var MeanTaxCalculator, TaxCalculator, calc, total,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.pro... | true |
a07a8b5176a209bd0e5c9fd629f9070da79b59cf | JavaScript | proyzplus/help-document | /js/help_document.js | UTF-8 | 24,414 | 2.875 | 3 | [
"MIT"
] | permissive | var business_data = []//商户后台数据
var agent_data = []//收银机端数据
var pos_data = []//pos机端数据
var h5_data = []//h5端数据
var procedures_data = []//巢品荟端数据
const delay = (function () {
let timer = 0;
return function (callback, ms) {
clearTimeout(timer);
timer = setTimeout(callback, ms);
};
... | true |
8f5b054db870c1627cf54e320a5da0196dd37e87 | JavaScript | Uniterno/AS-Skadi | /src/stats.js | UTF-8 | 8,272 | 2.8125 | 3 | [] | no_license | var json;
let bgmrng = new Uint32Array(1);
window.crypto.getRandomValues(bgmrng);
var bgm = new Audio('bgm/' + bgmrng[0] % 2 + '.mp3');
loadAllProfiles();
function toggleBGM(item){
if(item.checked){
bgm.play();
} else{
bgm.pause();
}
}
function toggleDarkMode(item){
if(item.checked){
document... | true |
ae56f832b0e9d42eec4cd2cdd78e3130d2ab4a5e | JavaScript | dk264874293/Frontend-02-Template | /week17/html-parser/test/parser.test.js | UTF-8 | 564 | 2.5625 | 3 | [] | no_license | var assert = require("assert");
import { parseHTML } from "../src/parser";
describe("parser html:", function () {
it("<a></a>", function () {
let tree = parseHTML('<a></a>')
assert.equal((tree.children[0].tagName,'a'))
assert.equal((tree.children[0].children.length, 0));
});
it('<a href="/... | true |
c382e49f35eedb79b9f2f83b6b2794388db3b0ae | JavaScript | br1code/pixel-aula | /public/js/foro/indexForo.js | UTF-8 | 984 | 3.21875 | 3 | [
"MIT"
] | permissive | (function() {
'use strict';
function haveCoincidences(strA, strB) {
return strA.indexOf(strB) !== -1;
}
function getCleanedString(string) {
string = string.replace(/á/gi, 'a');
string = string.replace(/é/gi, 'e');
string = string.replace(/í/gi, 'i');
str... | true |
68997caa71187ef652166203fba0cd7a9eb64c6e | JavaScript | Space-Seal/Ping-Martians | /src/scene/binarygame.js | UTF-8 | 5,287 | 2.53125 | 3 | [] | no_license | var systemLogText;
var transmitTimeText;
var baseStatText;
var OSText;
function gameA_progress1(whichBtn) {
if(currentGameProgress>=13){
currentGameProgress = currentGameProgress;
}else if(whichBtn==3){
currentGameProgress = 9;
}else if(currentGameProgress>=10){
currentGameProgress = currentGameProgress;
}els... | true |
09f84d4fa81d792d9964c4fb8ec02a6cccb18c0c | JavaScript | victor-wayward/ironode | /modules/contact.js | UTF-8 | 3,033 | 2.515625 | 3 | [
"MIT"
] | permissive |
// --- Contact Controller ---
// validates contact form fields, checks google response, saves text to logs/messages.log
// returns status and a message
// on error returns also the input form
const path = require('path'); // unix/dos path resolver
const appdir = require('app-root-dir').get(); // get app path
co... | true |
b9a436e3a7ab112d4165a4e4c4af0b94cbaf972c | JavaScript | ikon-integration/tika-api | /lib/core/Request.js | UTF-8 | 2,937 | 2.578125 | 3 | [] | no_license | import URLQuery from 'query-string-manipulator'; //so lazy.. TODO: replace me by s
//
const fetch = require("node-fetch");
const JSZip = require("jszip");
//
import TikaDefinitions from '../TikaDefinitions';
import TikaMetadata from './TikaMetadata';
//
export default class APIRequest {
constructor(method) {
this... | true |
8c9c299c614f21f774c72f4722e6ace433c992e9 | JavaScript | gmurambadoro/speedtrack-client | /src/components/OnlineStatus/OnlineStatus.js | UTF-8 | 956 | 2.5625 | 3 | [] | no_license | import React from "react";
import green from "../../assets/images/green.ico";
import red from "../../assets/images/red.png";
export default function OnlineStatus({ lastActivityTime = null }) {
let isOnline = false;
if (lastActivityTime !== null) {
const seconds = (Date.now() - lastActivityTime) / 1000... | true |
9027fc10991cc1aaf21e898b1b48ec6b2fdc7f95 | JavaScript | qatataq/fm | /src/reducers/tracksReducer.js | UTF-8 | 563 | 2.671875 | 3 | [] | no_license | const DEFAULT_STATE = {
list: [],
loading: false,
error: null,
}
const tracksReducer = (state = DEFAULT_STATE, action: Object) => {
switch (action.type) {
case 'REQUEST_TRACKS':
return {
...state,
...DEFAULT_STATE,
loading: true,
}
case 'TRACKS_ERROR':
return {
...state,... | true |
f9b77b79e749aa917cd2a4315b903b91ad5fde7e | JavaScript | vivekbharda/social-Media | /server/controller/post.controller.js | UTF-8 | 1,139 | 2.53125 | 3 | [] | no_license | var postModel = require('../model/post.model');
var userModel = require('../model/user.model');
let postController = {};
postController.addPost = function(req,res){
var userId = req.body.userId;
var post = new postModel(req.body);
console.log('addPost',post);
post.save(function(err,savedpost){
if (err) { res.... | true |
a4c4028fac47144a81fb324d3934fa58afe6138a | JavaScript | jung8027/EdTrack | /client/features/common/GradesMethods.js | UTF-8 | 805 | 3.328125 | 3 | [] | no_license |
// function that calculates the average grade of all students by type
export const getAllAvgs= (studentsGrades, type)=>{
let filteredType = studentsGrades.filter(student=> student.type===type);
let gradeSum= filteredType.reduce((sum,val)=> sum +=val.grade,0);
let typesAvg = gradeSum/filteredType.length;
return pa... | true |
ac9af005d4b307a3ffd6469ea0ab46daf980ac36 | JavaScript | greenfrog82/study | /javascript/promise/src/example_9.js | UTF-8 | 1,105 | 3.28125 | 3 | [] | no_license | const ret = false;
new Promise((resolve, reject) => {
if(ret) {
resolve('success');
} else {
reject('fail');
}
}).then(
(msg) => {
console.log(`1. resolve - ${msg}`);
return msg;
},
(msg) => {
console.log(`1. reject - ${msg}`);
// return msg; // 리턴을 하면 Promise.resolve(msg)와 동일한 동작을... | true |
9745367def5ef0e55ccb494efa042da14d1fdb60 | JavaScript | nolanlawson/cjs-to-es6 | /index.js | UTF-8 | 2,997 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #!/usr/bin/env node
const colors = require('colors/safe')
const os = require('os')
const path = require('path')
const readdirp = require('readdirp')
const spawn = require('child-process-promise').spawn
const yargs = require('yargs')
.options({
v: {
type: 'boolean',
alias: ['verbose'],
describe:... | true |
15797cb54661a3b50f83b2efac25265a8f39ca61 | JavaScript | gaswelder/react-slippy-map | /src/Path.js | UTF-8 | 1,777 | 2.640625 | 3 | [
"MIT"
] | permissive | import React from "react";
import Pin from "./Pin";
import Projection from "./mercator";
import { Context } from "./Context";
function encodePath(points) {
let l = "M " + points[0];
for (let i = 1; i < points.length; i++) {
l += " L " + points[i];
}
return l;
}
function Path(props) {
const { points, col... | true |
b888a7748ae711bf0aafc2e1772d867dfcb1a021 | JavaScript | TheMikeSanto/HTML5-Canvas-Animation-Experiment | /js/animate.js | UTF-8 | 1,133 | 3.21875 | 3 | [] | no_license | ctx = {};
function draw(){
var canvas = document.getElementById('canvas');
ctx = canvas.getContext('2d');
ctx.save();
ctx.clearRect(0,0,800,600);
var numBoxes = $("#boxes").slider("value");
var numColors= $("#colors").slider("value");
var size = $("#size").slider("value");
var rate = $("#rate")... | true |
bcab04ed0b5cb0389a8442b9116a18e8cb86c4eb | JavaScript | lenilunderman/react-basic-tutor | /src/Book.js | UTF-8 | 724 | 2.90625 | 3 | [] | no_license | import React from 'react'
const Book = ({ img, author, title }) => {
//const { img, author, title } = props.book
// children will render everything else on book one, <Book> children in the between </Book>
//events
const clickHandle = () => {
alert('hi world')
}
const getAuthor = (title) => {
cons... | true |
6991892181b6a2c772e9cf52c1de958f9b6f5a64 | JavaScript | nesnahoj/v-school | /exercises/htmlSimple Calculator/htmlSimpleCalculatorScript.js | UTF-8 | 2,184 | 3.515625 | 4 | [] | no_license | /*
add prompt for user input (use placeholder)
add features of opperators
add prompt for 2nd user input(placeholder)
add operation capabilities to each operator feature
allow submit for tallying of user inputs.
*/
//var simpleCalculator = function() {
// var inputElem = document.getElementById("userInput");
// v... | true |
ad10c2ec8093fe752ae4a74936b961f2b33a52a5 | JavaScript | sarahova/BootCampProjects | /16. Leaflet/static/js/logic.js | UTF-8 | 4,549 | 2.625 | 3 | [] | no_license | url='https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson'
//function for earthquake circle colors on map and legend
function getColor(d) {
return d > 5 ? "#F63F1E" :
d > 4 ? "#ED9A31" :
d > 3 ? "#EDBC42" :
d > 2 ? "#F0D74C" :
d > 1 ? "#DCF464" :
d >... | true |
1fb7b12438cd9fbbdf511ab8f0cdb50da1bb12f9 | JavaScript | MichaelRempe/weather_dashboard | /assets/JavaScript/script.js | UTF-8 | 8,986 | 3.125 | 3 | [] | no_license | $(document).ready(function () {
// INPUT FIELD DOM
var inputField = $("#queryInput");
var inputBTN = $("#queryBTN");
// JUMBOTRON VALUES and DISPLAYS
var cityDSP = $("#city");
var timeDSP = $("#time");
var tempDSP = $("#currentTemp");
var humidityDSP = $("#currentHumidity");
var wind... | true |
ff448c61ff8f8100d35564d7e42d65b29dd6d4bc | JavaScript | walterobvio/Blog-Examples | /videoInteraction/script.js | UTF-8 | 992 | 2.734375 | 3 | [] | no_license |
(function($){
//very quick plugin for swapping videos into a variable until you are ready for them
$.fn.videoInteraction = function(){
this.each(function(){
//varibles
var self = $(this),
$image = self.parent().find('.image-over... | true |
cc8b73451ad4de26b3de712c98098dff2ff1a8a7 | JavaScript | kmoosman/js-looping-and-iteration-looping-code-along-v-000 | /index.js | UTF-8 | 373 | 3.15625 | 3 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Code your solutions in this file
function writeCards(names, eventName) {
let thankYouMessages = []
for (let i = 0; i < names.length; i++ ) {
thankYouMessages.push(`Thank you, ${names[i]}, for the wonderful surprise gift!`)
}
return thankYouMessages
}
function countdown(number) {
while (... | true |
d8f9cc5d2af2baedbc8d14482bfe404fb7e27c11 | JavaScript | mapsandapps/champion-trees | /src/store/filters.js | UTF-8 | 3,502 | 2.546875 | 3 | [] | no_license | import cloneDeep from 'lodash/cloneDeep';
import filter from 'lodash/filter';
import includes from 'lodash/includes';
export default {
namespaced: true,
state: {
/**
* when you create a new filter, be sure to update getters.filtering and actions.resetFilters
*/
pointsFilter: null,
searchTerm:... | true |
9b63f57e5334410d2cc2b4e3debd417bbf08638a | JavaScript | gpetepg/CodingNotebook | /data_structures/HeapItem.js | UTF-8 | 3,284 | 3.96875 | 4 | [] | no_license | // This class is similar to heap, but heapifies based on "this.value"
class HeapItem {
constructor(arr, sort) {
const sortASC = (a, b) => a - b;
this.sort = sort || sortASC;
this.store = [];
if (arr) {
arr.forEach(el => this.insert(el));
}
}
insert(item) {
this.store.push(it... | true |
5ad524bc2d364d4fd73d66afe40eab99520c7c4d | JavaScript | jgaspar98/Kooker-app | /src/components/Userprofile.js | UTF-8 | 4,208 | 2.546875 | 3 | [] | no_license | import React from 'react'
import UserRecipes from './UserRecipes';
import Button from 'react-bootstrap/Button';
import { addRecipe, uploadFile } from '../api';
import { toast } from 'react-toastify';
import Modal from 'react-bootstrap/Modal'
function UserProfile({ loggedInUser, history }) {
const nameRef = React.u... | true |
96820fc6f5bc6ef2d5b45e565e863c2f181c1722 | JavaScript | selsamman/amorphic-drpatient-demo | /apps/common/js/baseController.js | UTF-8 | 9,434 | 2.515625 | 3 | [] | no_license | module.exports.baseController = function (objectTemplate)
{
BaseController = objectTemplate.create("BaseController", {
errorCount: {isLocal: true, type: Number, value: 0},
// Validators
isName: function () {this.mustNotMatch("[^0-9A-Za-z \'\-]", "name")},
isText: function () {this.mustNotMatch("[^\\... | true |
9e54aec44ee76a614501750a095721ed05ccdf46 | JavaScript | shivampip/FrontEnd | /JSDemo/Hitesh/WebBasics/validation.js | UTF-8 | 542 | 3.1875 | 3 | [
"MIT"
] | permissive | //alert("connnected")
function validate() {
let myvalue = document.getElementById("searchEt").value;
if (isNaN(myvalue) || myvalue < 1 || myvalue > 20) {
console.log("Not a valid input")
} else {
console.log("Value accepted")
}
}
// Form validation
document.querySelector(".myform")... | true |
5a426997e6125b884f970fd47225d85cc254bea1 | JavaScript | atanas-dim/ecommerce-PERN | /server/controllers/users.controller.js | UTF-8 | 1,984 | 2.765625 | 3 | [] | no_license | const UsersService = require("../services/users.service");
const { validateEmail } = require("../helpers/validateEmail");
const { validatePassword } = require("../helpers/validatePassword");
const { hashPassword } = require("../helpers/hashPassword");
const getAllUsers = async (req, res, next) => {
try {
const d... | true |
04dffacb7321ee6f0344ea74c110bff12bb586b2 | JavaScript | liamst19/fullstackopen-bloglist-exercise | /bloglist-frontend/src/reducers/__mocks__/loginReducer.js | UTF-8 | 1,193 | 2.578125 | 3 | [] | no_license | import testHelper from '../../tests/test_helper.js'
export const actionType = {
LOG_IN: 'LOG_IN',
LOG_OUT: 'LOG_OUT'
}
const reducer = (state = testHelper.newUserData, action) => {
switch(action.type){
case actionType.LOG_IN:
return action.user
case actionType.LOG_OUT:
return null
default:
ret... | true |
6a0192b5511b5770dc918d19ce235fbb95a3133b | JavaScript | adbetin/proyecto-pruebas-miso4208 | /Pruebas Proyecto ramdom/anexos_cypress/monkey_cypress_click.js | UTF-8 | 1,109 | 2.53125 | 3 | [] | no_license | describe('Prueba de monkey con cypress click en cualquier lado ', function() {
it('Monkey and cypress', function() {
//acceder a la pagina de pruebas
cy.visit('http://dolibarr-pruebas.herokuapp.com/')
//llenar campos de inicio sesion
cy.get('.login_table').find('input[name="username"]').click().typ... | true |
a3d3272b60613668891ff3e201a74560e745b7e8 | JavaScript | rstropek-teaching/converter-quiz-4ahif-Kueblboeck | /convert.js | UTF-8 | 1,023 | 3.0625 | 3 | [] | no_license | var convert = require('convert-units');
error = true;
number = -1
metric = 'flup';
result = 'flip';
if (process.argv[2] > 0) {
number = process.argv[2];
if (process.argv[3] === 'm' || process.argv[3] === 'cm' || process.argv[3] === 'mm') {
metric = process.argv[3];
if (process.argv[4] =... | true |
151f727253a5897459f1a135b12b36104b1dedce | JavaScript | ddanailova/JavaScript-Advanced | /Exam/04/app.js | UTF-8 | 3,166 | 2.625 | 3 | [] | no_license | function realEstateAgency() {
let rent = $('input[name="apartmentRent"]');
let type = $('input[name="apartmentType"]');
let commission = $('input[name="agencyCommission"]');
let registerBtn = $('button[name="regOffer"]');
let notifications = $('#notifications #message');
let offers = [];
le... | true |
79baf143f00a8e44c48db4393aabed99208ca3c6 | JavaScript | FeliCarrique/Trabajo-Practico-2--JS | /index.js | UTF-8 | 842 | 3.9375 | 4 | [] | no_license |
var numeroUsuario= Number(prompt("ingrese un numero"))
var operadorUsuario= prompt("ingrese operacion")
var numeroUsuarioBis= Number(prompt("ingrese otro numero"))
var suma= function(a,b){
console.log("El resultado es", a+b)
return a+b
}
var resta= function(a,b){
console.log("El resultado es", a-b)
return ... | true |
3b95c5119477e444985283ef5af2eb44d46c8670 | JavaScript | elainecode/js-looping-and-iteration-looping-code-along-london-web-121018 | /index.js | UTF-8 | 450 | 3.5625 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Code your solutions in this file
function printBadges(bs) {
for (let i = 0; i < bs.length; i++) {
console.log(`Welcome ${bs[i]}! You are employee #${i + 1}.`);
}
return bs;
}
function tailsNeverFails() {
let countdown = 10;
let k = 0;
let play = 1;
while (countdown > 0 && play >= 0.5... | true |
30f74f8d6760c0fbd0a4fb5a3f469d89385f5401 | JavaScript | lkduy/javascript | /bai3_26/bai22_reduce2.js | UTF-8 | 1,068 | 4.34375 | 4 | [] | no_license | var items = ['Tom','Bill','Kim'];
var value = items.reduce(function(result, item){
return result + '<' + item + '>'
},[]);
console.log(value);
console.log('=====================================')
// Given an array of arrays, flatten them into a single array
var arrays = [
["1", "2", "3"],
[true],
[4,... | true |
ed869cd5e1c96b65e89584c2e696a693ece4ef05 | JavaScript | SrikanthV23/Javascript | /js/main.js | UTF-8 | 1,820 | 2.796875 | 3 | [
"MIT"
] | permissive | window.onload= function(){
var myForm = document.forms.signUp_Form;
myForm[0].addEventListener('blur',function(e){
if(myForm[0].value == '' || myForm[0].value == null){
document.getElementById('nameErrMsg').innerHTML='First Name cannot be empty';
}
else{
console.log(myF... | true |
41e846c4942b82f2f2105c1eae876aa6e0eb154b | JavaScript | JizraDesign/covid-19 | /docs/js/covid.js | UTF-8 | 1,388 | 2.8125 | 3 | [] | no_license | let fechaHora = document.querySelectorAll('.fechaHora');
let celdaNumero = document.querySelectorAll('.data__celda-numero');
let img = document.querySelector('#img-importante');
fetch('https://api.covid19api.com/summary')
.then(resp => resp.json())
.then(pais => {
// console.log(pais);
let mex = pais.Countries... | true |
4538738c04d2bebb99e7f18d0cb46f89a5296875 | JavaScript | edobry/node-KingofKmaps | /index.js | UTF-8 | 4,185 | 3.265625 | 3 | [] | no_license | var fs = require("fs");
var stdin = process.stdin, stdout = process.stdout;
var player1 = {};
var player2 = {};
var currPlayer = function (){ return (turn % 2 != 0) ? player1 : player2; };
var grid = [" "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ","... | true |
07c2f9edda188ee99e9721abbfc851ac93d5b2f6 | JavaScript | zhouhu949/nodejs-office | /src/excel2json.js | UTF-8 | 1,266 | 2.6875 | 3 | [
"MIT"
] | permissive | const fsPromise = require('fs').promises
const Excel = require('exceljs')
const path = require('path')
async function excel2json (excelSheetName, jsonFileName) {
const excel = new Excel.Workbook()
const workbooks = await excel.xlsx.readFile(path.resolve(__dirname, 'excel', '20200514.xlsx'))
const workbook = work... | true |
5348dc87bec8c55d90f391ce96ebfae5052630dd | JavaScript | themegat/taskmonitor | /js/datastore.js | UTF-8 | 2,121 | 2.515625 | 3 | [] | no_license | var mySql = require('mysql');
var AppUser = function () {
this.id = "";
this.fName = "";
this.lName = "";
this.isInit = false;
};
AppUser.prototype.init = function () {
this.id = localStorage.getItem("user_id");
this.fName = localStorage.getItem("user_fname");
this.lName = localStorage.get... | true |
395aead2414ddb279a444193d6f6f44beb087e75 | JavaScript | victoria-viver/Snake_JS | /UI.js | UTF-8 | 1,120 | 2.828125 | 3 | [
"MIT"
] | permissive | class UI {
constructor () {
this.KEYS = {
LEFT :37,
UP :38,
RIGHT:39,
DOWN :40
};
this.isEnable = true;
this.lastPressedBtn = this.KEYS.UP;
window.onkeydown = e => {
console.log (e);
if (Object.keys(this.KEYS).some(key => this.KEYS[key] === e.keyCode)
&& this.isEnable
&& ... | true |
58087a38f6b640b23d2b8e26bb17dbf2ea8d216e | JavaScript | Valsinev/JavaScript-homework | /homework/JS Fundamentals/Data types and Variables/05. Parsing numbers.js | UTF-8 | 1,684 | 3.53125 | 4 | [
"MIT"
] | permissive | // Try parsing the following strings to numbers using parseInt, parseFloat, Number, + and | 0. Fill the answers for yourself in the table below.
//
// str parseInt(str) parseFloat(str) Number(str) +str str | 0
// '1234' ? ? ? ? ?
// '1238abc' ... | true |
57f0369b5cc03e6957d2c90c550297c3196ab9c8 | JavaScript | themaxopti/Modal-window | /games/jsss/index-modal.js | UTF-8 | 981 | 2.640625 | 3 | [] | no_license | const modal = $$.modal({
title:'Modal-window',
content:'lorem ipsum 4',
image:'./img/134.png'
})
let games = [
{id:1,text:'follout 4',img:'./img/foll.png'},
{id:2,text:'witcher 3',img:'./img/witcher.jpg'},
{id:3,text:'Horizon:Zero down',img:'./img/horzzon.jpg'},
{id:4,text:'Resident Evil 3... | true |
10cb2037982e9457d2a3b4508ea7612c41ad3fda | JavaScript | yxxz/wjs.github.io | /js/index.js | UTF-8 | 4,125 | 2.90625 | 3 | [
"MIT"
] | permissive | /**
* Created by Administrator on 2016/3/23.
*/
$(function () {
//轮播图
banner();
//tooltips
$('[data-toggle="tooltip"]').tooltip();
//初始化
initTabs();
});
//轮播图
function banner(){
/*
* 1.通过ajax获取数据 图片
* 2.判断屏幕的尺寸 $(window).width()
* 3.再根据屏幕的尺寸 json转化渲染html字符串 两种方式(js拼接 ... | true |
1d9d910e57d1c85d4b65f2919d8c47212b73d04d | JavaScript | tania2018/selfieProject | /Surecash Selfie Codes Final/surecash_selfie_contest/js/actioncam.js | UTF-8 | 9,201 | 2.75 | 3 | [] | no_license | // ....................... Template Buttons selections ..........................
$(document).ready(function(){
$("#first_temp").click(function(){
$("#camera1").show();
$("#camera2").hide();
$("#camera3").hide();
$("#camera4").hide();
$("#camera5").hide();
});
});
$(document).ready(function()... | true |
e5e16f680a429e4736648c6c202b546ad3e06227 | JavaScript | jinwolf/WalkingDead | /Player.js | UTF-8 | 4,843 | 2.75 | 3 | [] | no_license | var Player = Entity.extend({
controls: {
'up': 'up',
'left': 'left',
'down': 'down',
'right': 'right',
'punch': 'punch',
'shoot': 'shoot'
},
/**
* Bitmap dimensions
*/
size: {
w: 136,
h: 136
},
alive: true,
isStopp... | true |
f3e24b364a647bcad96bcb429b58b99077562bce | JavaScript | deriiickjohn/OnboardingTask_DerickAguiling | /OnboardingTask_ReactDemo/ClientApp/src/components/Store/EditStore.jsx | UTF-8 | 3,436 | 2.515625 | 3 | [] | no_license | import React , {Component} from 'react'
import { Modal,Button, Form } from 'semantic-ui-react';
import axios from 'axios';
export class EditStore extends Component {
constructor(props){
super(props);
this.state = {
stores : {
name : '',
address: ... | true |
e859ac8f56a13e357ca3b4e09ed3911461572f13 | JavaScript | LujiAnna/js-exercises | /01-base/04-agt-confirm/script.js | UTF-8 | 1,040 | 3.375 | 3 | [] | no_license | /* becode/javascript
*
* /01-base/04-asv-confirm/script.js - 1.4: ASV avec confirmation
*
* coded by Anna
* started at 24/06/2021
*/
// NOTE: don't focus on the existing code structure for now.
// You will have time to focus on it later.
(function() {
// age/gender/town with confirmation
// Ask three question... | true |
23d2274f17d11077eab29c66de3cc8f44a36dcb3 | JavaScript | pornister/pornister.github.io | /back up of old website/site.js | UTF-8 | 396 | 2.59375 | 3 | [] | no_license | $(document).ready(function(){
$('.shuffle').shuffle();
});
$.fn.shuffle=function () {
var parent = $(".shuffle");
var divs = parent.children();
while (divs.length) {
parent.append(divs.splice(Math.floor(Math.random() * divs.length), 1)[0]);
};
};
$(document).ready(function(){
$('button').click(... | true |
ff93a33d0d91cfcd2250fc251a13de9427963343 | JavaScript | nuxt/press | /packages/blog/src/blueprint/source.js | UTF-8 | 2,128 | 2.546875 | 3 | [] | no_license | import Markdown from '@nuxt/markdown'
import graymatter from 'gray-matter'
import { slugify } from '@nuxt-press/utils'
const source = {
processor () {
return new Markdown({
toc: false,
sanitize: false
})
},
markdown (source, processor) {
return processor.toMarkup(source).then(({ html }) =... | true |
8137f8493eb0bb052e532196260e361239e7bc00 | JavaScript | nsc-tomonaga/kaihatu_kensyuu | /js/area.js | UTF-8 | 504 | 3.984375 | 4 | [] | no_license | function getArea(length, width) {
if (length >= 1 && length <= 1000){
if(width >= 1 && width <= 1000){
let area = length * width;
return area;
}
}
}
function getPerimeter(length, width) {
if(length >= 1 && length <= 1000){
if(width >= 1 && width ... | true |
1dcb3743e04bda51eeb4cc0fff96b74a38530fc5 | JavaScript | atrnh/atrnh.github.io | /dist/static/js/script.js | UTF-8 | 270 | 2.5625 | 3 | [] | no_license | "use strict";
(() => {
document.querySelectorAll("article.card").forEach((el) => {
el.addEventListener("click", (e) => {
console.log(e.target);
console.log(e.target.dataset.url);
window.location.assign(e.target.dataset.url);
});
});
})();
| true |
82b0ce535d1cfea4ef46a8fc3ec9490d5a66a459 | JavaScript | justdotiung/jestPrec | /newObj.js | UTF-8 | 3,381 | 3.953125 | 4 | [] | no_license | // Marsupial 유대동물 (코알라 등등 유대류 동물) nocturnal 야행성
function Marsupial(name, noctural) {
this.name = name;
this.isNoctirnal = noctural;
}
var maverick = new Marsupial('매버릭', true);
var slider = new Marsupial('슬라이더', false);
console.log(maverick.isNoctirnal);
console.log(maverick.name);
//new를 사용하도록 강제하는 방법
/*
... | true |
b98c2db70e7199a5595f01073b5b653cd0c27f8d | JavaScript | nickvamvou/cryptonius | /wallet/transaction.js | UTF-8 | 4,199 | 3.015625 | 3 | [] | no_license | /**
* Created by nikolasvamvou on 6/11/18.
*/
const ChainUtil = require('../chain-util');
const {MINING_REWARD} = require('../config');
class Transaction{
constructor(){
//id of transaction
this.id = ChainUtil.id();
this.input = null;
//how much currency the sender want to send t... | true |
90e6f985347859597529e3e8ea7f9018aeb62317 | JavaScript | AtharvaSDeshpande/Multiple-Language-Programming-App | /Backend Server/src/QuestionBlock.js | UTF-8 | 5,618 | 2.703125 | 3 | [] | no_license | import React from 'react'
import { useState } from 'react';
import db, { timestamp } from './firebase';
import './QuestionBlock.css'
import { useStateValue } from './StateProvider';
function QuestionBlock() {
const [langCode,setLangCode] = useState();
const [versionIndex,setVersionIndex] = useState();
co... | true |
555ad0e1860e454b6bb962f37372a6e21282da9f | JavaScript | zhaoxiao10/dinaduola | /routes/dinaduola.js | UTF-8 | 890 | 2.5625 | 3 | [] | no_license | var Dinaduola = require('../models/dinaduola.js');
var express = require('express');
var router = express.Router();
// get all movies
router.list = function(req, res){
Dinaduola.find(function (err, dinaduola) {
if (err) {
return res.send(err);
}
res.json(dinaduola);
})
/... | true |
b2a04425f6c85e059b61a1a608c884308c3209c2 | JavaScript | lalunamel/journal | /src/components/App/App.js | UTF-8 | 2,632 | 2.578125 | 3 | [] | no_license | import React, { Component } from "react";
import "./App.css";
import RepositoryFactory from "../../Repository/FirestoreRepositoryFactory";
import Nav from "../Nav";
import Header from "../Header";
import EntryForm from "../EntryForm";
import PreviewForm from "../PreviewForm";
import EntriesContainer from "../EntriesC... | true |
48607e7a7657017b33b276f006dd3c7045b2a734 | JavaScript | mazhenxiao/git | /components/tools-page.js | UTF-8 | 1,133 | 2.65625 | 3 | [] | no_license | /**
* <Page total={this.state.pageTotal} count={this.state.pageCount} callback={ this.Bind_Click_Page.bind(this) } />
* total:页数
* count:总条数
* callback:点击回调
*/
import React from 'react';
class Page extends React.Component {
constructor(arg) {
super(arg)
this.state = {
current: 1
... | true |
e677f675d2fa0e5e7b19279b76d384eac326eada | JavaScript | MaurizioFaedda/js-check-mail | /main.js | UTF-8 | 1,239 | 3.546875 | 4 | [] | no_license | // -------------check email------------
// // chiedo l'email all'utente
// var emailUtente = prompt("Inserisci la tua email");
//
// // le mia lista di email
// var emailRegistrate = ['andrea@gmail.com', 'marco@gmail.com', 'sara@gmail.com', 'giulia@gmail.com'];
//
// var emailVerificata = false;
//
// // Cer... | true |
164226ce8db44d17bd2c485fcebaaf9e9967445c | JavaScript | swc-project/swc | /crates/swc/tests/tsc-references/emitDefaultParametersFunction.1.normal.js | UTF-8 | 762 | 2.578125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | //// [emitDefaultParametersFunction.ts]
function foo(x) {
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 10;
}
function baz(x) {
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 5;
for(var _len = arguments.length, rest = new Array(_len > 2 ? _len - 2 : 0), _... | true |
e5ab6432e69b600ec098a786bd0291dca150b868 | JavaScript | BrianNewsom/keyper-client | /ex/add.js | UTF-8 | 432 | 2.640625 | 3 | [] | no_license | // Adding a key to Keyper using lib
keyper = require('../keyper');
// get keyper key from environment variables, or default to 12345
var keyperKey = process.env['KEYPER_KEY'] || '12345';
var app = 'google';
var key = 'this_is_a_google_key';
keyper.add(keyperKey, app, key, function(res){
console.log(res);
})
// Add ... | true |
3a2500e32f840b1ff71261c7f2a7e340ba107105 | JavaScript | tom2kota/js-functions | /advanced-functions/hoisting.js | UTF-8 | 1,464 | 3.828125 | 4 | [] | no_license | /*
Поднятие (hoisting) — термин, который вы не встретите в документации JavaScript.
Поднятие задумывалось как общий способ мышления о том, как контекст исполнения
(в частности, фазы создания и исполнения) работает в JavaScript.
Однако, hoisting может привести и к недоразумениям.
Например, hoisting у... | true |
4fcea2aa64ccc9c56be1668ee90aad76d114f4ef | JavaScript | cgauthier/VUEJS_2.1.3 | /code_samples/bootstrap_event_modifiers/app.js | UTF-8 | 970 | 2.828125 | 3 | [] | no_license | var scope = {
window: window,
Vue: Vue
};
window.onload = launch.bind(scope);
function launch() {
var V = this.Vue;
var window = this.window;
var app = new V({
el: '#app',
data: {
a: 1,
b: 2,
c: null,
operator: "+"
},
... | true |
b9471425d2f62513f4953613a4ee66b7c1d13f9a | JavaScript | choi-dragon/weather_app | /src/weather.js | UTF-8 | 1,606 | 3.140625 | 3 | [] | no_license | const request=require('request')
const weather=(latitude,longitude,callback)=>{
const url='https://api.darksky.net/forecast/6278cd492ea2c74d672b1ac45354dc2e/'+latitude+','+longitude+'?units=si'
request({url,json:true}/*this is conventional in request module. Which sets the url as above url. It is then followed... | true |
b834029af2c2161c12205adc73e233eba550dee8 | JavaScript | zahraaliaghazadeh/algorithm-codewars | /8kyu/FakeBinary/index.js | UTF-8 | 915 | 3.90625 | 4 | [
"MIT"
] | permissive | // 8kyu
// Given a string of digits, you should replace any digit below 5 with '0' and any digit 5 and above with
//'1'. Return the resulting string.
function fakeBin(x){
var below5 = [0,1,2,3,4]
var above5 = [5,6,7,8,9]
var string = ""
// var newX = x.toString()
for (let i = 0 ; i<x.length ;... | true |
ee9a8a38733677f58b2fcf2658f923ad3eb01ec8 | JavaScript | Abbas285/TodoApp | /src/project/UserForm/FormHand.js | UTF-8 | 2,759 | 2.578125 | 3 | [] | no_license | import React, { useState } from 'react'
import './FormHand.css';
function FormHand() {
const [number,setnumber]=useState({
firstname:'',
secondname:'',
email:'',
phone:'',
qualification:''
})
const [data,setdeta]=useState({
firstname:'',
secondname:'',... | true |
42a9a9e23037707afbf9b127ab049faf72027edb | JavaScript | GiulioVolletti/js-campominato | /js/campo-minato.js | UTF-8 | 2,424 | 3.671875 | 4 | [] | no_license | console.log("hello world");
// BONUS: (da fare solo se funziona tutto il resto)
// all’inizio il software richiede anche una difficoltà all’utente che cambia il range di numeri casuali:
// con difficoltà 0 => tra 1 e 100
// con difficoltà 1 => tra 1 e 80
// con difficoltà 2 => tra 1 e 50
var mineDifficolta = 0... | true |
259ed9c384407f5f543b92071f6c6da8210f3152 | JavaScript | AlpacaRoom/0x0800 | /js/Board.js | UTF-8 | 9,081 | 3.125 | 3 | [] | no_license | /*global HexGrid, Vector, Tile, Game */
var Board = (function () {
"use strict";
/**
* Initializes a grid of size radius and sets initial values
* in the hexes.
*
*/
function Board(radius, tileValue) {
this.score = 0;
this.radius = radius;
// Create t... | true |
816cf2ed312ef14215a4413d741d2a232fdbf785 | JavaScript | learn-academy-2020-echo/week-4-assessment-ChrisoloRobin | /code-challenges.js | UTF-8 | 3,312 | 4.59375 | 5 | [] | no_license | // ASSESSMENT 4: JavaScript Coding Practical Questions
// --------------------1) Create a function that takes in an array. Each time the function is run, remove the first item from the array and shuffle the remaining content. If the array is empty, return "The array is empty."
var collections = ["purple", "blue", "gr... | true |
5a19d4e3595ead60d69300dfe0375110aa270c72 | JavaScript | VZee/travelPlanningAPI | /models/Activity.js | UTF-8 | 1,006 | 2.59375 | 3 | [] | no_license | //Name: Louisa Katlubeck
//Description: Create the model for the activity
// Sources: OSU CS290, OSU CS340, https://expressjs.com/en/guide/routing.html,
// https://stackoverflow.com/questions/19619936/how-to-separate-the-routes-and-models-from-app-js-using-nodejs-and-express,
// http://timjrobinson.com/how-to-structure... | true |
f985f462f8ad7d4c10e66a054dd832c0cfcc5004 | JavaScript | anjaligeril/project1carla | /writing.js | UTF-8 | 1,609 | 3.515625 | 4 | [] | no_license | var word1="";
var word2="";
var word3="";
var word4="";
var result="";
function enteranswer1(){
word1=prompt("Enter the answer");
if(word1=="avocado"){
result="You are right!!";
}
else {
result="Sorry, that's incorrect";
}
alert("Click Check Answer to see the r... | true |
13824ff16290fd2510e031a2dffbdece35e9ddac | JavaScript | ibsenleo/pixelizer | /svg.js | UTF-8 | 10,167 | 2.703125 | 3 | [] | no_license |
// var grpHalo;
// var arrPoints = new Array();
// var pointRadius = 3;
// var pointGap = 5;
// var marginTop = 20;
// var marginLeft = 20;
// var pointsColor = "#555"
// var matrixRes = {
// width : 61,
// height: 53
// }
// Lets create big circle in the middle:
$(document).ready(function(){
// s = Sna... | true |
4d1afcecfd15ae2c5697829153660176a67a549c | JavaScript | lewismoten/artificial-neural-network | /run.js | UTF-8 | 934 | 3.265625 | 3 | [
"ISC"
] | permissive |
const lib = require('./lib');
// TODO:
// build network that can quickly setup a new network
// let network = new lib.Network(3, 4, 2);
// let output = network.process(0, 1);
//
// same for layer
// layer = new lib.Layer()
// layer.process();
//
// back-propagation
//
let save = require('./examples/xor.json');
let n... | true |
22cc4470cbc4e09e1d19529d01c4f28c83814fbf | JavaScript | brandonaaskov/shaunzomdotcom | /src/components/TournamentPage.js | UTF-8 | 5,238 | 2.5625 | 3 | [] | no_license | import React from "react";
import base from "../base";
import BracketInfo from "./BracketInfo";
class TournamentPage extends React.Component {
state = {
tournament: {},
brackets: {},
editing: false
};
componentDidMount() {
const { params } = this.props.match;
//rein... | true |
f817c5c60615b7b48135734bacd860c1a3d426de | JavaScript | ibobaskan268/iblisbotv12 | /evlenme-teklifi.js | UTF-8 | 2,179 | 2.6875 | 3 | [
"MIT"
] | permissive | const Discord = require('discord.js');
const data = require('quick.db')
exports.run = async (client, message, args) => {/*
A gift from chimp#0110 to all codare members */
if(!args[0]) return message.channel.send(`Hayatı... | true |
941b9fe4cc9470cad7639a6294accfbd311b5b78 | JavaScript | patteboss/fullpage | /nyckelpiga-master/labyrint.js | UTF-8 | 2,065 | 3.125 | 3 | [] | no_license | // Allmäna variabler
var c, ctx, ladybug;
// Variabler för spelaren
var xPlayer = 1, yPlayer = 1, rotation = 0;
// Bana lagras i 2d-array
var map = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 1, 0, 0, 0, 1],
[1, 0, 0, 1, 0, 1, 0, 1, 0, 1],
[1, 0, 0, 1, 0, 0, 0, 1, 0, 1],
[1, 1, 1, 1, 1, 1, 1... | true |
ede8f91cbedcb012ead449328268926fb9b0b9fa | JavaScript | glorydkim/10-Days-of-JavaSript | /Day 2/Switch.js | UTF-8 | 2,317 | 4.78125 | 5 | [] | no_license | /*
Objective
In this challenge, we learn about switch statements. Check out the attached tutorial for more details.
Task
Complete the getLetter(s) function in the editor. It has one parameter: a string, s,
consisting of lowercase English alphabetic letters (i.e., a through z). It must return
A, B, C, or D dependin... | true |
2cb1014083b326f6a386a290d984632e496fa5c7 | JavaScript | robertqiu110/GameDesignWebsite | /club.js | UTF-8 | 1,459 | 2.984375 | 3 | [] | no_license | window.onload = function() {
var aboutLink = document.getElementById('aboutLink');
var partiesLink = document.getElementById('partiesLink');
var eventsLink = document.getElementById('eventsLink');
var aboutPage = document.getElementById('aboutPage');
var partiesPage = document.getElementById('partiesPage');
var ... | true |
75969f91916f48593a424f228806a3a97282b3e2 | JavaScript | aurimas-darguzis/login-portal | /src/Login/LoginForm.js | UTF-8 | 4,559 | 2.546875 | 3 | [] | no_license | import React from "react";
import { useForm } from "react-hook-form";
export default function LoginForm({ history }) {
const { register, handleSubmit, errors } = useForm();
const calendarDayRegex = /^([1-9]|[12][0-9]|3[01])$/;
const calendarMonthRegex = /^[1-9]$|^[1][0-2]$/;
const calendarYearRegex = /(19|20)\... | true |
06dcae1c576ad87fa7a0426285760fd4fafa9632 | JavaScript | KirylLapouski/testManager | /client_src/src/redux/redusers/courses.js | UTF-8 | 1,766 | 2.5625 | 3 | [] | no_license | import constants from '../constants'
const courses = (state = {}, action) => {
let newState, constant = constants.courses
switch (action.type) {
case constant.ADD_COURSE:
return {
...state,
[action.payload.id]: {
...state[action.payload.id],
.... | true |
34024eda76655ede704f621a5b5b61651d301a33 | JavaScript | bvskraj/mrnd-nodejs-bvskraj | /src/contacts/routes/contacts.js | UTF-8 | 1,374 | 2.765625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var contact_db=[];
var c_id;
/* GET contacts */
router.get('/:id', function(req, res, next) {
id=req.params.id;
res.send(contact_db[id]);
});
router.post('/', function(req, res, next) {
console.log(req.body);
console.log('in post');
var obj... | true |
62ee330b5b01b970e3867b155c8070b4c2431ddd | JavaScript | casperin/odd-helpers | /src/object.js | UTF-8 | 308 | 2.5625 | 3 | [] | no_license | import { curry } from './util';
export const filterObject = curry((fn, obj) =>
Object.keys(obj).reduce((newObject, key) => {
const value = obj[key];
if (fn(key, value)) newObject[key] = value;
return newObject;
}, {}));
export const values = obj =>
Object.keys(obj).map(key => obj[key]);
| true |
ee49954c51249204d79858c9853efcd8ef163b47 | JavaScript | MrSwitch/hello.js | /assets/knockout/src/templating/templateEngine.js | UTF-8 | 3,618 | 3.140625 | 3 | [
"MIT"
] | permissive | // If you want to make a custom template engine,
//
// [1] Inherit from this class (like ko.nativeTemplateEngine does)
// [2] Override 'renderTemplateSource', supplying a function with this signature:
//
// function (templateSource, bindingContext, options) {
// // - templateSource.text() is the text ... | true |
139316577ebe6a0ffd5055a15673f76cd68f66b0 | JavaScript | cduff0805/vschool | /ModuleOne-VSchool/dom-olympics-start/index.js | UTF-8 | 773 | 3.453125 | 3 | [] | no_license | var header = document.getElementById("header")
header.textContent = "Javascript Made This!"
header.style.textAlign = "center"
header.style.font = "bold"
header.style.fontSize = "25px"
var nameOne = document.getElementById("name")
nameOne.style.color = "orange"
var div1 = document.getElementById("divOne")
div1.style.t... | true |