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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6935bfd790f93d2a12e0149080d001250c00ee67 | JavaScript | tabatak/learning-javascript | /studygroup/0919/todohuken.js | UTF-8 | 438 | 2.578125 | 3 | [] | no_license | const prefectures = [
{name: '北海道', district:'北海道'},
{name: '青森', district:'東北'},
{name: '秋田', district:'東北'},
{name: '岩手', district:'東北'},
{name: '山形', district:'東北'},
{name: '宮城', district:'東北'},
{name: '京都', district:'関西'},
{name: '滋賀', district:'関西'}
];
//
prefectures.forEach((prf) => console.log(`... | true |
2bd4c55d2014f6cb87405422edd9057e54768cde | JavaScript | JooHyoungLee/code | /chahoo/kr.co.chahoo.gucha_2015_05_11/src/main/webapp/js/validator.js | UTF-8 | 6,084 | 3.5 | 4 | [] | no_license | function checkKor(temp, text, minLength, maxLength){
//text(문자열), minLength(최소자리수) maxLength(최대자리수)
//한글 체크
var len = text.length;
if(len >= minLength && len <= maxLength){
var pattern = /^[가-힣\s]+$/;
if(!pattern.test(text)){
alert(temp+"는 한글만 입력해주세요.");
return false;
}else{
return true;
... | true |
978c533dfd69831b956e6216601c0c943c948942 | JavaScript | tingcl/movie-renting-page | /hw7-frontend-tingcl-master/src/main/resources/www/js/index.js | UTF-8 | 438 | 2.703125 | 3 | [] | no_license | var rad = document.myForm.searchFor;
var prev = null;
for (var i = 0; i < rad.length; i++) {
rad[i].addEventListener('change', function() {
if (this !== prev) {
prev = this;
}
if(this.value == 'title'){
$('.index-bar-query').attr('placeholder', 'Browse by title...')
... | true |
f0bafc6eafdaf039aa6c5751f76ca4c191129a5c | JavaScript | herbertg14/r365_calculator | /src/utils/utils.js | UTF-8 | 1,272 | 3.484375 | 3 | [] | no_license | // Returns an array of customized separators
const parseSeparatorHelper = (separator) => {
let separatorArr = [];
//simple custom separator
if (separator.length === 3){
separatorArr.push(separator.charAt(2));
return separatorArr;
//custom separtors using [][] format
}else{
l... | true |
a499d5ff730791a81d7d68c18ff281bbf950bf1a | JavaScript | lenkan/cygni-rps | /src/rps.test.js | UTF-8 | 2,220 | 2.90625 | 3 | [] | no_license | import rps from './rps'
describe('rock paper scissors', () => {
it('creates new game with random id', () => {
const game1 = rps.create()
const game2 = rps.create()
expect(game1.id()).toBeDefined()
expect(game1.id()).not.toEqual(game2.id())
})
it('gives back the stored game', () => {
const g... | true |
4e21832200f515209553df6abf585ccd78c6a265 | JavaScript | D2TA/DailyCodingProblem | /Problem-11/problem-11.js | UTF-8 | 1,748 | 3.671875 | 4 | [] | no_license | // Loading an local text file into Enviroment
// Since we are using Node.js
// JavaScript Package fs: File System
// This method takes a String and creates an Array
// https://nodejs.org/dist/latest-v6.x/docs/api/fs.html
const fs = require('fs');
const http = require('http');
var WordSugge... | true |
4207461fbfc36983a89b85f3869ebc7ff232a306 | JavaScript | guyixiong/guyixiong.xiangmu.io | /js/animate.js | GB18030 | 10,911 | 3.421875 | 3 | [] | no_license | /**
* ݻȡԵĵǰֵ
* @param element
* @param attr
* @returns {*}
*/
function getStyle(element, attr) {
if (window.getComputedStyle) {
return window.getComputedStyle(element, null)[attr];
} else {
return element.currentStyle[attr];
}
}
/**
* 汾ȱڣֻˮƽλ
* @param element
* @param target
*/
fu... | true |
911670fc36842f9ebc678059b5873b0357308091 | JavaScript | Avishekdevnath/A6_Book_Archive | /Js/app.js | UTF-8 | 3,708 | 2.90625 | 3 | [] | no_license | //////////////////// Spinner function ///////////////////
const displaySpinner = display => {
document.getElementById('spinner-loading').style.display = display;
}
//////////////// Error Function //////////////////////////
const displayError = display => {
document.getElementById('error-found')... | true |
3fb4c9229f0a3dbe8240c5647278ce9e83ab63df | JavaScript | ajace/requirejs | /js/router.js | UTF-8 | 1,443 | 2.671875 | 3 | [] | no_license | define(['jquery', 'hashchange', 'controllers/listController', 'controllers/addController'],
function($, hashchange, listController, addController){
var routes = [{hash:'#list', controller:'listController'},
{hash:'#add', controller:'addController'}];
var defaultRoute = '#... | true |
d0189882eccf8b52c0b805e7b1447b1a52bfe1aa | JavaScript | mattpodwysocki/jsconf.co-2015-workshop | /lessons/10/problem1.js | UTF-8 | 248 | 2.640625 | 3 | [
"MIT"
] | permissive | console.clear();
var clock = Rx.Observable.interval(100).take(10);
function delay(source, interval) {
// TODO: implement this function using flatMap().
// You should return an Observable.
}
delay(clock, 2000).subscribe(x => console.log(x));
| true |
85188bbfc03d5e883acfc6e18a7fe40a2c3e7069 | JavaScript | bvedad/django-ckeditor-5 | /django_ckeditor_5/static/django_ckeditor_5/src/custom_plugins/imagetitle/imagetitlecommand.js | UTF-8 | 710 | 2.53125 | 3 | [
"BSD-3-Clause"
] | permissive | import Command from '@ckeditor/ckeditor5-core/src/command';
import { isImage } from '@ckeditor/ckeditor5-image/src/image/utils';
export default class ImageTitleCommand extends Command {
refresh() {
const element = this.editor.model.document.selection.getSelectedElement();
this.isEnabled = isImage( element );
... | true |
4109a62e1a2785ff4d0e270c71fe73d23070bb84 | JavaScript | future4code/bouman-future-eats | /src/reducers/restaurants/index.js | UTF-8 | 932 | 2.671875 | 3 | [] | no_license | const initialState = {
restaurantList: [],
// cada item é um objeto com as mesmas chaves do selectedRestaurant, exceto pelos products
selectedRestaurant: {
id: '',
name: '',
category: '',
deliveryTime: 0,
description: '',
shipping: 0,
address: '',
... | true |
fe9fa5c764f04e79e434678c0e9d35c25c8b3997 | JavaScript | adhyans/frontend-primer | /main.js | UTF-8 | 3,644 | 3.484375 | 3 | [] | no_license | // Another way to create object
function createTweetObject(img, name, username, followers) {
const obj = Object.create(null);
obj.img = img;
obj.name = name;
obj.username = username;
obj.followers = followers;
obj.incrementFollower = function () { obj.followers++ };
return obj;
}
const data = [
{
img: 'ht... | true |
2e5f11ce8fe74721bb0dc592d7a3a7c59ae6597e | JavaScript | pedrotunin/Users-API | /helpers/Validate.js | UTF-8 | 3,092 | 2.921875 | 3 | [
"MIT"
] | permissive | const validator = require('validator');
const Constants = require('./Constants');
class Error {
constructor(field, message) {
this.field = field;
this.message = message;
};
getMessage() {
return this.message;
};
getField() {
return this.field;
};
}
class Va... | true |
7f31a44ffe642feb7a347aca5c9c987082f6e030 | JavaScript | yautah/dva-wxapp | /src/utils/dva-model-extend.js | UTF-8 | 1,751 | 2.78125 | 3 | [
"MIT"
] | permissive | const check = (origin, cache, count) => {
for (let key in origin) {
if (cache.indexOf(key) === -1) {
cache.push(key)
} else {
count[key] ? count[key]++ : (count[key] = 1)
}
}
}
const log = (model, constitute, count) => {
let logCount = 0
for (let key in count) {
if (!logCount) {
... | true |
bfee2f4d6d3301f153760b5d4036d8c9b879ba0c | JavaScript | entonio/gitlex | /content/merge_request_force_remove_source_branch.js | UTF-8 | 621 | 2.53125 | 3 | [] | no_license | /*
Copyright (c) 2016, Antonio Marques
All rights reserved.
You may use and redistribute this software, with or without modification, under the following conditions:
1. Redistributions must retain the above copyright notice, this list of conditions and the following disclaimer.
2. If this source code is modified... | true |
80ac7e2dcdbb0eb26f7f5ec8db8a8d027f83ecc8 | JavaScript | tjrexer/webiny-js | /packages/cli-plugin-deploy-pulumi/commands/deploy/buildPackages.js | UTF-8 | 5,886 | 2.59375 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | const path = require("path");
const { Worker } = require("worker_threads");
const chalk = require("chalk");
const parseMessage = message => {
try {
return JSON.parse(message);
} catch (e) {
return {
type: "error",
message: `Could not parse received build result (JSON): $... | true |
07978d08342893ee5a7ee2c5e5fdf743ff9b05bd | JavaScript | adamjones83/js_game | /scripts/commands.js | UTF-8 | 4,741 | 3.09375 | 3 | [] | no_license | // Sets GAME.RunCommand to a function that processes commands, but has a closure around some extra variables
$(document).ready(function(){
GAME.RunCommand = (function(){
var player = GAME.characters[0], i, cmdstr, cmdpending=false;
var CmdPending = function(fn, cursor) {
cmdpending=true;
if(!cursor) $("#view... | true |
698cbb5af4d7db0ae5445f8c594965199e394f82 | JavaScript | KodieIvie/Treehouse | /Full stack techdegree/project 2/pagination-filter-v2/js/app.js | UTF-8 | 2,834 | 2.953125 | 3 | [] | no_license | $(function(){
const $page = $(".page");
const srchBtn = $('.student-search button');
const $pagination = $("<ul>", {"class": "pagination"});
let $list = $(".student-item");
let active = 1;
let filter = '';
// create search box and append to page-header
let $search = $(`<div class="student-search">
<input... | true |
2cec9fc01f948a560796294b2afc43dde92e935c | JavaScript | namniak/Photo-Sphere-Viewer | /src/js/PhotoSphereViewer.events.js | UTF-8 | 7,469 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* Add all needed event listeners
*/
PhotoSphereViewer.prototype._bindEvents = function() {
window.addEventListener('resize', this);
document.addEventListener(PhotoSphereViewer.SYSTEM.fullscreenEvent, this);
// all interation events are binded to the HUD only
if (this.config.mousemove) {
this.hud.cont... | true |
8506a69f5aad87c959840677e0c3eacd78bbfb57 | JavaScript | Mani003/SchoolContact | /public/main.js | UTF-8 | 1,730 | 2.5625 | 3 | [] | no_license | const express = require('express');
const bodyParser= require('body-parser')
const app = express();
app.use(bodyParser.json())
var update = document.getElementById('update')
update.addEventListener('click', function () {
// Send PUT Request here
fetch('quotes', {
method: 'put',
headers: {'Conten... | true |
ad2d46b209fb9d34d0f8599577b0a5e21492e3b5 | JavaScript | AleenL/react-demo-trick | /new world/app/component/login/component/date/calendarHeader.jsx | UTF-8 | 702 | 2.53125 | 3 | [] | no_license | import React from 'react'
export default class CalendarHeader extends React.Component {
render() {
let arr = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
return (
<div className="calendarHeader">
<p className="prev"
... | true |
246554e341ee7947b39196fb637bbf966e810fc6 | JavaScript | CBIIT/cancer_control_website | /mli/Scripts/showHideDiv.js | UTF-8 | 707 | 2.59375 | 3 | [] | no_license | function toggleLayer(whichLayer) {
var elem, vis;
if(document.getElementById) // this is the way the standards work
elem = document.getElementById(whichLayer);
else if(document.all) // this is the way old msie versions work
elem = document.all[whichLayer];
else if(document.layers) // this is th... | true |
3ff7c57c7cb4d11568dbd2e3b93661aefa66f578 | JavaScript | you21979/electrumjs-server | /src/bitcoinjs-lib-patching.js | UTF-8 | 1,531 | 2.671875 | 3 | [
"MIT"
] | permissive | var assert = require('assert')
var bitcoin = require('bitcoinjs-lib')
var bufferutils = bitcoin.bufferutils
var opcodes = bitcoin.opcodes
/**
* @param {Buffer} buffer
* @param {number} offset
* @param {number} size Only 1, 2, 4
* @return {number}
* @throws {RangeError}
*/
function readNumber(buffer, offset, si... | true |
7cb69fbb9c38fc69b2875f1dc70bc62a7993852d | JavaScript | tina-fernan/Javascript | /js-02/getProperty.spec.js | UTF-8 | 1,012 | 2.9375 | 3 | [] | no_license | const { getProperty } = require("./getProperty");
describe("getProperty", () => {
it("should return the property of an object", () => {
const country = { name: "Austria" };
expect(getProperty(country, "name")).toBe("Austria");
});
it("should return the nested property of an object", () => {
const ca... | true |
32a2b274e0b7b10e9e39ac738ac1274df82ad330 | JavaScript | Sirano98/frontendAdvanced | /lesson 3/task 4/js/script.js | UTF-8 | 606 | 3.4375 | 3 | [] | no_license | // Random quote
var button = document.querySelector("button");
var quoteField = document.querySelector(".quote");
var author = document.querySelector(".author");
var background = document.querySelector(".wrapper");
button.addEventListener("click", getQuote);
function getRandomInt(max) {
return Math.floor(Math.ra... | true |
4340e43e8273c6dccd21e6d4bd2b4ffc6e57d65c | JavaScript | federai/GIFOS | /Javascript/crearGif.js | UTF-8 | 6,154 | 2.515625 | 3 | [] | no_license | const apiKey = "Uc1F9kfal68vQWzdRi60gLKD2i59hyw0";
var video = document.getElementById("video")
var titlemygif = document.getElementById("titlemygif");
var subtitle = document.getElementById("subtitle");
var firststep = document.getElementById("firststep");
var secondstep = document.getElementById("secondstep");
var th... | true |
6522603dcecd6d0ba003f6c23beabf4807a1d84f | JavaScript | davidmdm/stream-fun | /jsonFieldExtractor.js | UTF-8 | 1,531 | 2.71875 | 3 | [] | no_license | 'use strict';
const {Transform} = require('stream');
const recursiveOptional = (charArray) => {
if(charArray.length > 1) {
return [charArray[0], '(', ...recursiveOptional(charArray.slice(1)), ')', '?'];
}
return charArray;
};
module.exports = class JsonFieldExtractor extends Transform {
constructor(optio... | true |
77f8c3f2bde209cfd013fd08ade7a3a21c97a741 | JavaScript | openddd-com/Study | /FrontEnd/VUE/Example.2.Start/index.js | UTF-8 | 290 | 2.8125 | 3 | [
"MIT"
] | permissive | var obj = {
foo: 'bar'
}
Object.freeze(obj)
new Vue({
el: '#app',
data() {
return {
obj
}
}
})
new Vue({
data: {
a: 1
},
created: function () {
// `this` 指向 vm 实例
console.log('a is: ' + this.a)
}
}) | true |
fc60f900690c7e3c89838b8f8046736bddf9dd2e | JavaScript | dibyajyotiron/Dev-Social | /controllers/postController.js | UTF-8 | 1,795 | 2.5625 | 3 | [] | no_license | const { Post } = require("../models/post");
const { Comment } = require("../models/comment");
module.exports = {
async createOrUpdatePost(req, res) {
let post = res.locals.post;
if (!post) post = new Post();
post.text = req.body.text ? req.body.text : post.text;
await post.save(req);
return res.jso... | true |
9467c75503e6a4d064530956819e41fde7816b1e | JavaScript | emilia-m26/js-advanced-functions-introduction-to-map-and-reduce-lab-online-web-ft-100719 | /index.js | UTF-8 | 1,007 | 3.921875 | 4 | [
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Your code here
function mapToNegativize(array) {
let negative = []
array.forEach(element => {
negative.push(element - (element * 2))
});
return negative
}
function mapToNoChange(array) {
return array
}
function mapToDouble(array) {
let double = []
array.forEach(element => {
... | true |
4760ab550ae67e214be1f6ef7bdcb9cab9c27774 | JavaScript | josesebastiao/estacao-filmes | /src/scripts/services/details.js | UTF-8 | 1,775 | 3.265625 | 3 | [
"MIT"
] | permissive | const id = location.search.slice(4);
async function buscarGeneroFilme(){
fetch("https://api.themoviedb.org/3/genre/movie/list?api_key=54d5d6e26602b36d146edeb90b272ae5&language=pt-BR")
.then(function(response){
return response.json();
})
.then(function(genres){
const generos = genres.genres;
cons... | true |
bd0ac3f214e69c186a7e5bd66650636253363ce6 | JavaScript | nisrina02/Bootcamp-AnekaPay | /Minggu_1/H02/Kamus.js | UTF-8 | 1,103 | 2.6875 | 3 | [] | no_license | function Kamus(kata,katabaruindo,katabaruinggris,katahapus){
var kamus = new Map ([
["Mangga", "Manggo"],
["Pisang", "Banana"],
["Semangka", "Watermelon"],
["Anggur", "Grape"],
["Apel", "Apple"]
]
)
let sekarang = new Date();
console.log("Hari ini "+sekar... | true |
43c9b2a3264ea97e37a36c84af954a212573ee29 | JavaScript | zphobic/bushido | /pawn.js | UTF-8 | 901 | 2.90625 | 3 | [] | no_license | // ranges from 0 to 100
function slider(value) {
this.value = value || this.random();
}
slider.prototype.adjust = function(val) {
this.value = val;
if(this.value > 100) {
this.value = 100;
} else if(this.value < 0) {
this.value = 0;
}
}
slider.prototype.random = function() {
re... | true |
8f80aa100d8e1a04a47c5068d1afff66fb63765f | JavaScript | jpgunter/imessage-workshop | /IMessageWorkshopIndex.js | UTF-8 | 2,368 | 2.78125 | 3 | [] | no_license | (function () {
var COMFORTABLE_EMOTION_LIST = ["Accepted","Acknowledged","Amused","Appreciated","Attracted","Attractive","Calm","Capable","Caring","Competent","Confident","Connected","Considered","Content","Creative","Curious","Delighted","Empowered","Encouraged","Enthusiastic","Excited","Exhilarated","Grateful","H... | true |
2e4489d28a8cfd91a93bcfbac254dc8a148cfb0a | JavaScript | andrx/Craigslist-PhantomJS-Poster | /scripts/execute_task.js | UTF-8 | 8,348 | 2.640625 | 3 | [] | no_license | var _ = require('../libs/underscore'),
helpers = require('../libs/helpers'),
fs = require('fs'),
system = require('system'),
output = [],
task,
locIndex = 0,
pathIndex = 0;
if (system.args.length < 1) {
console.log('Missing OutputFile parameter!');
phantom.exit(1);
} else {
var tas... | true |
45870eedd33831fcb407103b98089a152f57b607 | JavaScript | Taina-conde/workforce-app | /api-server/employees.js | UTF-8 | 3,468 | 2.796875 | 3 | [] | no_license | const dataDefault = require("./data");
const clone = require("clone");
let dataBase = {};
function getData(token, dependencias = { db : dataBase }) {
const { db } = dependencias;
let data = db[token];
if (data == null) {
data = db[token] = clone(dataDefault);
}
return data;
}
function getAll(token, de... | true |
f19900c45262ded41eddb5287a4eefdfbe1e77f7 | JavaScript | AlexKomisarova/DirtDays_final-pr | /Personal info/PersonalPageJS.js | UTF-8 | 357 | 2.6875 | 3 | [] | no_license | $(document).ready(function() {
$("body").css("opacity", "1");
});
$(".btn").click(function() {
var text = $("#name").val();
var mail = $("#mail").val();
if (text === "" || mail === "") {
alert("We need this information");
} else {
localStorage.setItem("name", text);
localStor... | true |
f08df68f3b5dd24208cbecd675fa0647e2d00beb | JavaScript | muratkeremozcan/books | /JavaScript_Ninja/quokka_fake_path/instrumented/5.5_var_let_const_scopes/Listing5.7_var_scope.js | UTF-8 | 1,566 | 2.671875 | 3 | [
"MIT"
] | permissive | $_$wp(1);
var assert = ($_$w(1, 0), require('assert'));
var globalNinja = ($_$w(1, 1), 'Yoshi');
function reportActivity() {
$_$wf(1);
var functionActivity = ($_$w(1, 2), 'jumping');
for (var i = 1; $_$w(1, 3), i < 3; i++) {
var forMessage = ($_$w(1, 4), globalNinja + ' ' + functionActivity);
... | true |
91adcd703e24c44cc01ee2d92751a62d1cc8a49c | JavaScript | garysdevil/Location_backend | /routes/route.js | UTF-8 | 1,572 | 2.59375 | 3 | [] | no_license | const router = require('express').Router();
const { generateHunter, getHunter } = require('../service/hunterService');
const { addPrey, getPrey } = require('../service/preyService');
const getInfo = req => {
const ip = req.hostname;
const ua = req.headers['user-agent'];
const { path } = req;
return { i... | true |
2760797a346c1729df85124f96669bc3f09dc377 | JavaScript | DalitSchmidt/player | /routes/authors.js | UTF-8 | 6,714 | 2.59375 | 3 | [] | no_license | const router = require('express').Router()
const fs = require('fs')
const sql = require('./../sql')
router.route('/authors')
.post(( req, res ) => {
// The variable data include the body of the request
let data = req.body
// The variable data include the property name
let author = d... | true |
fd46b1fb793f17606e4f95d3c0577cec7b4d65c4 | JavaScript | lewismoten/solar-log | /charts/energy.js | UTF-8 | 1,618 | 2.796875 | 3 | [] | no_license | export {Chart};
function Chart(element) {
var chart;
var options = {
title: 'Total Daily Energy',
animation:{
duration: 1000,
easing: 'out'
},
width: "100%"
};
google.charts.load("current", {packages: ["corechart", "bar"]});
this.draw = draw;
/*
Daily Energy Consumed(k... | true |
b508e92f4e43d034aae6c526a556dbc886226e8a | JavaScript | kamilanagorska/aplikacje-mobilne-nagorska-185ic | /Laboratorium4/lab4/components/TextInp.js | UTF-8 | 3,141 | 2.78125 | 3 | [] | no_license | import React, { useState } from 'react';
import { View, Text, TextInput, ScrollView } from 'react-native';
import styles from './style'
export default function TextInp() {
const [text, setText] = useState('');
const [text2, setText2] = useState('');
const [email, setEmail] = useState('');
const [text3,... | true |
ec1df7f62b9d01a271ed795a8e2787fedae4583f | JavaScript | Digald/skiller-bot | /components/StatSummary.js | UTF-8 | 2,914 | 2.53125 | 3 | [] | no_license | import React from "react";
import { useSelector } from "react-redux";
import LinearProgress from "@material-ui/core/LinearProgress";
import { lighten, makeStyles, withStyles } from "@material-ui/core/styles";
import styled from "styled-components";
// -------------------------------------------------------------------... | true |
5ea9853aa386f41ea6b67f6ad07c6559597af00f | JavaScript | xxxrsxxx/react_boilerplate | /src/components/main/SortFilter.js | UTF-8 | 1,467 | 2.53125 | 3 | [] | no_license | import React, { useState } from "react";
import { setFilter, HookMainView } from "../../store/commerce/main";
const InterfaceFilter = [
{ id: 0, title: "전체", active: true, type: "all" },
{ id: 1, title: "일반 과일", active: false, type: "normal" },
{ id: 2, title: "과일", active: false, type: "prime" },
];
function So... | true |
b1f725079fb5b08e6048a958f28d88d1db497315 | JavaScript | supratimchatterjee/Ezayo-New | /ezayo/assets/js/theme-job-manager.js | UTF-8 | 9,720 | 2.53125 | 3 | [] | no_license | /** Post a Job : Job Function **/
jQuery(document).ready(function($) {
$('.trigger-mobile-filter').on('click', function(event) {
event.preventDefault();
$('body').toggleClass('open-filter');
});
$('.filter-top a').click(function(event) {
event.preventDefault();
$('body').removeClass('open-filter');
});
... | true |
2ca4fbe0dceee6288731a448a63faedc863721fc | JavaScript | jaromirpytela/EloquentJS | /8 Bugs and Errors/8 PRACTICE/2 📝 debugging.js | UTF-8 | 517 | 4.28125 | 4 | [] | no_license | /*
Convert a whole positive or negative number to a numeral system based on given base. The function numberToString repeatedly picks out the last digit and then divides the number. View the steps using debugger.
*/
function numberToString(n, base) {
let result = "", sign = "";
if (n < 0) {
n = -n;
... | true |
f8fa5bb5875446e5b52060467c1ae7322397a20d | JavaScript | HeLuchao/code | /Set/set.js | UTF-8 | 883 | 3.3125 | 3 | [] | no_license | /*
* @Author: heluchao
* @Date: 2021-01-20 17:27:24
* @LastEditTime: 2021-01-20 17:46:16
* @LastEditors: Please set LastEditors
* @Description: In User Settings Edit
* @FilePath: /code/Set/set.js
*/
let mySet = new Set();
mySet.add(1);
mySet.add(2);
mySet.add(3);
mySet.add(3);
mySet.add('test');
mySet.add({
... | true |
028763667a85d5b68ec5a1f7612d35986768dffd | JavaScript | rknmag/mdnlocallib | /controllers/genreController.js | UTF-8 | 5,227 | 2.546875 | 3 | [] | no_license |
const mongoose = require('mongoose');
const Genre = require('../models/genre');
const Book = require('../models/book');
const async = require('async');
const {body,validationResult} = require('express-validator/check');
const {sanitizeBody} = require('express-validator/filter');
exports.genre_list = function(req,res,... | true |
3b24112ab2b2ad80df7af13816180282e8b45b59 | JavaScript | Vailorium/AStar-Algorithm | /scripts.js | UTF-8 | 5,346 | 3.015625 | 3 | [] | no_license | var player = {x: 0, y: 0};
var target = {x: 8, y: 9};
var map = [];
$("document").ready(function(){
console.clear(); //? Clear for debugging on VSCode
generateMap();
});
let path = [];
function generateMap(){
$("#container").html('');
map = [];
var gridsize = {x: parseInt($("#gridsize").val()), y... | true |
7417ee1b472cc70789ea26f7b9dce5f55bf990f7 | JavaScript | ariel310/GRB_Backend | /Config/common.js | UTF-8 | 751 | 3.015625 | 3 | [] | no_license | exports.validateError = function(err, res, tipo, mensaje) {
if (err) {
return res.status(tipo).json({
ok: false,
mensaje: mensaje,
error: err
});
}
return true;
}
exports.responseOK = function(objeto, tipoObjeto, res, tipo, mensaje) {
return res.st... | true |
21d333022aa0e86040d9cde2030edf1330ad2f61 | JavaScript | chintamanil/calculator | /src/operations/binaryOperations.js | UTF-8 | 458 | 2.65625 | 3 | [] | no_license | (function() {
function binaryAnd(a, b) {
return Number(a) & Number(b);
}
function binaryOr(a, b) {
return Number(a) | Number(b);
}
function binaryXor(a, b) {
return Number(a) ^ Number(b);
}
function binaryNot(a) {
return !Number(a);
}
module.expor... | true |
8e50dafa82d9e721dfbe9f0c8f7c42affc9666f8 | JavaScript | lukabuz/ltracker | /functions/data.js | UTF-8 | 4,688 | 2.703125 | 3 | [] | no_license | // const admin = require("firebase-admin");
// let serviceAccount = require("../key.json");
// //initialize firebase db
// admin.initializeApp({
// credential: admin.credential.cert(serviceAccount),
// databaseURL: "https://ltracker-f226f.firebaseio.com/"
// });
module.exports = class DataInterface {
constructor(... | true |
c4a0ad29fc3544b516d2d5d7b0bf5c520943e183 | JavaScript | Manic1Nick/minfin-members | /test/index.js | UTF-8 | 5,788 | 2.96875 | 3 | [] | no_license | const array1 = [
{ username: 'AAA', date: '2018.10.26', vote: 0, message: 'message AAA' },
{ username: 'BBB', date: '2018.10.27', vote: 1, message: 'message BBB http' },
{ username: 'CCC', date: '2018.10.01', vote: 2, message: 'message CCC' },
{ username: 'DDD', date: '2018.10.20', vote: 3, message: 'message ... | true |
5354503531ad760e6e50c5b8abb0694d60476513 | JavaScript | BoxOfCereal/Sprint-Challenge-RDBMS | /routes/projects.js | UTF-8 | 1,795 | 2.625 | 3 | [] | no_license | const express = require("express");
const router = express.Router();
const db = require("../data/helpers/projectsHelpers.js");
const actionDb = require("../data/helpers/actionsHelpers.js");
router.get("/", (req, res) => {
db.getAll()
.then(projects => res.status(200).json(projects))
.catch(error =>
res.status(... | true |
1ee72696e70d26fe5df67c40a592e9924acc36dc | JavaScript | corocoto/node-chat | /app/js/connection.js | UTF-8 | 2,704 | 3.125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import Authorization from './auth.js';
import ColorPicker from './msg_color.js';
/**
* @class
* @description Class, that working with web sockets. And based on this, interact with page
*/
class Connection {
/**
* @constructor
* @description Init base elements necessary for work
*/
constructor () {
this.te... | true |
d7c77a00ec37a499db4c3ef524e9b137c5d1ae84 | JavaScript | shrishrimalshah-raj/realtime-nodejs-react-app | /src/client/components/BankNiftyChart.js | UTF-8 | 6,991 | 2.515625 | 3 | [] | no_license | import React from "react";
import Chart from "react-google-charts";
import { makeStyles } from "@material-ui/core/styles";
const returnBankNiftyFutureData = (data) => {
const tempData = [["timestamp", "openInterest", "underlyingValue"]];
data.forEach((item) => {
const { openInterest, underlyingValue, timestamp... | true |
5f10c4543772b4b72996aae428df6d136a10beca | JavaScript | charliefischer/gilded_rose_tech_test | /test/backstagePass.test.js | UTF-8 | 856 | 2.546875 | 3 | [] | no_license | const BackstagePass = require('../src/backstagePass')
describe('backstagePassUpdater', () => {
test('the quality goes up by 1 if sellIn is more than 10', () => {
let bp = new BackstagePass('Backstage passes', 25, 20)
bp.updateQuality()
expect(bp.quality).toEqual(21)
})
test('the quality goes up by ... | true |
2ac3adca3b95c13231f7e6a609dfc0671f57322d | JavaScript | zefirka/Warden.js | /test/src/specs/databus/combinig.js | UTF-8 | 4,803 | 2.921875 | 3 | [
"MIT"
] | permissive | describe('Combining methods ', function () {
it('-- merge', function (done) {
var cl = [];
var bus1 = Warden.Stream().map('One'),
bus2 = Warden.Stream().map('Two'),
merged = bus1.merge(bus2);
merged.listen(cl.push.bind(cl));
bus1.fire();
bus2.fire();
expect(cl).toEqual(['One', 'Two']);
m... | true |
c574c1f331e753ddecc7c6b62c651f70a6282569 | JavaScript | necholasg/modulo | /app/actions/auth_actions.js | UTF-8 | 2,365 | 2.515625 | 3 | [] | no_license | import axios from 'axios';
import cookie from 'react-cookie';
import { browserHistory } from 'react-router';
import {
AUTH_USER,
AUTH_ERROR,
UNAUTH_USER,
DASH_INFO,
LOAD,
UNLOAD
} from './types';
export function signinUser({ email, password }) {
return function (dispatch) {
//submit email/ password t... | true |
f96331f41aec02fefefca20300586cd64ab4ffc0 | JavaScript | defbobo/airw_functional_tests | /test/local_test.js | UTF-8 | 1,773 | 2.53125 | 3 | [] | no_license | import chai from 'chai';
import supertest from 'supertest';
import {
TARGET_URL,
VALID_LOCAL_PAYLOAD,
VALID_LOCAL_PAYLOAD_AU,
VALID_LOCAL_PAYLOAD_CN,
ACCOUNT_NAME,
ACCOUNT_NUMBER_US,
ACCOUNT_NUMBER_AU,
ACCOUNT_NUMBER_CN
} from './config';
const api = supertest(TARGET_URL);
const expect = chai.expect,
... | true |
87785ed288796aa0bdb21362309e213651f021d0 | JavaScript | DiamondDb/diamond-db | /src/Queue.js | UTF-8 | 1,549 | 2.578125 | 3 | [] | no_license | const operations = require('diamond-core').operations.external
const {
SAVE,
FETCH,
MAKE_TABLE,
FILTER
} = operations
class Q {
constructor(db){
this.db = db
this.stack = []
}
register(job, cb){
this.stack.push({ job, cb })
}
start(){
console.log('Queue is listening')
setInterval(... | true |
c933bf5c049df2752d2e7542c4d032b04e3a9556 | JavaScript | sebbekarlsson/fjb-samples | /jsx_custom/index.jsx | UTF-8 | 372 | 2.90625 | 3 | [] | no_license | function HeadTitle(title) {
return <h1>{title}</h1>;
}
function Text(text) {
return <p>{text}</p>;
}
function Section(title, text) {
return (
<section>
<HeadTitle title={title} />
<Text text={text} />
</section>
);
}
function App() {
return Section("Hello", "welcome to my website");
}
... | true |
607c9c6df4ed26d678fb5289fa34026a218bde79 | JavaScript | sk662516/SVNIT-Team6 | /Stock/team6/src/services/history.js | UTF-8 | 731 | 2.640625 | 3 | [] | no_license | export default async function updateHistory(company) {
if (company) {
const data = await fetch("http://localhost:8000/api/history-details");
const res = await data.json();
const result = res.info.map((search) => search.history);
if (!result.includes(company)) {
var formdata = new FormData();
... | true |
73ff1576924becf6267669dd3cba3c98c268b0b1 | JavaScript | LewisNozaki/JWT-project | /helpers/handleError.helper.js | UTF-8 | 789 | 2.765625 | 3 | [] | no_license | // Error handling and extracting from MongoDB validation
const handleErrors = (err) => {
let errorsMsgs = { email: "", password: "", login: "" };
// Incorrect email or password during login
if (err.message === "Incorrect email" || err.message === "Incorrect password") {
errorsMsgs.login = "The email/passwo... | true |
831ee5d5ea624136f8d58dab77cd7c17e36247b0 | JavaScript | leandroprado88/proyectojavaScript | /js/JSON/dom.js | UTF-8 | 362 | 3.0625 | 3 | [] | no_license | const pedidos = document.querySelector (`.oferta`);
const div_precio = document.createElement (`div`);
const compraTotal = document.createElement (`p`);
div_precio.appendChild(compraTotal);
pedidos.appendChild(div_precio);
const renderizarPrecioFinal = (precioFinal) => {
compraTotal.textContent = `El total de su... | true |
4fdab0aa0760f77fbba13cab3ac3a560417a80b9 | JavaScript | pandafw/repos | /static/1.2.0/panda/js/panda.js | UTF-8 | 89,084 | 3.5 | 4 | [] | no_license | if (typeof Array.prototype.indexOf != 'function') {
Array.prototype.indexOf = function(o) {
for (var i = 0; i < this.length; i++) {
if (this[i] === o) {
return i;
}
}
return -1;
}
}
if (typeof Array.prototype.contains != 'function') {
Array.prototype.contains = function(o) {
return this.indexOf(o)... | true |
a54beac630531aa091bcfb0862bd40ce260d4e47 | JavaScript | mycomosi/aeson | /test/es6/test.js | UTF-8 | 6,670 | 2.734375 | 3 | [] | no_license | /* eslint-env node, mocha */
/* global expect sinon*/
import Aeson from '../../src/aeson';
describe('Aeson', function () {
'use strict';
let theme, fakeFetchter;
before(function () {
theme = {
grid : {
color : 'black',
row : {
backgr... | true |
ad52729aaf882e42dfd9297749c14e6318b17fb9 | JavaScript | stefanotolomeo/video360-player | /src/logic/manager/AudioManager.js | UTF-8 | 659 | 2.625 | 3 | [] | no_license |
const AUDIO_BASE_PATH = "./assets/audio/"
// TODO: this does not work: audio must be applied to an object
// entitySource: null or ObjectID (the object which plays the sound)
function addAudio(resourceName, loop, volume, entitySourceId){
console.log("Setting Audio into scene")
// Create the Audio source ... | true |
b12b2dd4b0b21fbf025695f10943531401fd9530 | JavaScript | oldluo-ray/web1215 | /day03-node/05-http协议/index.js | UTF-8 | 631 | 2.5625 | 3 | [] | no_license | /**
*
*
* URI: 统一资源定位符
* URL: 统一资源定位器
* URL的组成: 协议://域名:端口号/路径?查询字符串#哈希值
*
*
* ip地址是网络中计算机的唯一标识符 xxx.xxx.xxx.xxx xxx的取值范围是0~255
* 192.168.x.x 局域网地址
* 127.0.0.1 本地回环地址 一定指向当前计算机
*
* 域名: ip地址是一串数字,不好记忆.所以使用域名,域名是有意义的字母组成更加方便记忆.
* localhost 表示当前计算机
*
* 端口号是计算机上正在执行的应用程序的唯一标识符,. 自定义的时候,一般都是使用3000之后的
*/
| true |
d72d03d34f88bfeb7b814374a039588a4e1efac6 | JavaScript | ollieSk8/nodeLesson | /7.path/1.path.js | UTF-8 | 600 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* Created by ollie on 16/10/15.
*/
var path=require('path');
//node 处理路径模块
//path.join
//创建a.js这样一个绝对路径 拼接路径
// var url=path.join(__dirname,'a.js');
// console.log(url);
// path.basename/path.extname
//console.log(path.basename('e.js','.js'));
//console.log(path.basename('jquery.min.js','.min.js'));
//console.l... | true |
006bb1d1a96d74194b25de57f58c79be25bfd1a2 | JavaScript | suhas1602/recipe-management-system-frontend | /src/components/Recipe.js | UTF-8 | 3,636 | 2.5625 | 3 | [] | no_license | import React, {useState, useEffect} from "react";
import { useParams, Link } from "react-router-dom";
import axios from "axios";
import { notification, Descriptions, Typography } from "antd";
const {Text, Title} = Typography;
const Recipe = () => {
const { id } = useParams();
const [recipe, setRecipe] = useS... | true |
778034abfc0839b064c68b411f097929a1293167 | JavaScript | oldFuryBird/CodeDailyLearning | /bubble_sort.js | UTF-8 | 885 | 3.75 | 4 | [] | no_license | var arr = [ 6,4,2,7,8,1,9,10];
isort(arr)
// ssort(arr)
// bbsort(arr)
console.log(arr)
function bbsort(arr){
for (let i = 0; i < arr.length; i++) {
for (let j = i; j < arr.length; j++) {
if(arr[j]<arr[i]&&j!=i){
let tmp = arr[j];
arr[j]=arr[i];
arr[i]=tmp;
... | true |
18269fb3b040f2f42d48e1dc05b0b1c140be7f8d | JavaScript | jhurliman/node-graph-suggestions | /graph-suggestions/minheap.js | UTF-8 | 3,517 | 3.578125 | 4 | [
"MIT"
] | permissive | module.exports = MinHeap;
/**
* Min heap implementation (aka priority queue).
* @param {Array} array Optional backing store for the heap.
* @param {Function} comparator(a, b) Optional compare function for heap sorting.
*/
function MinHeap(array, comparator) {
/**
* Storage for heap.
* @private
*/
thi... | true |
81e324fd4949e22092f0abb9e99bcee64ac4c341 | JavaScript | Mihyar-30614/rbk-toy-problems-1 | /allAnagrams/allAnagrams.js | UTF-8 | 941 | 4.25 | 4 | [] | no_license | /**
* Given a single input string, write a function that outputs an array of strings with every possible
* combination of letters.
*
* At first, don't worry about repeated (duplicate) strings.
*
* What time complexity is your solution?
*
* Extra credit: De-duplicate your return array without using uniq().
*/
... | true |
faf24779b0590299bcbc4a8c02edfef47e56f8cc | JavaScript | Matvey1971/goit-js-hw-06 | /js/task-08.js | UTF-8 | 661 | 3.15625 | 3 | [] | no_license | const formElement = document.getElementsByClassName("login-form")[0];
const inputEmail = formElement.elements[0];
const inputPass = formElement.elements[1];
formElement.addEventListener("submit", function (event) {
event.preventDefault();
const textEmail = inputEmail.value;
const textPassword = inputPass.value... | true |
03bff8dd03c1689ea148b5efc1bcf3a3a1c47164 | JavaScript | cwf62218865/yingjieseng | /addons/recruit/app/resource/js/date_list.js | UTF-8 | 3,986 | 2.5625 | 3 | [] | no_license | // 面试时间选择
var date=new Date();
var datatime=new Date();
var month=date.getMonth()+1;
var today=date.getDate();
var week=date.getDay();
var hour="";
var arr=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
$(".review_input").on("mousedown",function () {
$(".review_time").show();
$(".time_hour").click(function () {
... | true |
82fd48a2a6b9be55031486e4b031ee79af5308f9 | JavaScript | jshlch/react-jshlch-boilerplate | /src/redux/Login/reducer.js | UTF-8 | 650 | 2.515625 | 3 | [] | no_license | import {AUTH} from './constants'
const INITIAL_STATE = {
response: {},
meta: {
isLoading: false
}
}
const login = (state = INITIAL_STATE, action) => {
switch(action.type) {
case AUTH.LOGIN:
return {
...state,
meta: {
isLoading: true
}
}
case AUTH.LOGIN_SUCCESS:
return {
respon... | true |
78ade3fbb8e361675f2c9400decc6970efe8ecca | JavaScript | emiliano080591/pwa | /04-cache-offline/sw.js | UTF-8 | 3,827 | 3.03125 | 3 | [] | no_license | //const CACHE_NAME='cache-1';
const CACHE_STATIC='static-v2';
const CACHE_DYNAMIC='dynamic-v1';
const CACHE_INMUTABLE='inmutable-v1';
const CACHE_DYNAMIC_LIMIT=50;
function limpiarCache(cacheName,numeroItems) {
caches.open(cacheName)
.then(cache=>{
return cache.keys()
.then(key... | true |
8d5f8f6ffcd2ae6d48d44b8ff0f11a24ec06ad99 | JavaScript | RShuken/noteful-context-refactor-ryan | /src/App.js | UTF-8 | 3,977 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import { BrowserRouter, Route, Switch } from "react-router-dom";
import MainView from "./Components/Home/Home";
import Note from "./Components/Note/Note";
import Folder from "./Components/Folder/Folder";
import Header from "./Components/Header/Header";
import NotFound from "./C... | true |
457b57fcb168b8d8cf09741a747d17baa70fed6e | JavaScript | eternalsakura/DIE-corpus | /ChakraCore/es6/ProxySetPrototypeOf.js | UTF-8 | 858 | 2.609375 | 3 | [] | no_license | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//---------------------------------------------------------... | true |
e2c54b7ff2f5c0abfae4d0f64648e866bfdc8d3d | JavaScript | mordeecai/patient-app | /src/assets/scripts/index.js | UTF-8 | 1,526 | 2.59375 | 3 | [] | no_license | // Initialize Firebase
var config = {
apiKey: "AIzaSyBD_Kmw4hayXg0kI1jEZcm83A8vVCyi3NI",
authDomain: "patient-auth.firebaseapp.com",
databaseURL: "https://patient-auth.firebaseio.com",
projectId: "patient-auth",
storageBucket: "patient-auth.appspot.com",
messagingSenderId: "234710714862"
};
firebase.initializeApp... | true |
b942ceb07d358e2b0675dc6161e26e377a3913e1 | JavaScript | IvanMikheev/react-redux-login-form | /src/reducers/index.js | UTF-8 | 531 | 2.578125 | 3 | [] | no_license | import { LOG_IN, LOG_IN_FAIL } from '../actions/LoginAction'
const initialState = {
username: null,
errorMsg: '',
};
function rootReducer(state = initialState, action) {
switch (action.type) {
case LOG_IN:
return {
...state,
username: action.payload.username,
errorMsg: ... | true |
d95c544ff94eba667c945dc2e1c3ceac0f655c28 | JavaScript | yasuaki640/news-api-app | /frontend/src/App.js | UTF-8 | 3,008 | 2.578125 | 3 | [] | no_license | import './App.css';
import React, {useState} from 'react';
import Container from 'react-bootstrap/Container'
import {Articles} from './components/Articles';
import {SearchForm} from './components/SearchForm';
import axios from 'axios';
const endPoint = process.env.REACT_APP_BACKEND_ENDPOINT;
function App() {
cons... | true |
3ce26a90dc48eb976beda94766a36c131f8272bd | JavaScript | shawnbot/tap-map | /index.js | UTF-8 | 353 | 2.640625 | 3 | [
"MIT"
] | permissive | class TapMap extends Map {
constructor(...args) {
super(...args)
}
tap(key, value = TapMap.create) {
if (!this.has(key)) {
const actual = (typeof value === 'function') ? value() : value
this.set(key, actual)
return actual
}
return this.get(key)
}
}
TapMap.create = () => new T... | true |
063ffde59d96984a81daa6570069a8d73bc9f1d2 | JavaScript | alsuehrckwl/node_study | /1-basic/4-event-loop.js | UTF-8 | 1,035 | 3.375 | 3 | [] | no_license | // events 모듈 사용
var events = require('events');
// EventEmitter 객체 생성
var eventEmitter = new events.EventEmitter();
// // event와 EventHandler 를 연동(bind)
// // eventName 은 임의로 설정 가능
// eventEmitter.on('eventName', eventHandler);
// // 프로그램에서 이벤트를 발생시킬때
// eventEmitter.emit('eventName');
// EventHandler 함수 생성
var co... | true |
f84dd9c357f0ca6f1b25e8b7e762c377b763b95d | JavaScript | ggfer/react-demo | /redux-react-app/src/redux-original.js | UTF-8 | 806 | 2.796875 | 3 | [] | no_license | import React from 'react';
//这是redux的原始state
const tiger = 10000;
//这是action
const increase = {
type: '涨工资',
};
const decrease = {
type: '扣工资',
};
//这是reducer
const reducer = (state = tiger, action) => {
switch (action.type) {
case '涨工资':
return (state += 100);
case '扣工资':
return (state -= ... | true |
6c193563526931c1fb3e25230afe44fd2fe0b841 | JavaScript | supperdsj/ES6-Tutorial | /src/09-The Reflect API/87. Accessing Properties with Reflect.js | UTF-8 | 751 | 3.515625 | 4 | [] | no_license | /**
* Created by dongsj on 2016/12/27.
*/
class Person {
constructor(name, age) {
this._name = name;
this.age = age;
}
get name() {
console.log('getter');
return this._name;
}
set name(value) {
console.log('setter');
this._name = value;
}
}
le... | true |
6e4557a02d87325dec56d4fa8c48514a9476dcc0 | JavaScript | Donorhan/Lemon-JS | /src/Material/Material.js | UTF-8 | 3,200 | 3.109375 | 3 | [
"MIT"
] | permissive | import { Pass } from './Pass';
import Type from '../Types';
/**
* A material
*
* @category Material
*/
class Material {
/**
* Constructor
*/
constructor() {
/**
* Index of the technique to use
*
* @type {number}
* @private
*/
this.activ... | true |
33699ed351772ff0829df08bb94855c7ff98ede3 | JavaScript | redventures-oss/node-verdict | /src/contextproperty.js | UTF-8 | 4,009 | 3.125 | 3 | [] | no_license | var _ = require('underscore');
var comparisons = require('verdict/comparison');
exports = module.exports = ContextProperty;
/*
Example config:
new ContextProperty({
value: null,
/**
* List of excluded verdict.comparison objects
* Example: [
* verdict.comparison.equals,
* verdict.comparison.... | true |
f5e1fd3e95f57a314669cdebfe066342545a2806 | JavaScript | coconauts/coconauts-ci | /public/js/ci.js | UTF-8 | 3,370 | 2.71875 | 3 | [
"MIT"
] | permissive |
var projectTemplate, buildsTemplate ;
$(document).ready(function(){
projectTemplate = $('#project-template').html();
Mustache.parse(projectTemplate);
buildsTemplate = $('#builds-template').html();
Mustache.parse(buildsTemplate);
$("#new-save").click(saveProject);
loadProjects();
$("#toggle-new").clic... | true |
afdddd01cb3f6928901e4016dce79699528e6310 | JavaScript | larasnipp/Btest | /static/js/views/subtasklistView.js | UTF-8 | 1,842 | 2.53125 | 3 | [] | no_license | define([
'jquery',
'underscore',
'backbone',
'mustache',
'text!templates/subtasklist.html',
'views/subtaskitemView',
'collections/generalCollection',
], function($, _, Backbone , Mustache , homeT , subtaskitemView , generalCollection ){
var HomeView = Backbone.View.extend({
... | true |
0dde6de2afa7616b3e36e6ce07c0cb9e47240656 | JavaScript | baekarolina/9-arrow | /js/text.js | UTF-8 | 305 | 3.78125 | 4 | [] | no_license | // is duoto teksto gauti pirma raide
const firstLetter = text => text[0];
console.log(firstLetter('Labas'));
console.log(firstLetter('rytas'));
// skaiciu vidurkis sarase (a.k.a. pazymiu vidurkis)
const vidurkis = list => list.reduce((t, n) => t + n, 0) / list.length;
console.log(vidurkis([2, 8])); | true |
6fb893465e6af1e215c93791650f427753f476d1 | JavaScript | yangxin1994/farvekonfigurator | /color-modular/color211.js | UTF-8 | 119 | 2.53125 | 3 | [] | no_license | (function() {
// Make the color #211
HTMLElement.prototype.color211 = function() { this.style.color = '#211' }
})() | true |
0f6cabf0f253de6af364fcefd5c04d3d9976a896 | JavaScript | dut3062796s/ChakraCore | /test/es6/regex-symbols.js | UTF-8 | 13,262 | 2.734375 | 3 | [
"MIT"
] | permissive | //-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//---------------------------------------------------------... | true |
6b1dba2d686db74dd4db9aa35e13c10251c42314 | JavaScript | jaypajji4444/SmartIndiaHackathon-CareerGuidanceApp | /controllers/result.js | UTF-8 | 1,265 | 2.578125 | 3 | [] | no_license | const User=require("../models/user")
exports.resultString=async(req,res)=>{
try{
const {id,result}=req.body
const user=await User.findOne({_id:id})
user.result=result
user.save()
res.status(200).json({success:true,data:user})
}
catch(err){
res.status(401).json({success:fa... | true |
43265ecd2a4a39745cc1930869e12999e1609b89 | JavaScript | LimitlessSocks/EXU-Scrape | /credit.js | UTF-8 | 4,441 | 2.578125 | 3 | [] | no_license | let baseURL = "https://raw.githubusercontent.com/LimitlessSocks/EXU-Scrape/master/";
// baseURL = "./";
window.exuDatabase = baseURL + "db.json";
window.addEventListener("load", async function () {
await CardViewer.Database.initialReadAll(exuDatabase);
const per = document.getElementById("percent");
c... | true |
2af80baf1d023bd432b8f84c74dbba0ebacb3364 | JavaScript | Chank1e/viewer-with-act | /platform/core/src/redux/reducers/viewports.js | UTF-8 | 4,007 | 2.546875 | 3 | [
"MIT"
] | permissive | import cloneDeep from 'lodash.clonedeep';
import merge from 'lodash.merge';
import {
CLEAR_VIEWPORT,
SET_ACTIVE_SPECIFIC_DATA,
SET_SPECIFIC_DATA,
SET_VIEWPORT,
SET_VIEWPORT_ACTIVE,
SET_VIEWPORT_LAYOUT,
SET_VIEWPORT_LAYOUT_AND_DATA,
} from './../constants/ActionTypes.js';
const DEFAULT_STATE = {
numRow... | true |
2a4456312a55e67a6672c55230f997c9861f2edc | JavaScript | yungtiec/bkp | /client/components/WizardDocumentViewer/widgets/TitleWithInlineData.js | UTF-8 | 538 | 2.703125 | 3 | [
"MIT"
] | permissive | import React, { Component, Fragment } from "react";
/**
* takes in a title template
* schema creator can specify variables in template with %VARIABLE_NAME%
* %VARIABLE_NAME% will be replaced by real value after render
* for example, given the input:
* {
* title: 'transparency score: %transparencyScore%',
* ... | true |
fc1c487d068963b25ab9fac401773f9e6f10af0c | JavaScript | myunus-info/project-5 | /js/script.js | UTF-8 | 3,229 | 3.125 | 3 | [] | no_license | ///////////////////////////////////
////////// Recipe part
const loadRecipe = async (recipe) => {
try {
const res = await fetch(`https://www.themealdb.com/api/json/v1/1/filter.php?i=${recipe}`);
const data = await res.json();
data.meals.forEach(meal => renderRecipe(meal))
} catch (erro... | true |