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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
978130b8cc3323963bb7bcd50ca24148d4f14175 | JavaScript | vephome/jsonpath | /src/maybe.js | UTF-8 | 434 | 2.875 | 3 | [
"MIT"
] | permissive | export default maybe;
class Maybe {
constructor(v) {
this.value = v;
}
bind(f) {
return this.value != null ? f(this.value) : this;
}
chain(f) {
return this.map(f).bind(x => x);
}
map(f) {
return this.value != null ? maybe(f(this.value)) : this;
}
get() {
return this.value;
}
g... | true |
06cf848b5e5c56eacd0be5d15799a7cbc57d1d39 | JavaScript | gpgi-financing/mgf-mechanisms | /browsergame/static/datas/datas.js | UTF-8 | 3,236 | 2.734375 | 3 | [] | no_license | /*
gpgis is a structure that associate each GPGIs with a color
CDM: Clean Development Mechanism
CEPI: Coalition for Epidemic Preparedness Innovation
GFATBM: Global Fund for AIDS, TB and Malaria
FCPCF: Forest Carbon Partnerships Carbon Fund
ITER: International Thermonuclear Reactor
CPRF: Carbon Pricing Rew... | true |
2e56c600f003a9fa90d4ff4497d94c72e9d35a61 | JavaScript | wansuiasdn/learngit | /js/fdj.js | UTF-8 | 1,973 | 2.828125 | 3 | [] | no_license | class Ddj{
constructor(sel) {
this.sel = sel;
this.el = document.querySelector(this.sel)
this.mask = document.querySelector(this.sel + ' .mask')
this.big = document.querySelector(this.sel + ' .big')
this.bigImg = document.querySelector(this.sel + ' .big-img')
let that = th... | true |
50cf70ca5c8ad471357702356313bb9b1d5982a0 | JavaScript | NahidJHN/my-Blog | /public/scripts/likeDslikeFromAllPost.js | UTF-8 | 3,045 | 3.0625 | 3 | [] | no_license | window.onload = () => {
let likeBtn = document.getElementsByClassName("likePost");
let disLikeBtn = document.getElementsByClassName("dislikePost");
for (let i = 0; i < likeBtn.length; i++) {
let postId = likeBtn[i].dataset.postid;
likeBtn[i].addEventListener("click", (e) => {
... | true |
32ba285afc529584dd4a443cdce2089dfaf8462e | JavaScript | BFFPOC/reschedule-cancel-appointments | /controllers/reschedule.controller.js | UTF-8 | 1,911 | 2.625 | 3 | [] | no_license | const rp = require('request-promise');
var jwt = require('jsonwebtoken');
const rescheduleAppointment = (req, res, next) => {
if (checkingForValidParams(req)) {
var tokenkey = req.headers.authorization;
var token = GenarateToken(
tokenkey,
req.body.memberId);
console.log("Encrypted t... | true |
66af0583d34d8d0f48a05537831187e504677a7f | JavaScript | viharika-allam/USTGlobal-16Sep19-Viharika | /jsassignment/javascript/Functions/windows/dom/json/json.js | UTF-8 | 615 | 2.8125 | 3 | [] | no_license | const person = {
name : 'Viharika',
age : 22,
color : 'Black',
address :{
city : 'Guntur',
state: 'Ap',
pincode : 46644
},
hobbies :['Coding','Eating','Sleeping']
}
console.log('JavaScript person Object',person)
const jsonObject = JSON.stringify(person)
console.log('JSON ... | true |
10597517c4e45c9a504b11e806d6e0d5e90541f9 | JavaScript | Vintizer/react-challenge-sort-and-search | /js/components/ActiveUser.js | UTF-8 | 1,118 | 2.671875 | 3 | [] | no_license | // import React, {PropTypes, Component} from 'react'
//
// export default class ActiveUser extends Component {
// constructor(props) {
// super(props);
//
// }
//
//
// render() {
// let {name, age, image, phone, phrase} = this.props.active
// return (
// <p>{name + " " + age + " " + image + " " + phone + "... | true |
e9dd666d7c279b41915ee20e790cd4b163c9cbf5 | JavaScript | MrGuzior/hand-poker | /trash.js | UTF-8 | 4,640 | 2.859375 | 3 | [] | no_license | /*
function pickCards(i,x,part){
let playButton = document.querySelector(".button");
let card;
let cardNumber;
do{
cardNumber = Math.floor(Math.random()*Math.floor(52));
switch(cardNumber){
case 0:
card = "2 of Hearts";
break;
case 1:
card = "3 of Hearts";
break;
case 2:
c... | true |
464e138a64a04bfc4cc92af6b8ad71bea7b696e9 | JavaScript | baiest/estructura-datos-js | /doubleLinkedList.js | UTF-8 | 1,961 | 4.25 | 4 | [] | no_license | class Node {
constructor(value) {
this.value = value;
this.next = null;
this.prev = null;
}
}
class MyDoubleLinkedList {
constructor(value) {
this.head = {
value: value,
next: null,
prev: null
}
this.tail = this.head
... | true |
f2e0fec754626a1e529d70280461500f5b8d11be | JavaScript | 3nyTy/orIgIns | /Web_Project/WebContent/JS/RegistrationValidation.js | UTF-8 | 2,083 | 2.78125 | 3 | [] | no_license | function validateRegistrationForm() {
var result = true;
var name = document.getElementById("name").value;
if (name == "") {
result = false;
alert("Please Enter the Customert Name..!!\n");
}
pattern = /^[A-Z a-z]{0,50}$/;
if (!pattern.test(name)) {
result = false;
alert("Name should have o... | true |
9b408a3881b6c64b6319523f28628cc62ad0028e | JavaScript | medmouheb/Routing-with-Express- | /server.js | UTF-8 | 363 | 2.53125 | 3 | [] | no_license | const express = require('express')
const app=express()
var d =new Date
if(d.getHours<8 || d.getHours>17)
{
app.get('/*/',(req,res)=>{
res.send('we are closed now')
})
}
else app.use(express.static(__dirname))
app.listen(3000,(e)=>{
if(e) console.error("server down")
else consol... | true |
9c06c4eede0724ae14b8799a667c0cbbd9a1fb51 | JavaScript | rajatc/rajatc.github.io | /js/search.js | UTF-8 | 6,029 | 2.8125 | 3 | [] | no_license | var FBsearch = function (){
var dom_data = document.getElementById('search').value;
/*code for interacting fb api and fetching required data JSONP */
var headTag = document.getElementsByTagName('HEAD').item(0);
var scriptTag= document.createElement("script");
scriptTag.type = "text/javascript";
/*fa... | true |
fd9f164e1229ec1999779365b02bc554cd626178 | JavaScript | meghraj2056/Analogclock | /javascript/index.js | UTF-8 | 550 | 3.671875 | 4 | [] | no_license | let hourHand = document.querySelector(".hour");
let minHand = document.querySelector(".min");
let secHand = document.querySelector(".sec");
setInterval(() => {
let date = new Date();
let hours = date.getHours();
let min = date.getMinutes();
let sec = date.getSeconds();
let hrotation = 30 * hours + min / 2;
... | true |
a11b0c85fb529f485ba8135687acabe86a05998f | JavaScript | zhouxiongking/mianshiting | /WebContent/scripts/index.js | UTF-8 | 6,812 | 2.65625 | 3 | [] | no_license | $(function(){
// 初次加载页面,加载文章,判断是主页还是分类页
initPage();
// 查看更多
bindGetMore();
// 播放视频
videoPlay();
// 关闭视频div
closeVideo();
});
/**
* 关闭视频div
*/
function closeVideo() {
$('.shield_down_div').click(function() {
$('.video-play').hide();
$('.shield_down_div').hide();
});
}
/**
* 点击播放视频
*/
function... | true |
2a2c89d6be1944b1315ef657c8f243417c86b481 | JavaScript | LINKIWI/orion-web | /src/app/react/components/control-panel/filters.js | UTF-8 | 1,572 | 2.59375 | 3 | [
"MIT"
] | permissive | import React from 'react';
import PropTypes from 'prop-types';
import { Spacing, Text } from 'react-elemental';
import Slider from 'app/react/components/ui/slider';
// Function to format the numerical values displayed in the slider for display.
const formatAccuracyValue = (val) => `${val.toFixed(1)} m`;
/**
* Contro... | true |
eba43094458a75dd10e8ceb6996f5cddf1e20b8a | JavaScript | buwantaiji/web_frontend | /move/move.js | UTF-8 | 890 | 3.3125 | 3 | [] | no_license | var box = document.getElementById("box");
var container = document.getElementById("container");
box.onclick = function() {
window.setInterval(move, 10);
}
var direction = "right";
var position = Number(box.style.left.slice(0, -2));
var box_width = Number(box.style.width.slice(0, -2));
var container_width = Number(c... | true |
6b1ef77c2426534230b1065f7b24c3a775b2a56a | JavaScript | MorenoMdz/algo_training | /Tests1/day7_arrays.js | UTF-8 | 185 | 3.25 | 3 | [] | no_license | function solution(A) {
let reverse = '';
for (let i = 1; i <= A.length; i++) {
reverse = reverse + A[A.length - i] + ' ';
}
console.log(reverse);
}
solution([1, 2, 3, 4]);
| true |
999804ee943fa7cfc235d3046b3fafb83297ff1e | JavaScript | AnonyMouse97/forestryMayhem | /src/client/components/Map/popup.js | UTF-8 | 2,739 | 2.53125 | 3 | [] | no_license | import React, { useState } from 'react'
import { Popup } from 'react-leaflet'
import axios from 'axios'
const CustomPopup = ({ id }) => {
const [isLoaded, setIsLoaded] = useState(false)
const [species, setSpecies] = useState("")
const [name, setName] = useState("")
const [wikiLink, setWikiLink] = useSt... | true |
dd6fed9025d292c31d4cd700e5ee6b3881aecd56 | JavaScript | henarivanaa/h8-p0-w3 | /exercise-6.js | UTF-8 | 844 | 3.96875 | 4 | [] | no_license | const angkaPalindrome = num => {
// do {
// num++
// var strNumBalik = ''
// var strNum = num.toString()
// for(let i = strNum.length; i>0; i--) {
// strNumBalik += strNum.substring(i-1,i);
// }
// } while (strNum !== strNumBalik);
... | true |
c9683b9933bda170ab35be7cd503f6a43e967852 | JavaScript | NinaHahne/imageboard-sloths | /public/js/script_example.js | UTF-8 | 1,426 | 2.921875 | 3 | [] | no_license | (function() {
new Vue({
el: '#main',
data: {
heading: 'I need sleep',
greetee: 'Mr. Sloth',
className: 'tired',
url: 'https://www.sleepfoundation.org/articles/what-happens-when-you-sleep',
candy: [
{name: 'maltesers'},
... | true |
ad34ef5bebf6ea81b9ca892d1cf536c3c1c58a46 | JavaScript | jkomban/js-learning | /advanced-js/test.js | UTF-8 | 990 | 3.921875 | 4 | [] | no_license | 'use strict'
var greet = function (harCoded, ...replacement) {
return harCoded.join(' ') + replacement.join(' ') + '! Good Morning!'
}
var name = 'John';
var lastname = 'Komban'
var greetings = greet`Hello ${name}${lastname}`
console.log("greetings :", greetings)
class Animal {
makeSound() {
consol... | true |
f0fb84a40e4875fedd21b40d4a2491f2081c2729 | JavaScript | RobertoFoglia/Learning | /Electron/ipc-example/renderer.js | UTF-8 | 1,373 | 3.09375 | 3 | [
"LicenseRef-scancode-public-domain",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // This file is required by the index.html file and will
// be executed in the renderer process for that window.
// All of the Node.js APIs are available in this process.
const ipc = require("electron").ipcRenderer;
// *************************
// SYNCHRONOUS MESSAGGING
// *************************
const syncMsgBtn = ... | true |
6cc69e906de39e5b1b9a7b580ba5c55965607b42 | JavaScript | fkhalili/wdi | /w04/d04/Classwork/ready/create.js | UTF-8 | 495 | 2.90625 | 3 | [] | no_license | var ejs = require("ejs");
var random = [
{
id:1,
name:"ruffus",
color:"pink"
},
{
id:2,
name:"clifford",
color:"red"
},
{
id:3,
name:"garfield",
color:"orange"
}
];
var puppyTemplate = "<h3><%= puppy.name %></h3>" +
"<p><%= puppy.color %></p>";
var puppiesTemplate = "<% puppies.forEach(... | true |
e84ab53059caf75021f24c25e6cb802335475077 | JavaScript | Stefano-Bodritti/js-jsnacks-blocco-1 | /snack2-4/js/scripts.js | UTF-8 | 517 | 3.875 | 4 | [] | no_license | // Crea un array di numeri interi e fai la somma di tutti gli
// elementi che sono in posizione dispari
do {
var posizioni = parseInt(prompt("Quanti numeri vuoi inserire?"));
} while (isNaN(posizioni));
var numeri = [];
for (var i = 1; i <= posizioni; i++) {
do {
var numero = parseInt(prompt("Inseri... | true |
5a9260df1af3479d1e900ac4ee7c66259873c4e0 | JavaScript | masamo/WebWorks-API-Docs | /api/html5_video.js | UTF-8 | 5,097 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2010-2011 Research In Motion Limited.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... | true |
e949d3dd2e46573a768157fa1105c535e11aadcc | JavaScript | cristiankit/VinhSonNguyen-AfterEffects-ExtendScript-Extensions | /colorPicker.jsx | UTF-8 | 419 | 3.078125 | 3 | [] | no_license | // Initiates color picker, returns RGB array
function colorPicker(){
var initialRGB = [1,1,1];
var colorInt = 255 * (65536 * initialRGB[0] + 256 * initialRGB[1] + initialRGB[2]);
var c = $.colorPicker(colorInt);
if (c == -1) return;
var r = ((c >> 16) & 0xFF) ;
var g = ... | true |
f5ee453d999567bd3560a723757ec1543a5343b9 | JavaScript | rachelrohrbach/code-quiz | /questions.js | UTF-8 | 1,058 | 3.015625 | 3 | [
"MIT"
] | permissive | var questions = [
{
question: 'JQuery is a ___ Library.',
answers: ['1. JavaScript', '2. HTML', '3. Java', '4. CSS'],
correctAnswer: '1. JavaScript'
},
{
question: 'Arrays in JavaScript can be used to store _____.',
answers: ['1. other arrays', '2. booleans', '3. numb... | true |
6fd9343d3373ebe53d18b5a842bdb692fa9973e0 | JavaScript | clarelantoine/floema | /app/classes/Animation.js | UTF-8 | 637 | 2.515625 | 3 | [] | no_license | import Component from './Component'
export default class Animation extends Component {
constructor ({ element, elements }) {
super({
element,
elements
})
this.element = element
this.createObserver()
this.animateOut()
}
createObserver () {
this.oberserver = new window.Inters... | true |
6ebaf0948c29bde42d6b7d23fa1ecf443292aaf5 | JavaScript | codecrook/PigGame | /js/app.js | UTF-8 | 5,901 | 3.5625 | 4 | [] | no_license | (function () {
'use strict';
const rollButton = document.querySelector('.btn-roll');
const holdButton = document.querySelector('.btn-hold');
const newGameButton = document.querySelector('.btn-new');
const firstPlayerPanel = document.querySelector('.player-0-panel');
const secondPlayerPanel = d... | true |
8aa74d97e4d24c7f8b1bd57de79dfb42a09f2811 | JavaScript | yashtawade/samplewebartcatalogue | /project1/weather.js | UTF-8 | 5,212 | 3.453125 | 3 | [] | no_license | // Put your Last.fm API key here
/*var api_key = "c111bc67961ebb0cf5453a76f13bcac6";
function sendRequest () {
var xhr = new XMLHttpRequest();
var method = "artist.getinfo";
var artist = encodeURI(document.getElementById("form-input").value);
xhr.open("GET", "proxy.php?method="+method+"&artist="+artist... | true |
fc0bfc42cc81237377fedd1e64929f1abed697ed | JavaScript | Jbmouterde/Petite-tete | /js/projet3.js | UTF-8 | 9,908 | 3.171875 | 3 | [] | no_license | // Button
$("body > header > button").click(function(){
window.location.href = "index1.html"
// $("body > div.instructions.cache1").slideToggle(1500);
});
// $("body > div.instructions.cache1 > button.btn-default.btn-lg.posititonBtn").click(function(){
// console.log ("o")
// // $("body > div.border.cache2").s... | true |
da97a7ca82f9a9c831213c63211951b7e79643d9 | JavaScript | IdeaEcho/koa2-middle-boilerplate | /server/middlewares/request/apiRedirect.js | UTF-8 | 597 | 2.515625 | 3 | [] | no_license | /**
* api转发工具修改:
* request.Get()参数改动,做相应改动
*/
const request = require('./syncRequest');
const sign = '/api';
module.exports = async (ctx, next) => {
let href = ctx.url;
let isPost = ctx.request.method === 'POST';
if (href.indexOf(sign) < 0) {
await next();
} else {
let url = href.spli... | true |
07f40492125fe981ad94321a16dcafea20b5ada0 | JavaScript | angelpuerta/javascriptSEV | /src/modelos/Explosion.js | UTF-8 | 1,107 | 2.546875 | 3 | [] | no_license | class Explosion extends Modelo {
constructor(x, y) {
super(imagenes.icono_explosion, x, y)
this.aExplotar= new Animacion(imagenes.explosion,this.ancho,this.alto,6,12,this.finAnimacionExplsion.bind(this));
this.estado=estados.explotando;
}
actualizar (){
// Actualizar anim... | true |
adb7dc7599a571e786fc50654d59f216a02e112a | JavaScript | williamss7435/gobaber | /gobaberMobile/src/store/modules/auth/reducer.js | UTF-8 | 868 | 2.671875 | 3 | [] | no_license | const INITIAL_STATE = {
token: null,
signed: false,
loading: false,
};
export default function auth(state = INITIAL_STATE, action) {
switch (action.type) {
case '@auth/SIGN_IN_REQUEST':
state.loading = true;
return {
...state,
};
case '... | true |
b4b0df3e2e73dcf3d9b893819321700ba5da4a5d | JavaScript | mateuscostaluz/webmoderno | /03_fundamentos/numeros.js | UTF-8 | 488 | 4 | 4 | [] | no_license | const peso1 = 1.0
const peso2 = Number(2.0)
console.log(peso1, peso2)
console.log(Number.isInteger(peso1))
console.log(Number.isInteger(peso2))
const avaliacao1 = 9.871
const avaliacao2 = 6.871
const total = avaliacao1 * peso1 + avaliacao2 * 2
const media = total / (peso1 + peso2)
console.log(media.toFixed(2))
cons... | true |
5acfdd693ac0e6ebd5b5218a2082e794859f5fb4 | JavaScript | asiulijka/travel-agency | /src/components/features/DaysToSummer/DaysToSummer.test.js | UTF-8 | 2,296 | 2.875 | 3 | [] | no_license | import React from 'react';
import {shallow} from 'enzyme';
import DaysToSummer from './DaysToSummer';
const select = {
description: '.description',
};
describe('Component DaysToSummer', () => {
it('should render without crashing', () => {
const component = shallow(<DaysToSummer />);
expect(... | true |
de5953eefc0d3b792e4c500e74f9c49e9a850d8d | JavaScript | Curtislike/basic-js | /src/extended-repeater.js | UTF-8 | 1,472 | 3.40625 | 3 | [
"MIT"
] | permissive | import { NotImplementedError } from "../extensions/index.js";
/**
* Create a repeating string based on the given parameters
*
* @param {String} str string to repeat
* @param {Object} options options object
* @return {String} repeating string
*
*
* @example
*
* repeater('STRING', { repeatTimes: 3, separator: ... | true |
f8c267dc795d86d4e7cfad8422f90860bdbbb543 | JavaScript | nazarja/fullstackopen | /fullstackopen-part-0-2/course/part5d/src/App.js | UTF-8 | 1,470 | 3.09375 | 3 | [] | no_license | import React, { useState } from 'react';
const useField = (type) => {
const [value, setValue] = useState('');
const onChange = (event) => setValue(event.target.value);
return {
type, value, onChange
}
};
const App = () => {
const name = useField('text');
const [born, setBorn] = useState('')
const [height, ... | true |
15c280bf54942c99d90293099e1300131be12b8f | JavaScript | cicada1993/epubparser | /js_project/client/src/epubfile/request/BookRequest.js | UTF-8 | 560 | 2.515625 | 3 | [] | no_license | export default class BookRequest {
bookKey
bookUrl
zipped
backUrl
constructor(props) {
this.bookKey = props && props.bookKey
this.bookUrl = props && props.bookUrl
this.zipped = props && props.zipped
this.backUrl = props && props.backUrl
}
isSame(other) {
... | true |
1142c7ab726c43f8e3f7f830d74c1d750e683991 | JavaScript | infoshareacademy/jfddl8-harmony-app | /src/services/databaseService.js | UTF-8 | 948 | 2.53125 | 3 | [] | no_license | import { mapObjectToArray } from './mapObjectToArray'
const URL = 'https://jfddl8-harmonylublin.firebaseio.com/recipes'
export const deleteRecipe = (recipeKey) => {
return fetch(
URL + '/' + recipeKey + '.json',
{
method: 'DELETE'
}
)
}
export const addRecipeToFireBase = (newRecipe) => {
ret... | true |
c5e79edec635f159d27e8eda3d20da94d22bd5e1 | JavaScript | nicksantan/fundial | /src/js/matter_useful.js | UTF-8 | 3,263 | 2.921875 | 3 | [
"MIT"
] | permissive |
//_________________________________________________________________world
Matter.World
Matter.World.addBody(world, body) → World
// create two boxes and a ground
var engine = Engine.create(document.body);
var boxA = Bodies.rectangle(400, 200, 80, 80);
var boxB = Bodies.rectangle(450, 50, 80, 80);
var ground = Bodies.re... | true |
7efb74953db231060a57df362302baef683fb7cb | JavaScript | jmthompson2015/financedashboard | /src/component/SymbolsUI.js | UTF-8 | 1,861 | 2.890625 | 3 | [
"MIT"
] | permissive | class SymbolsUI extends React.Component
{
constructor(props)
{
super(props);
const initialSymbolString = (this.props.initialSymbolString ? this.props.initialSymbolString : "AAPL,AMZN,INTC,KO,T,VEIRX,VSMGX,VSGAX");
this.state = {
symbolString: initialSymbolString
};
}
rend... | true |
178075ea46dbd76279dd6051c880ab5a0a61d428 | JavaScript | lisamc19/Flashcard-Generator | /clozeCard.js | UTF-8 | 909 | 3.65625 | 4 | [] | no_license |
var clozeCard = function(fulltext,cloze){
this.fulltext = fulltext,
this.cloze = cloze,
this.replace = function(){
// here you want to return underscores where is the closure
var temp = this.fulltext.split(' ');
temp.forEach(function(element,index) {
... | true |
f0ec811c1d6e335d0482fdecd694b55ebe6f8312 | JavaScript | Financial-Times/x-dash | /components/x-interaction/src/Hydrate.jsx | UTF-8 | 3,006 | 2.546875 | 3 | [] | no_license | import { h, render, Component } from '@financial-times/x-engine'
import { getComponentByName } from './concerns/register-component'
export class HydrationWrapper extends Component {
render() {
const { Component, props, id } = this.props
return <Component {...props} id={id} actionsRef={(a) => (this.actions = a)} /... | true |
300ee26b236770a4457462669bd91a85917648ff | JavaScript | life-rs/AI-mod | /src/response/dynamic/singleplayer.settings.bot.difficulty.js | UTF-8 | 1,098 | 2.546875 | 3 | [
"MIT"
] | permissive | exports.execute = (url, info, sessionID) => {
let splittedUrl = url.split('/');
let type = splittedUrl[splittedUrl.length - 2].toLowerCase();
let difficulty = splittedUrl[splittedUrl.length - 1];
if (type === "core") {
return fileIO.read(db.cacheBase.botCore);
}
if (type === "cursedassaul... | true |
c3e2ca0e0ff7cd9259209591782f2929008b8cdb | JavaScript | rajumab/cefalocricketfantasy | /server/routes/apisquad.js | UTF-8 | 1,117 | 2.703125 | 3 | [] | no_license | const express = require('express');
const router = express.Router();
var Squad = require('../models/squad');
router.post('/create', (req, res) => {
// get squad with ID of 1
Squad.find({squadId:1}, function(err, squad) {
if (err) throw err;
var newSquad;
if(squad.length > 0){
// cr... | true |
859f62b42e8ca445ac39095821274d9ab896fe30 | JavaScript | LABELNET/webpack-examples | /example6/example6-2.js | UTF-8 | 148 | 2.625 | 3 | [] | no_license | /**
* Created by yuan on 2/22/2017.
*/
export function area(x, y) {
return x * y;
}
export function ference(x, y) {
return (x + y) * 2;
} | true |
226d32221254779d6f3d27c0500c86a4f40abb61 | JavaScript | jzhang113/soundspeech | /scripts/inner.js | UTF-8 | 441 | 2.75 | 3 | [] | no_license | var $container;
$(document).ready(function() {
$container = $(".outer");
recalc();
$(window).resize(recalc);
});
function recalc() {
var windowH = $(window).height();
var containerH = $container.height();
if (windowH > containerH) {
var margin = (windowH - containerH) / 2;
$container... | true |
d74645d91658234d4e01bc526257deb243ea92b0 | JavaScript | pernicious-pecans/NutShell | /src/scripts/news/newsPrintToDom.js | UTF-8 | 652 | 2.71875 | 3 | [] | no_license | import newsFactory from "./newsHTML"
const $ = document.querySelector.bind(document)
const newsGetAndShow = () => {
return fetch("http://localhost:8088/news")
.then(response => response.json())
.then(myParsedNews => {
myParsedNews.forEach(news => {
const newsName = news.... | true |
7bf8eb74b485a8f33dd848f0b18049ea717daa7c | JavaScript | NightHack36/codekaksha_web | /public/js/chat.js | UTF-8 | 1,225 | 3.328125 | 3 | [] | no_license | var socket=io()
const chatBody = document.querySelector('.chat-body');
const chatForm=document.getElementById('chat-form');
// MESSAGE FROM SERVER
socket.on('message',(message)=>{
console.log(message);
outputMessage(message);
// M.toast({html:'You have new messages' , classes:'rounded' , displayLength:300... | true |
46a1186a89fe65babb2a6ec47fde360d8b6303fa | JavaScript | AButrym/FL-13 | /FL13_HW8/homework/js/positiveSum.js | UTF-8 | 184 | 3.1875 | 3 | [] | no_license | const positiveSum = arr => arr.filter(x => x > 0).reduce((total, x) => total + x, 0);
console.log(positiveSum([2, 4, 6, 8]) === 20);
console.log(positiveSum([0, -3, 5, 7]) === 12); | true |
24378bb3c58f7203f46739836c8774dd746f36f8 | JavaScript | DanielMcVeigh/InitiativeTracker | /src/js/components/Form.jsx | UTF-8 | 2,444 | 2.671875 | 3 | [] | no_license | import React, { Component } from "react";
import { connect } from "react-redux";
import { addPlayer, sortPlayers, nextTurn } from "../actions/index.js";
import store from "../store/index.js";
function mapDispatchToProps(dispatch) {
return {
addPlayer: arr => dispatch(addPlayer(arr))
};
}
class Connect... | true |
9065538bffec45b4bd9aa629f84d279f70ace692 | JavaScript | mooncake-dev/lambda-body-parser | /src/index.test.js | UTF-8 | 754 | 2.828125 | 3 | [
"MIT"
] | permissive | 'use strict';
const bodyParser = require('./');
const INVALID = '{ "hello: , }';
const VALID = '{ "hello": "world" }';
describe('bodyParser.json(body)', () => {
test('throws with no JSON', () => {
expect(() => {
bodyParser.json();
}).toThrow(/^Request body must be valid JSON$/);
});
test('throws... | true |
7d42278df7a4d00dcaa48224c763ff5b5a9f3fd6 | JavaScript | Oznaprazzi/Plevent-Server | /services/verification.js | UTF-8 | 274 | 2.8125 | 3 | [] | no_license | /**
* Checks all keys inside the data and returns false if one of the fields is missing.
*
* @param {*} data
*/
exports.verify = (data) => {
for(let param of Object.keys(data)){
if(!data[param]){
return false;
}
}
return true;
} | true |
67810880793b0b193093cf2d0fec897d3db50ffb | JavaScript | yilinjuang/Octomender | /website/app/static/js/octo.js | UTF-8 | 8,298 | 2.796875 | 3 | [
"MIT"
] | permissive | /* Helper functions. */
let getAjax = (url, success) => {
let xhr = new XMLHttpRequest();
xhr.open('GET', url);
xhr.onload = () => {
if (xhr.status === 200) {
try {
let json = JSON.parse(xhr.responseText);
success(json);
} catch (err) {
... | true |
c555a31bcd75890c04cd9abca0fc2dc6cef4166f | JavaScript | Lol-Whut/technicals | /constructBst.js | UTF-8 | 1,609 | 4.09375 | 4 | [] | no_license | // Given preorder and inorder traversal of a tree, construct the binary tree.
// Note:
// You may assume that duplicates do not exist in the tree.
// For example, given
// preorder = [3,9,20,15,7]
// inorder = [9,3,15,20,7]
// Return the following binary tree:
// 3
// / \
// 9 20
// / \
// 15 7
... | true |
59468e96d550dae808ec65a58ccce80a73ebaa69 | JavaScript | alejandro-ser/react-intro-javascript | /src/bases/08-import-export.js | UTF-8 | 387 | 2.640625 | 3 | [] | no_license | // Imports, Exports
//import heroes, { owners } from '../data/heroes';
import heroes from '../data/heroes'
//console.log(owners);
export const getHeroeById = (id) => heroes.find( ( heroe ) => heroe.id === id );
//console.log( getHeroeById(2) );
export const getHeroeByOwner = ( owner ) => heroes.filter( ( heroe ) =... | true |
c637cb82f6bec0cb501b5eb2741aaf27debffa14 | JavaScript | rguan72/basic-flask-app | /static/viewFunctions.js | UTF-8 | 1,058 | 2.9375 | 3 | [] | no_license | function sendBackend() {
let content = document.getElementById('val').value;
let data = {
'content': content
};
let req = {
method: "POST",
mode: "cors",
cache: "no-cache",
credentials: "same-origin",
headers: {
"Content-Type": "application/json",
},
redirect: "follow",
... | true |
67874e9a79af0729979f52d971a04a3080cbc382 | JavaScript | bhosaleT/javaScript-algo-ds | /frequencyCounter.js | UTF-8 | 2,119 | 4.59375 | 5 | [] | no_license | // Frequency Counter problem.
// we use an object to store values and keep track of their frequencies.
// this is useful in challenges where we compare pieces of data.
/* QUESTION : Write a function called SAME which should return true after taking in two arrays and if every value from array 1 is squared and present i... | true |
4f3051d673da9f965aa77b3cb5a408e4f401b5ef | JavaScript | darioduarte/Buscador-y-filtro-pagina-web | /routes/index.js | UTF-8 | 2,250 | 2.890625 | 3 | [] | no_license | var express = require('express');
var router = express.Router();
var path = require('path');
const fs = require('fs');
/* GET home page. */
router.post('/realState', function(req, res, next) {
let custom = req.body;
let route = path.join(__dirname,'../data/data.json');
let minimo = parseInt(custom.precio.split('... | true |
290faacf61d5d218d9552c262c06b2fe4d151038 | JavaScript | manasichaudhari/CS5610-Summer2017-WebDev-Manasi | /public/assignments/assignment5/views/website/controllers/website-new.controller.client.js | UTF-8 | 1,203 | 2.578125 | 3 | [] | no_license | (function(){
angular.module('WebAppMaker')
.controller('NewWebsiteController',newWebsiteController);
function newWebsiteController($routeParams,$location,WebsiteService) {
var model = this;
model.uid = $routeParams['uid'];
model.createWebsite = createWebsite;
function... | true |
0fb677fe85472cfc9f45ae41b8c40c0bb2932a95 | JavaScript | cs-education/classTranscribe | /public/javascripts/libraries/wavesurfer/example/playlist/app.js | UTF-8 | 2,014 | 2.96875 | 3 | [
"MIT",
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | // Create a WaveSurfer instance
var wavesurfer = Object.create(WaveSurfer);
// Init on DOM ready
document.addEventListener('DOMContentLoaded', function () {
wavesurfer.init({
container: '#waveform',
waveColor: '#428bca',
progressColor: '#31708f',
height: 35
});
});
// Play on... | true |
540855acd6b0370c0ac31e20a933f5c23caf0542 | JavaScript | xCrypt0r/Baekjoon | /src/1/1975.js | UTF-8 | 690 | 3.0625 | 3 | [
"MIT"
] | permissive | /**
* 1975. Number Game
*
* 작성자: xCrypt0r
* 언어: node.js
* 사용 메모리: 25,672 KB
* 소요 시간: 540 ms
* 해결 날짜: 2020년 12월 5일
*/
const fs = require('fs');
function main() {
let input = fs.readFileSync('/dev/stdin').toString().trim().split('\n'),
output = '';
let T = +input.shift();
for (let i = 0; i... | true |
299a59b243fe66188c75db1cb33593079505bc7a | JavaScript | kpolgar/leet-code | /problem-0747-largest-number-at-least-twice-of-others.js | UTF-8 | 2,584 | 4.53125 | 5 | [] | no_license | /*747. Largest Number At Least Twice of Others
In a given integer array nums, there is always exactly one largest element.
Find whether the largest element in the array is at least twice as much as every other number in the array.
If it is, return the index of the largest element, otherwise return -1.
Example 1:
In... | true |
1c6eea82486b611aee2ffa0a711dc14d88ba7600 | JavaScript | cmarkle27/nodewiki | /public/js/article-list.js | UTF-8 | 954 | 2.53125 | 3 | [] | no_license | var ArticleList = Backbone.Collection.extend({
initialize: function() {
this.display();
},
model: Article,
url: "/articles",
display: function() {
this.fetch({
success: function(coll, resp) {
var articlesListView = new ArticlesListView({
collection: coll
});
}
});
},
getLast: functi... | true |
440e25eaf31f06307bd9749421d491dfb3667f35 | JavaScript | toniii85/udemy-indecision-app | /src/playground/es6-arrow-function2.js | UTF-8 | 807 | 4.21875 | 4 | [] | no_license | //arguments object- no longer bound with arrow functions
const add = (a, b) => {
// console.log(arguments);
return a + b;
};
console.log(add(55,1, 1001));
// this keyword - no longer bound
const user = {
name: "Toni",
cities: ["Gijon", "Madrid"],
printPlacedLived () {
return this.cit... | true |
bc1bb48de24dac7ac7eabbe2db8e8b59a4a19966 | JavaScript | creativemorris/todolist | /app/js/main.js | UTF-8 | 896 | 2.703125 | 3 | [] | no_license | ;(function() {
var $newItem = $('#new-item'),
$list = $('#item-list');
window.todolist = {
initMain: function() {
todolist.attachEvents();
},
attachEvents: function() {
$newItem.keyup(function(event){
if(event.keyCode == 13){
todolist.saveHandler();
}
});
$newItem.focus();
},... | true |
e6d3b74f4730a1a825081a46653eeb990f1ea887 | JavaScript | rafaelsilveeira/Projetos-de-Aprendizagem | /App_calculo_de_tarifa/js/script.js | UTF-8 | 1,715 | 3.78125 | 4 | [
"MIT"
] | permissive | //Função para padronizar moeda com vírgula
function padronizaMoeda(valor){
return valor.toFixed(2).replace('.',',')
}
//Função para calcular valor da corrida
function calculoTarifa(km, tempo){
let tarifa = 2+(km*1.4)+(tempo*0.26);
return tarifa;
}
//Função para adicionar/editar a div do resultado
function... | true |
4bdb0f58a8d4d30f4054a04f065b53bdc944034e | JavaScript | barwin/git-notifications | /lib/git-wrapper-local.js | UTF-8 | 2,221 | 3.171875 | 3 | [] | no_license | // imports
const { spawn } = require('child_process');
class Git {
constructor(options = {}) {
this.binary = 'git';
const { cwd, ...remainingOptions } = options;
this.cwd = cwd || process.cwd();
this.args = Git.optionsToArray(remainingOptions);
}
// git.exec(command, opti... | true |
f0db4802210cf644daa5c2eeb886afcd0ebc8b09 | JavaScript | LanaBanana89/Arcanoid | /arcanoid.js | UTF-8 | 7,979 | 3.375 | 3 | [] | no_license | class Ball {
constructor(options){
this.options = options || {};
}
draw() {
var ctx = this.options.context;
ctx.beginPath();
ctx.arc(this.options.x,this.options.y,this.options.radius,0,2*Math.PI);
ctx.fillStyle = this.options.fill;
ctx.fill();
ctx.closePath();
}
move(x,y) {
this.options.x... | true |
2f128e8eb703b09950804b671fa9d8a526145d2e | JavaScript | vinodsonu/react-app | /src/components/forms/formelements/preview2.js | UTF-8 | 1,413 | 2.59375 | 3 | [] | no_license | /*global React*/
/*global ReactDOM*/
import React from 'react';
import './preview2.css';
import Navbar from './navbar.js';
class Favouritedessert extends React.Component {
constructor(props) {
super(props)
this.state = { value: '', displayValue: '' }
}
handleChange = (event) => {
thi... | true |
97839f96c336c481dd906dda6b374b11996e4e99 | JavaScript | mmkvdev/leetcode | /August/Week1/Day1/workArea/detectCapital.js | UTF-8 | 642 | 3.734375 | 4 | [] | no_license | /**
* @param {string} word
* @return {boolean}
*/
var findRestCapitals = function(word) {
for(let i = 1; i< word.length;i++ ){
if(word[i].toUpperCase() === word[i]) return true
}
return false;
}
var detectCapitalUse = function(word) {
if(word.toUpperCase() === word) return true;
if(word.... | true |
38acd3f771354345cf03dc673a9d2338560944a9 | JavaScript | georgewbrown/jsLessonsSept | /05-expressionsAndOperators/02-comapriosnOperators.js | UTF-8 | 1,151 | 4.40625 | 4 | [] | no_license | /*
COMPARISON OPERATORS
*/
// equality doesnt care about type
console.log('3'== 3); // this is true (type coercion)
console.log('three'== 3); // false
console.log(0 == false == '' == null); //examples of falsey
// strict equality used to check if things are the same checks both value and type
console.log(3 === 3); ... | true |
d70290c625c23cff00e64f18eb5f875baa2aa81b | JavaScript | kes2401/interview-questions | /04-maxchar-solution1.js | UTF-8 | 895 | 4.65625 | 5 | [] | no_license | // Given a string, return the character that is most commonly used in the string.
// - Examples
// maxChar("abcccccccd") === "c"
// maxChar("apple 1231111") === "1"
function maxChar(str) {
let charMap = {};
let max = 0;
let maxChar = '';
for (let char of str) {
charMap[char] = charMap[char] + 1 || 1;
}
for ... | true |
e62af483d7a42e5211ec0964c8e94752515e3860 | JavaScript | eshandro/rtd-next-project | /src/server/static_feed/createStopFromJson.js | UTF-8 | 1,719 | 2.796875 | 3 | [] | no_license | const Stop = require('../database/models/stop');
/** json obj **/
// {"stop_id":"34467"
// "stop_code":"34467"
// "stop_name":"40th & Colorado Station Track 1"
// "stop_desc":"Vehicles Travelling East"
// "stop_lat":"39.776071"
// "stop_lon":"-104.942045"
// "zone_id":""
// "stop_url":""
// "location_type":"0"
// "pare... | true |
a90fa0025ad8d1dd248dd4a5839e590c247307c0 | JavaScript | MBoone5/React-Gallery-App | /src/Components/App.js | UTF-8 | 2,182 | 2.703125 | 3 | [] | no_license | // basic modules
import React, { Component } from 'react';
import { BrowserRouter, Route, Switch, Link } from 'react-router-dom';
// components
import Nav from './Nav';
import Search from './Search';
import Results from './Results';
import NoMatch from './NoMatch';
// data fetching
import axios from 'axios';
import a... | true |
88986ed3380aa15b6bfed8b458b8fa31717ad182 | JavaScript | looprandom/OnlineCoding | /可取消请求的http请求模块/fetchRequest.js | UTF-8 | 387 | 3 | 3 | [
"MIT"
] | permissive | /*
基于 fetch API 封装的 request 接口,封装简单,只为说明问题;
返回的数据格式兼容基于 axiosRequest 的示例代码
*/
const baseURL = 'http://localhost:3000'
function request(reqArgs) {
//接口返回的数据格式是为了兼容axios的示例代码
return fetch(baseURL + reqArgs.url).then(async response => ({ data: await response.json() }))
} | true |
4724eda1de598347bb34eff7cd694d6149baadc7 | JavaScript | shenickravisa/reactFirstSteps | /02-intro-react/intro-javascript/src/bases/03-objetos-literales.js | UTF-8 | 991 | 3.796875 | 4 | [] | no_license | const persona = {
nombre: 'tony',
apellido: 'stark',
edad: '45',
direccion: {
ciudad: 'new york',
zip: 58210
}
}
//cuando se crea un objeto o algo en js se crea un prototipe es decir una propiedad que tienen todos
// {persona:persona} significa que estamos creando un nuevo objeto apa... | true |
ecb1fefa62819c2952687b594bb8ec18d7d0ad3e | JavaScript | AbelardoDV/AppMovil_AsiriNetworks | /sistemas20/platforms/android/app/src/main/assets/www/js/index.js | UTF-8 | 4,241 | 2.578125 | 3 | [] | no_license | var app = {
init: function() {
console.log("Aplicación INICIADA");
cordova.plugins.firebase.messaging.subscribe("Nuevo_Tema");
document.getElementById("botonIniciar").addEventListener("click", iniciarsession);
document.getElementById("btnLogout").addEventListener("click", hacerlogout);
cord... | true |
057705e550b8b692c42ed58bbdd59bb16b42c9a8 | JavaScript | apollo-ng/dspace-app-apollong | /app/geofeeds/spaceApi.js | UTF-8 | 1,813 | 2.703125 | 3 | [] | no_license | define([
'underscore',
'reqwest',
'./base',
], function(_, Reqwest, Base) {
"use strict";
/**
* Class: GeoFeeds.SpaceAPI
*
* initialized with
* { name: 'Hackerspaces', url: '/examples/spaceapi/hackerspaces.json', type: 'SpaceAPI'}
*
*/
return Base.extend({
type: 'SpaceAPI',
wa... | true |
9688fc00a1bb7b79d3e39446921a2b80c59ae85f | JavaScript | ilayserr/miLAB_Exercises | /Node - Ex6-11/Ex11/Ex11.js | UTF-8 | 4,205 | 3.359375 | 3 | [] | no_license | /*
File Name : Ex11.js
Author : Ilay Serr
Email : ilayserr@gmail.com
*/
const bodyParser= require('body-parser');
const MongoClient = require('mongodb').MongoClient;
const express = require('express');
const app = express();
const mongoUrl = 'mongodb://ilay921:ilay1111@ds159707.mlab.com:59707/songs';
app.use(bodyParse... | true |
c44203fe77352727da6900fd1b17da6637861413 | JavaScript | Manisha-Mani/Full-Stack-dev | /JavaScript/Fundamentals.js | UTF-8 | 2,488 | 4.09375 | 4 | [] | no_license | //Variable
let name='Manisha';
//Constant
const pi=3.14;
console.log(name);
console.log(pi);
//PRIMITIVE DATATYPES
//Strings
let str="HarryPotter"
//Numbers
let n=23;
//Boolean
let option=true;
//Undefined
let und;
//Null-when u want to clear the value of a variable explicitly, we use null
let nullvar=null;
console.... | true |
58048d8936dced4efff83e9b2dfabdfd9f61026a | JavaScript | Juansecu/mongauth | /auth/auth.middleware.js | UTF-8 | 999 | 2.609375 | 3 | [] | no_license | require('dotenv').config();
const { verify } = require('jsonwebtoken');
const { ACCESS_TOKEN_SECRET } = process.env;
exports.checkAuth = (req, res, next) => {
const header = req.header('Authorization');
if (!header) throw new Error('Access denied.');
// Authorization <token>
const [bearer, token] =... | true |
1109766cf654d8b3e0678d97f8cb3181cf510cf2 | JavaScript | CamilaCostaMuzzi/connect-pet | /controllers/AuthController.js | UTF-8 | 831 | 2.65625 | 3 | [] | no_license | const usuarios = require('../database/Usuarios.json');
const bcrypt = require('bcrypt');
module.exports = {
showLogin: (req, res) => {
res.render("index", {
error: null
});
},
login: async (req, res) => {
//capturar email e senha enviados
const {
e... | true |
cbe44b52955e03771550badbd1cafd3aa35b6a24 | JavaScript | kavya67/fortunesoft-frontend | /apiContext.js | UTF-8 | 720 | 2.75 | 3 | [] | no_license | import React, { useContext, useState, useEffect, createContext } from "react";
import http from "./libs/http";
const APIContext = createContext();
export function APIContextProvider({ children }) {
const [movies, setMovies] = useState([]);
useEffect(() => {
async function fetchData() {
const data = awai... | true |
2fbeaf368f05523a0c20c348795a8f5cf3e58854 | JavaScript | chinna510/Projects | /WorkSpace/Tools/Ajax/dom.js | UTF-8 | 784 | 3.015625 | 3 | [] | no_license | function getData() {
var XMLHttpRequestObject = false;
if (window.XMLHttpRequest) {
XMLHttpRequestObject = new XMLHttpRequest();
} else if (window.ActiveXObject) {
XMLHttpRequestObject = new ActiveXObject("Microsoft.XMLHTTP");
}
if (XMLHttpRequestObject) {
XMLHttpRequestObject.open("GET", "data1.txt");
XML... | true |
75ac3e9070e4f4c5ac604dfc44b12ad86e2dd0c5 | JavaScript | Tram-One/useUrlParams | /useUrlParams.test.js | UTF-8 | 1,942 | 2.53125 | 3 | [
"MIT"
] | permissive | const useUrlParams = require('./useUrlParams')
describe('useUrlParams', () => {
describe('with default getPath function', () => {
it('should match with matching path from function', () => {
window.history.pushState({}, '', 'http://localhost/fake-id/list')
const params = useUrlParams('/:account/list')
... | true |
b10b96b80f83c3e453703d6956b530661e5424e9 | JavaScript | vedantb/DP-Interviews | /Minimum-Coin-Change/min-coin-change-optimized.js | UTF-8 | 751 | 3.5 | 4 | [] | no_license | let countChange = function (denominations, total) {
const n = denominations.length;
const dp = Array(total + 1).fill(Number.MAX_VALUE);
dp[0] = 0;
for (let i = 0; i < n; i++) {
for (let j = 1; j <= total; j++) {
if (j >= denominations[i]) {
dp[j] = Math.min(dp[j], 1 + dp[j - denominations[i]... | true |
52edc1dc29f74a34606d83ec184d612a31293704 | JavaScript | QuickCharger/js | /js.js | UTF-8 | 2,698 | 3.453125 | 3 | [] | no_license | // 判断是否存在某个变量
if(typeof a === "undefined") {
console.log("a undefined")
} else {
console.log("a defined")
}
// 默认值的写法,普通变量
let r1 = typeof a !== "undefined" ? a : "3000"
console.log("result = " + r1)
// 默认值的写法,类成员
obj={}
let r2 = obj.a || '3000'
console.log("result = " + r2)
//在代码块内,使用let命令声明变量之前,该变量都是不可用的
let tm... | true |
9dda71c8173bf822b1bbf2e476eabb79566c1337 | JavaScript | yemling/node-course-todo | /playground/mongodb-connect.js | UTF-8 | 1,458 | 2.953125 | 3 | [] | no_license | //const MongoClient = require('mongodb').MongoClient;
//object destructuring ES6, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment
const {MongoClient, ObjectID} = require('mongodb');
/*
Create MongoDb ObjectID on the fly
var obj = new ObjectID();
console.log(obj);... | true |
9b02d5be9b6f51b1f34867a34595e4ebf0b4d3e2 | JavaScript | OleksandrZhezdorf/Homework18 | /script.js | UTF-8 | 2,671 | 3.15625 | 3 | [] | no_license | const units = [new Unit(50, 100, 'Archer', 'https://ru.wiki.tribalwars2.com/images/f/f7/Archer_big.png'),
new Unit(100, 50, 'Pikeman', 'https://ru.wiki.tribalwars2.com/images/e/e9/Spearman_big.png'),
new Unit(150, 50, 'Swordsman', 'https://ru.wiki.tribalwars2.com/images/d/d2/Swordsman_big.png')];
units.push(units[0].c... | true |
1460d5660c28c3dee3ad7339e43de46a36f51cc9 | JavaScript | Sadia-web/basic-js | /while.js | UTF-8 | 83 | 3.015625 | 3 | [] | no_license | var num = 12;
while (num<=15){
console.log(num);
num++; // num = num + 1;
} | true |
5b563b3f5267310a1abe9244d83e6c1a2eba2a9f | JavaScript | MatejMecka/langsbay | /src/learning/static/learning/js/browse.js | UTF-8 | 6,369 | 2.84375 | 3 | [
"MIT"
] | permissive | var langs_data = undefined;
var autocompleteDictionaryData = [];
var autocompleteResourceData = [];
function isEmptyOrSpaces(str) {
return str === null | str === '' | str.match(/^\s*$/) !== null;
}
document.addEventListener('DOMContentLoaded', () => {
// Populate select inputs with the complete list of languages.... | true |
92cef8b6f2ee04dbe2df2d7cde21aae314821661 | JavaScript | LaraWho/middleware-practice | /src/App.js | UTF-8 | 1,191 | 2.84375 | 3 | [] | no_license | import React, { Component } from 'react';
import './App.css';
import axios from 'axios';
class App extends Component {
constructor(props) {
super(props)
this.state ={
userinput: '',
viewInput: ['']
}
}
doAThing = (event) => {
if(event.charCode === 13) {
axios.post('http://localhost:5... | true |
560594205ce515f97b9c1fec9d66c971d2ed0e15 | JavaScript | alfradchew/JS101_Programming_Foundation_with_JS | /lesson_3/easy2/q7.js | UTF-8 | 487 | 4.75 | 5 | [] | no_license | /*
Consider the following object:
=> let flintstones = { Fred: 0, Wilma: 1, Barney: 2, Betty: 3, Bambam: 4, Pebbles: 5 };
Create an array from this object that contains only two elements: Barney's name and Barney's number:
=> [ 'Barney', 2 ]
*/
let flintstones = { Fred: 0, Wilma: 1, Barney: 2, Betty: 3, Bambam: 4, Pe... | true |
ad381684dde1157e604808eefab12e5a1105ea49 | JavaScript | agrawaltejas01/Node-Js-Theory | /1-modules-expots-require/4-module-patterns/type4.js | UTF-8 | 158 | 3 | 3 | [] | no_license | var type = function() {
this.type = "Greetings from type 4";
this.greet = function() {
console.log(this.type);
}
}
module.exports = type; | true |
48c4d5a807e4b24b993f2a550c860d9adcc28b95 | JavaScript | caicloud/cyclone | /web/config/middleware/mockServerMiddleware.js | UTF-8 | 2,174 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | const pathToRegexp = require('path-to-regexp');
const fs = require('fs');
// get actions to handle mock requests
function getMockActions(mockDir) {
const files = fs.readdirSync(mockDir);
const actions = {};
// get all js files from mock dir as route controller
const mods = files.filter(file => /(.*?)\.js/.test... | true |
8528fb8c6f5b618307f340beb246fdcf643002a2 | JavaScript | dandelarge/campus-party-ej | /lib/musicians.js | UTF-8 | 2,304 | 3.109375 | 3 | [] | no_license | 'use strict';
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.definePrope... | true |
5fe40c3e58724a5b8c7b361583167987147998a9 | JavaScript | iffatalamrazon/nodeMongo | /index.js | UTF-8 | 185 | 2.5625 | 3 | [] | no_license | const express =require('express');
const app =express();
app.get('/',(req, res) =>{res.send ("Thank you so much")});
app.listen(3000 , () => console.log ('listening to port 3000 ')); | true |
c0acc08c5f105c77f2d3d5c85646d1c5f6fd665b | JavaScript | gsj011014/akebuss-blog | /js/issue-blogs-public-fun.js | UTF-8 | 2,150 | 2.515625 | 3 | [] | no_license | //图片预览
$(function(){
});
function selectText(element_obj){//选中内容
var text = element_obj;
if (document.body.createTextRange) {
var range = document.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) {
var selection = window... | true |