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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a3068f15fc995b0cbb08665113f92a181421adaa | JavaScript | tpetts/javascript | /js/knownLoopCount.js | UTF-8 | 1,223 | 4.3125 | 4 | [] | no_license | /*
This is file /unit04/knownLoopCount.js
It contains the JavaScript code for
"Looping with a known loop count"
File: /unit04/knownLoopCount.html
*/
function knownLoopCount() {
"use strict";
// Your code goes in here.
document.write("The JavaScript file for this page is: "
+ "\"unit4/unit04/j... | true |
8073efc70a8bb9d266c7e44134ca6dbb79831551 | JavaScript | machawk1/Mink | /mink-plugin/options.js | UTF-8 | 9,611 | 2.515625 | 3 | [
"MIT"
] | permissive | /* global chrome, $ */
var debug = true
const tmDropdownString = '<option> ↓ Mink has TimeMaps for... ↓</option>'
const tmDropdownNoTimemapsString = '<option>--- No TimeMaps available ---</option>'
function restoreOptions () {
chrome.storage.local.get('ignorelist', function (items) {
$(ite... | true |
9402fd5678844fa1e3220f3a08b974f56be5b911 | JavaScript | ericasnogueira/JAVASCRIPT | /OPERAÇÕES ARITMÉTICAS-exemplos.js | UTF-8 | 790 | 4.5 | 4 | [] | no_license | // + adição
// - subtração
// * multiplicação
// "/" divisão
// % módulo
//tenta fazer uma divisão ele retorna
//para que não tenha numeros quebrados
// é o resto da divisão
// ++ incremento
// -- decremento
//variaveis
var a = 9;
var b = 15;
//subtração
var c = a - b;
//módulo
var e = 30%15;
//++ i... | true |
725062fdec73e64dfb82601e1ad009de0fc59238 | JavaScript | WilliamMena/AdventOfCode2020 | /day4/day4.js | UTF-8 | 4,814 | 3.078125 | 3 | [] | no_license | const fs = require('fs');
const inputs = [];
fs.readFile('./day4_inputs.txt', 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
inputs.push(...data.split('\n\n'))
console.log(validPassports(inputs));
});
function cleanData(array) {
return array.map(pass => pass.split('\... | true |
e547f6b5f8f3a51bbda3b29985b942d729123a21 | JavaScript | Monsterblader/object-dance-party | /src/main.js | UTF-8 | 835 | 2.78125 | 3 | [] | no_license | $(document).ready(function(){
// This is a list of the different kinds of dancers. Right now,
// there's just one, but eventually, you'll want to add more.
var kindsOfDancers = {
makeBlinkyDancer: BlinkyDancer, // found in blinkyDancer.js
makePoleDancer: PoleDancer, // found in otherDancers.js
makeC... | true |
b128de5036871cdfecafa69d7362ba91c2f5d82e | JavaScript | Kaleakash/TCSMEANStackTraining | /Express Projects/app.js | UTF-8 | 2,463 | 3.1875 | 3 | [] | no_license | let express = require("express"); // load the module
let app = express(); // creating the reference of express module
let port =9090;
let bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({extended:true})); // enable any format body data
//app.use(bodyParser.json()) // enable json data... | true |
403d9b100b5bf04b9af2053d3c5d0a23c8b27ec1 | JavaScript | shreyanshjn/quizBuzz | /src/components/prof/home/Index.jsx | UTF-8 | 5,330 | 2.53125 | 3 | [] | no_license | import React from 'react'
import "./src/css/home.css"
import FetchApi from "../../../utils/FetchAPI";
import AuthService from "../../../handlers/prof/AuthService";
export default class HomeIndex extends React.Component {
constructor() {
super();
this.state = {
topic: "",
que... | true |
c1b26763d0d111e876bd623e67e5c781d3c7e729 | JavaScript | xxxmarxxx/starter-project-redux-tutorial-cart | /src/App.js | UTF-8 | 1,435 | 2.578125 | 3 | [] | no_license | import React from "react";
// components
import Navbar from "./components/Navbar";
import CartContainer from "./components/CartContainer";
// items
// redux stuff
// store - stores data, think of state
// store - przechowuje dane, myśl o stanie
// reducer - function that used to update store
// reducer - funkcja, któ... | true |
241c600e6f0425eaf89ada79acbf4d4bf04c1dc9 | JavaScript | pixobits/TokenFighter | /packages/react-app/public/F.LF/core/collision.js | UTF-8 | 4,288 | 2.546875 | 3 | [] | no_license | /*\
* collision
* collision detection function set
*
* all functions return `true` if intersect
*
* [example](../sample/collision.html)
\*/
define(['F.LF/core/math'], function(Fm)
{
return {
/*\
* collision.rect
* rectangle-rectangle intersect test
[ method ]
- rect1 (object)
- rect2 (object) in form of... | true |
ef06581fbec447e51a447fd75d19f3721efa8d2a | JavaScript | Magnaillusion/alfresco_training | /lab-content-model-share/target/lab-content-model-share-war/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/delete-site.post.json.js | UTF-8 | 1,328 | 2.703125 | 3 | [] | no_license | function main()
{
// parse the input json into an object - to retrieve shortName
var reqJSON = eval('(' + json.toString() + ')');
// collect up objects to delete later - as the repo removes component
// definitions and we cannot retrieve them after
var dashboardURL = "site/" + reqJSON.shortName + "/d... | true |
0cf0c98829a1c84935968f19c1a42e9f7bf66597 | JavaScript | ruzz311/ksu-countdown | /client/code/app/app.js | UTF-8 | 2,589 | 2.625 | 3 | [] | no_license | var $countdown = $('#countdown'),
$schedule = $('#schedule'),
$kill = $('#killkillkill'),
$timer = {
d : $( '.day', $countdown),
h : $( '.hour', $countdown),
m : $( '.min', $countdown),
s : $( '.sec', $countdown)
},
emawtime = require('/timer'),
now = (new Date()).getT... | true |
05e50ebc0df0192dee47bf424c19864ef9a5871d | JavaScript | snayrouz/javascript-basics-challenge | /lib/factorial.js | UTF-8 | 139 | 3.125 | 3 | [] | no_license | function factorial(num) {
let f = 1;
for (var i = 1; i <= num; i++) {
f = f * i;
};
return f;
};
module.exports = factorial;
| true |
da7025fba6a8db5c1207bf55666940a49afd7d81 | JavaScript | Jamesclifford7/sonvul-app | /src/App.js | UTF-8 | 7,233 | 2.59375 | 3 | [] | no_license | import React from 'react';
import { Route, withRouter } from 'react-router-dom';
import './App.css'
import Landing from './components/landing/Landing';
import Home from './components/home/Home';
import Login from './components/login/Login';
// import Home2 from './components/home/Home';
// The onlogin attribute on t... | true |
34d7186e3082e3184a6f2a2c06f3ab4656777055 | JavaScript | elipesodair/fundamendos-js | /ponto-extra.js | UTF-8 | 137 | 2.84375 | 3 | [] | no_license | const notas =[10, 9, 8, 7, 6]
const notasAtualizadoas = notas.map( nota => nota == 10 ? nota : ++ nota)
console.log(notasAtualizadoas); | true |
65699c7952eea5c625c7a5d41b4ca40366c01af1 | JavaScript | atoder/DevDelight | /javascript-basics/016-javascript-string-manipulation-and-methods-part-2-of-2/devdelight.js | UTF-8 | 980 | 3.734375 | 4 | [] | no_license | var brand = 'DevDelight.com - Development Done Right';
// 1) charAt
console.log(brand.charAt(0));
// 2) split
console.log(brand.split(' '));
// 3) slice
console.log(brand.slice(17));
console.log(brand.slice(17, 20));
console.log(brand.slice(-1));
// 4) substring
console.log(brand.substring(17, 20));
// 5) substr
c... | true |
33447a6398a7be79217ba780a56f6bf08bf47bee | JavaScript | kumaranvram/geofeelings | /app/assets/javascripts/searches.js | UTF-8 | 2,211 | 2.53125 | 3 | [] | no_license | $(document).ready (function() {
equi();
search = null;
});
function equi() {
var width = 1200,
height = 600;
var projection = d3.geo.equirectangular()
.scale(191.25)
.translate([width / 2, height / 2])
.precision(.1);
var path = d3.geo.path()
.projection(projection);
var graticule = d3.geo.gra... | true |
4a46e19ca9f5b78ef00b0a5d41d1c857ebdbce18 | JavaScript | FarmViz/catalogue-modules | /front/src/components/Modale/Modal.jsx | UTF-8 | 3,087 | 2.71875 | 3 | [] | no_license | // composant permettant d'afficher une modale
import React from 'react';
import Modal from 'react-modal';
import '../Css/Global.css';
import '../Css/Grid.css';
import './Modal.css';
// constante d"finissant les propriétés de style de la modale
const customStyles = {
content: {
top: '50%',
left: '50%',
... | true |
cb15935ed7cb0b9423e9f181eadb72377418fc56 | JavaScript | kehindeojapa-dev/eloquentYDKJS | /eqJS/Chapter4/exercise.js | UTF-8 | 1,278 | 4.34375 | 4 | [] | no_license | // Exercise(1): THE SUM OF A RANGE
// let array1=[]
/* SOLUTION WITHOUT STEP
function range(start,end) {
for (let i = start; i <=end; i++) {
if (start <= end){
array1.push(start);
start++;
}
}
return array1
}
*/
// SOLUTION WITH STEP
/*
function range(start, ... | true |
4c2fc47f3f1f9fb70652eeff7883da057eb30ba6 | JavaScript | weblabormx/Easy-JS-Library | /library/weblabormx/date2.js | UTF-8 | 2,131 | 2.703125 | 3 | [] | no_license | (function( $ ){
$.fn.date2 = function() {
function actualizarInputDate2(thisg, name) {
var day = $("#"+name+"-day").val();
if (day.length<2) {
day = "0"+day;
};
var res = $("#"+name+"-year").val();
res += "-"+$("#"+name+"-month").val()... | true |
ff944a3b69d3ab223e89f78c4e54cac709707df7 | JavaScript | shyamalisingh/samikshya | /js/common.js | UTF-8 | 252 | 2.75 | 3 | [] | no_license | var imageIndx=0;
function changeImage(url){
document.getElementById("homeImage").src=url;
}
function changeImageIndex(){
i=imageIndx%3+1;
url = "images/homePage"+i+".jpg";
document.getElementById("homeImage").src=url;
imageIndx++;
} | true |
b749ae072e71932dffbe27dadb50a7a0f33ba339 | JavaScript | graphology/graphology | /src/graphology/src/attributes/edges.js | UTF-8 | 24,139 | 3.25 | 3 | [
"MIT"
] | permissive | /**
* Graphology Edge Attributes methods
* ===================================
*/
import {assign, isPlainObject, getMatchingEdge} from '../utils';
import {
InvalidArgumentsGraphError,
NotFoundGraphError,
UsageGraphError
} from '../errors';
/**
* Attach an attribute getter method onto the provided class.
*
... | true |
daaae44a757da54f3c663c80c3300cf0fa2fe6f0 | JavaScript | mcnuttandrew/no-grammar-supplement | /code-examples/chart-js/time-max-span.js | UTF-8 | 2,509 | 2.671875 | 3 | [
"MIT"
] | permissive | const actions = [
{
name: 'Randomize',
handler(chart) {
chart.data.datasets.forEach(dataset => {
dataset.data.forEach(function(dataObj, j) {
const newVal = Utils.rand(0, 100);
if (typeof dataObj === 'object') {
dataObj.y = newVal;
} else {
d... | true |
c9e42f8565cc6b432ea205bf2905bbc6a92cd84e | JavaScript | xx8897/Quiz | /quiz1.js | UTF-8 | 653 | 2.890625 | 3 | [] | no_license | function change() {
/*
document.getElementById('cgu').innerHTML = "CSIE@CGU";
document.getElementById('good').innerHTML = "怎麼那麼棒!!.";
*/
$("#cgu").html("CSIE@CGU");
$("#good").html("怎麼那麼棒!!.");
}
function new_button(){
/*
var btn = document.createElement("BUTTON");
bt... | true |
84cd619ebb8283f22bbe16e3d36c54a57d10d8c5 | JavaScript | MarjanSirovljevic/sms-todo-app | /src/containers/Register.js | UTF-8 | 6,065 | 2.59375 | 3 | [] | no_license | import React from 'react';
import { Redirect } from 'react-router-dom';
import validator from 'validator';
import uuid from 'uuid';
import Input from '../components/Input';
import Button from '../components/Button';
const mainDiv = {
width: '500px',
margin: '60px auto',
padding: '30px',
background: '#fcfcfc',... | true |
8129b1e03465b77ab8d0226b7e1119021c0468d9 | JavaScript | Fernando12mais/MinhaToDoList | /src/components/BlockTask.jsx | UTF-8 | 1,213 | 2.71875 | 3 | [] | no_license | import React, { useState } from "react";
import "./BlockTask.css";
import Input from "./Input";
import Button from "./Button";
import Task from "./Task";
const BlockTask = () => {
const [task, setTask] = useState([]);
const [inputValue, setInputValue] = useState("");
const takeInputValue = (valorInput) => {
... | true |
ac6c4322c8b53aaae430257693aeee3189e4e50c | JavaScript | Zhykharieva/Zhykharieva.github.io | /JsTask/src/view/render.js | UTF-8 | 900 | 3.171875 | 3 | [] | no_license | import { generateRandomLetters} from '../utils/utils.js';
const LETTERS_QUANTITY = 5;
export const renderLettersList = () => {
const mainElement = document.querySelector('.main');
mainElement.innerHTML = '';
const selectElementContainer = document.createElement('div');
selectElementContainer.className... | true |
3101e28641e5463798858fe2bfd3fe62f7ef8f44 | JavaScript | dustinspecker/prepend-if | /src/index.js | UTF-8 | 1,414 | 3.421875 | 3 | [
"MIT"
] | permissive | 'use strict'
import mutliTypeof from 'multi-typeof'
/**
* Determine if string should be prepended with prependString
* @param {String} string - string to prepend, conditionally
* @param {String} prependString - string to prepend to string if string doesn't start with prependString
* @return {Boolean} - should stri... | true |
d2fd7fb0db38ad56b96c38ed13da0b55f74dcdd7 | JavaScript | Jmilcette/jsobjects | /algorithms/intermediate/spinaltapcase.js | UTF-8 | 392 | 3.28125 | 3 | [] | no_license | function spinalCase(str) {
// "It's such a fine line between stupid, and clever."
// --David St. Hubbins
var splitString = str.split("");
for(let i = 0; i < splitString.length; i++) {
if(splitString[i] === splitString[i].toUpperCase()) {
var wordStart = splitString[i];
}
}
... | true |
03edb6ad1404bcb4a08eaffc84fa273e5c3ee62e | JavaScript | AlexanderBritcliffe/songs | /src/actions/index.js | UTF-8 | 456 | 2.75 | 3 | [] | no_license | //action creator
export const selectSong = song => {
//return and action
return {
type: 'SONG_SELECTED',
payload: song
};
};
//if we pass a song object it will return an action with a type of song selected
//and payload of song this action should then end up in reducer reducer will
//look at action type ... | true |
b7fe293934734a0b6b12cd9ff1f189a97228c5dc | JavaScript | shaopard/JavaScript-Novice-to-Ninja | /Chapter 11 - HTML APIs/Web Workers/main.js | UTF-8 | 866 | 3.421875 | 3 | [] | no_license | const btn = document.getElementById('rainbow');
const rainbow = ['red', 'orange', 'yellow', 'green', 'blue', 'rebeccapurple', 'violet'];
function change() {
document.body.style.background = rainbow[Math.floor(7 *
Math.random())];
}
btn.addEventListener('click', change);
const form = document.forms[0];
for... | true |
e77026e6b12f3c38b92416049816422813836456 | JavaScript | Korzanicho/first-react-app | /src/Counter.js | UTF-8 | 1,415 | 2.765625 | 3 | [] | no_license | import React, { Component } from 'react';
import ButtonPanel from './ButtonPanel';
import Register from "./Register";
import Step from "./Step"
class Counter extends Component{
constructor(props) {
super(props);
this.state = {
counterValue: this.props.initValue,
stepValue: 1,
}
}
change... | true |
7abc44380042d98d325755d7cbd5b044e22e744f | JavaScript | bcviscourse/project-harry-potter-vizards-unite-1 | /js/step0.js | UTF-8 | 5,453 | 2.625 | 3 | [
"MIT"
] | permissive | var timeLineTime = 4500; // Duration of initial line chart transition
var lineCircleRMin = 6; // Radius min and max for line chart
var lineCircleRMax = 11;
// Line chart for history of cryptocurrencies
export default function performStep0(chart, rects, svg, timeline, market_data,
x, y, formatNum, tooltipright, to... | true |
47cc4cbfaac8316591d93739c523afcc6ef89d04 | JavaScript | hunterking3305/web | /Teacher/javascript2/bookRoom/book.js | UTF-8 | 968 | 3.46875 | 3 | [] | no_license | function doFirst(){
document.getElementById('theForm').onsubmit = countDate;
}
function countDate(){
var start = document.getElementById('start').value;
var end = document.getElementById('end').value;
var message = document.getElementById('message');
var interval = '';
var oneDay = 24 * 60 * 60 * 1000;
var... | true |
a48f0a9f304ba6ef1ef8d5b802e47333b8b27e76 | JavaScript | frontend-park-mail-ru/2020_1_drop_table | /src/components/StaffList/StaffCardComponent/StaffCardComponent.js | UTF-8 | 1,140 | 2.53125 | 3 | [] | no_license | import './StaffCardComponent.scss';
import './StaffCardComponent.color.scss';
import StaffCard from './StaffCardComponent.hbs';
/** Компонент карточки работника */
export class StaffCardComponent {
/**
* Инициализация компонента карточки работника
* @param {Element} el элемент в кором будет размещаеться... | true |
507566b75d9f0623b6a2d7dca6516145923680d6 | JavaScript | emil14/javascript-design-patterns | /patterns/behavioral/chain-of-responsibility/spec/chain.spec.js | UTF-8 | 2,702 | 3.1875 | 3 | [] | no_license | describe('Цепочка обязаностей / Chain of Responsibility', function () {
var todos;
describe('Инстанс', function () {
beforeEach(function () {
todos = new TodoList();
});
it('TodoList', function () {
expect(todos).to.be.instanceOf(TodoList);
});
... | true |
1f035729bcda715a575156361e9fcd51370f24b5 | JavaScript | AdiAgr3006/Mangoes | /string.js | UTF-8 | 522 | 2.53125 | 3 | [] | no_license | class String {
contructor(p, b){
var options = {
bodyA: b,
pointA: p,
stiffness: 0.04,
length: 10
}
this.constraint = Matter.Constraint.create(options);
World.add(world, this.constraint);
console.log("hi");
}
... | true |
2f66a1685ac86ec9d96dbdf19d1b818410da0589 | JavaScript | matthewlawson/leetcode | /LinkedLists/ReorderLInkedList/reorderlinkedlist.js | UTF-8 | 1,392 | 3.578125 | 4 | [] | no_license | /**
* @param {ListNode} head
* @return {ListNode}
*/
export default function(head) {
// Find mid point of list
if (head == null || head.next == null) {
return head;
}
let slowPointer = head;
let fastPointer = head;
while (fastPointer.next != null && fastPointer.next.next != null) {
slowPointer = ... | true |
32eb47493d44958809e207bf943c9a0ae7aa4351 | JavaScript | denialromeo/borders-quiz | /build-question/random.js | UTF-8 | 1,117 | 3.78125 | 4 | [
"MIT"
] | permissive | /**
* "Monkey patches" Array with a method that swaps the entries at two given indices (in-place).
* @param {number} j The first index.
* @param {number} k The second index.
*/
Array.prototype.swap = function(j, k) {
const t = this[j]; this[j] = this[k]; this[k] = t
}
/**
* Returns a random number from [0, x)... | true |
9c52b91c4fbf250364958f46d8db2467cb335174 | JavaScript | andrebelanger/DragAndJump | /js/hud.js | UTF-8 | 897 | 2.765625 | 3 | [] | no_license | "use strict";
var app = app || {};
app.hud = {
sizeLeft: undefined,
draggingSize: undefined,
canPlacePlatform: true,
text: "",
draw : function(ctx, dragPhase) {
ctx.save();
if(app.dragPhase)
{
// Update HUD text
this.text = "Drag Stage";
// Draw the amount of platforms the player can sti... | true |
187adf0bc158b2b4006be6fd8baa9c4925e32538 | JavaScript | piti118/react-router-auth-provider-example | /src/LoginForm.js | UTF-8 | 2,163 | 2.59375 | 3 | [] | no_license | // @flow
import React, { Component } from 'react'
import withRouter from 'react-router-dom/withRouter';
import { withAuth } from 'react-router-auth-provider';
import TextField from 'material-ui/TextField/TextField';
import * as api from './api'
import Button from 'material-ui/Button/Button';
type cb = (string) => void... | true |
899f4be6c51aea4f63c485b42c2facea1879853f | JavaScript | sarahkcaplan/NeighborhoodMap | /NeighborhoodMap/catclicker/js/catclicker.js | UTF-8 | 2,984 | 3.5625 | 4 | [] | no_license | // MODEL
var model = {
currentCat: '',
catArray: [
{
name: 'Bella',
clickCount: 0,
imageUrl: 'images/bella.jpg'
},
{
name: 'Charles',
clickCount: 0,
imageUrl: 'images/charles.jpg'
},
{
name: 'Loretta',
clickCount: 0,
... | true |
56d10539d12e3e64188010738301fb9a1415207c | JavaScript | HebutJipeng/study-notes | /练习/await/promise.js | UTF-8 | 1,833 | 3.890625 | 4 | [] | no_license | function runAsync() {
return new Promise(function(resolved, rejected) {
setTimeout(function() {
var num = Math.random() * 10;
num=3;
if (num < 5) {
console.log('执行完成')
resolved('any data ' + num);
} else {
rejected('数字过大 ' + num)
}
... | true |
eaef290b2713baeb30b7a27b8c49d13e3094669c | JavaScript | Tikva1989/developer-institute | /week3/day2/exercise-xp/scrip.js | UTF-8 | 3,400 | 3.515625 | 4 | [] | no_license | // Exercise 1 : Change The Article
// //1. Using DOM methods, remove the last paragraph in the <article> tag from the DOM.
// let paraLast = document.getElementsByTagName("p")[3];
// paraLast.parentElement.removeChild(paraLast);
// // 2. Add an event listener which will change the
// //background color of the h2 tag... | true |
fc5641137c6b9b06f2de5a86096c94192d0d7a27 | JavaScript | philippossfrn/simplier-facebook-web-app | /logbook/src/main/webapp/js/user_wants_to_delete_profil.js | UTF-8 | 2,982 | 2.671875 | 3 | [] | no_license | "use strict";
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
function confirm_function(){
var r = confirm("Your profil will be permanetly deleted!");
if (r == true) {
... | true |
f25b8a797fd4f0c455e9b31eb2435c833006200a | JavaScript | sanjaycal/client_zip | /Admin/admin.js | UTF-8 | 764 | 2.734375 | 3 | [] | no_license |
peer = new Peer("admin-client-zip")
var conn = peer.connect("admin-client-zip")
conn.on('open', function() {
// Receive messages
conn.on('data', function(data) {
console.log('Received', data);
});
// Send messages
conn.send('Hello!');
});
//var getUserMedia = navigator.getUserMedia... | true |
8eac25b778e7d99584cb87d5289dd0dd3f378df2 | JavaScript | heng1207/React | /React/02/code/05-react-component/src.6state的基本使用/index.js | UTF-8 | 494 | 2.859375 | 3 | [] | no_license | import React from 'react'
import ReactDOM from 'react-dom'
/*
state的基本使用
*/
class App extends React.Component {
/* constructor() {
super()
// 初始化state
this.state = {
count: 0
}
} */
// 简化语法初始化state(推荐)
state = {
count: 10
}
render() {
return (
<div>
<h1>计数... | true |
abb5843e99a3881370ec093fc639dfb50ff49c60 | JavaScript | pablop76/Stone-Paper-Scissors | /script.js | UTF-8 | 3,005 | 3.296875 | 3 | [] | no_license | const options = ['papier', 'kamień', 'nożyce'],
info = ["remis", "wygrałeś", "przegrałeś"],
choicePlayer = document.querySelector('.choice-player'),
player = document.querySelector('.choice-game__player'),
computer = document.querySelector('.choice-game__pc'),
scoreFight = document.querySelector('.s... | true |
f431364fbc72af1b9f164cd5409e27a941150e20 | JavaScript | vicckm/projeto-github | /srcs/controllers/RepositorioController.js | UTF-8 | 943 | 2.984375 | 3 | [] | no_license | class RepositorioController {
constructor() {
throw new Error("Operação inválida");
}
static geraRepositorio(urlRepositorio) {
let divRepositorio = document.getElementById("repositorio");
divRepositorio.innerHTML = "";
let reqGitRepos = new XMLHttpRequest();
reqGitRepos.open("GET", urlRepos... | true |
44eb316e460be761fc5234b8d5f2058c01b74084 | JavaScript | yaseenleo/Blood-Bank | /js/auth.js | UTF-8 | 1,992 | 2.6875 | 3 | [] | no_license | // Initialize Firebase
// var config = {
// apiKey: "AIzaSyA7rfBhIutZdEG0R7xANM3Wy27lV7GP2-Q",
// authDomain: "yaseen-site.firebaseapp.com",
// databaseURL: "https://yaseen-site.firebaseio.com",
// projectId: "yaseen-site",
// storageBucket: "yaseen-site.appspot.com",
// messagingSenderId: "1093... | true |
7ca4e8a857f3534d30a12eb1cda8d8e69ee055a7 | JavaScript | Michael-K-Oconnor/algoPractice | /leetcode/9-isPalindrome.js | UTF-8 | 477 | 3.5625 | 4 | [] | no_license | /*
* @param {number} x
* @return {boolean}
*/
var isPalindrome = function(x) {
// let str = '' + x;
// return str === str.split('').reverse().join('');
if (x < 0) return false;
let tempX = x;
let digits = 0;
while (tempX >= 1) {
digits++;
tempX /= 10;
}
tempX = x;
let reversedX = 0;
while... | true |
d7d414ba008ab90d29d0191db5205e4ebb894f7d | JavaScript | seifChamsi/HEYMYCHIFO | /src/js/views/Searchview.js | UTF-8 | 2,405 | 3.078125 | 3 | [] | no_license | import {elements} from './base';
export const getInput = ()=> elements.searchInput.value;
//function to limit recipe title
const limitRecipeTitle = (title,limit=17)=>{
const newTitle= [];
if(title.length > limit){
title.split(' ').reduce((acc, cur)=>{
if(acc+cur.length<=limit){
... | true |
9660b29c08c1405ecbda2bdd03674f79cc5d402e | JavaScript | wookiehangover/when.works | /lib/cacheman.js | UTF-8 | 1,357 | 2.734375 | 3 | [] | no_license | var config = require('config');
// Middleware for serving cached responses
exports.checkCache = function(req, res, next) {
var cacheKey = createKey(req.url);
req.client.get(cacheKey, function(err, cached){
if (err) {
console.log('Error ' + err);
return res.send(500);
}
cached = parseCache... | true |
3564d57e33e2543ae5d27b69f81fcec967191495 | JavaScript | DavidBanksNZ/dom-utility | /jasmine/spec/DomSpec.js | UTF-8 | 10,481 | 3.265625 | 3 | [
"MIT"
] | permissive | var qsa = function qsa(selector, root) {
root || (root = document);
return Array.prototype.slice.call(root.querySelectorAll(selector));
};
describe('$DOM function', function() {
// Test the $DOM function for creating new element
it('should create new element', function() {
var $el = $DOM('... | true |
464f3431a18dbc5c64637a6e8b9fdffcfd99fda7 | JavaScript | codeOH/react-todo | /src/components/Todo/index.js | UTF-8 | 5,036 | 2.90625 | 3 | [] | no_license | import React, { useState, useRef, useEffect } from 'react'
import { deepClone, isEmptyObj } from '../../api/util'
import TodoInput from './TodoInput'
import TodoItem from '../TodoItem'
import './style.css'
const Todo = props => {
const [todoList, setTodoList] = useState([])
const [showMode, setShowMode] = useState... | true |
a942c0335d8469b859baab70134a63f31c411e62 | JavaScript | tocdo13/member | /packages/hotel/packages/reception/modules/RoomMapSmart/room_map.js | UTF-8 | 4,514 | 2.59375 | 3 | [] | no_license | current_room=0;
/*function update_room_info(id, name)
{
$('room_info_'+name).innerText = rooms_info[id][name];
}*/
room_classes = {};
function select_room(id, form)
{
var rooms = Array();
if(form.room_ids.value != '')
{
rooms = form.room_ids.value.split(',');
}
var e = (window.event) ? window.event : evt;
if(e... | true |
718b2cda1b521d78ca5389f02999c69dba5215fa | JavaScript | 0moura/cloakx | /onthefly_overwrite/demo/aibmmfofaeipbiaocgabhobgedbfdiih_2_14/ontheflyDOM-hidex.js | UTF-8 | 17,844 | 2.890625 | 3 | [
"BSD-2-Clause"
] | permissive | //
// ontheflyDOM.js by Oleksii Starov -- 02/25/2018
//
var MASKING_DOM_ENABLED = true;
// Though, we also safe on the HTML element:
// this["onthefly_real_id"] and this["onthefly_real_className"]
//var global_map_to_random = {};
//var global_map_from_random = {};
// To log DOM queries made
function logQuery(query, ... | true |
179fffecb4517f31529af7f044482dcd43eb8abb | JavaScript | amanibn/hookscheckpoint | /src/components/MovieCard.js | UTF-8 | 1,945 | 2.546875 | 3 | [] | no_license | import React, { Component } from "react";
import parse from 'html-react-parser';
import { Link, Router } from "react-router-dom";
export default function MovieCard({ movie }) {
const project = (rating) => {
switch(rating) {
case '1': return '<span><i class="fa fa-star active"></i></span><span><i class="... | true |
7cdf31c943d03ac141d09066e021d27b1ae1f8f5 | JavaScript | aiminickwong/spice-web-client | /unittest/graphic.test.js | UTF-8 | 3,795 | 2.578125 | 3 | [
"MIT"
] | permissive | suite("Graphic suite", function () {
var sut, clientGui;
var imageData, brush, opaque;
var imageDescriptor = {
width: 10,
height: 10
};
var header = {
top_down: true
};
setup(function () {
sut = wdi.graphics;
var context = $('<canvas>')[0].getContext('2d');
clientGui = {
getContext: function (po... | true |
cee4ecebcc7f309abdb8268976f7f18bcd2faac7 | JavaScript | alirazagcu/task-manager-api | /src/db/mongoose.js | UTF-8 | 753 | 2.53125 | 3 | [] | no_license | const mongoose = require('mongoose')
mongoose.connect(process.env.MONGODB_URL, {
useNewUrlParser : true,
useCreateIndex : true
})
// const me = new user({
// name : 'ahsan',
// email : 'afsdfdf@gmail.com',
// age : 30,
// password : 'pasdfdsword111'
// })
// me.save().then(()=>{
// console.... | true |
fbb667e7baf8b74d455d0aa456f465962161c1a3 | JavaScript | knoebber/opentimegrid | /client/src/components/calendar/HalfView.jsx | UTF-8 | 2,159 | 2.6875 | 3 | [
"MIT"
] | permissive | import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import dayjs from 'dayjs';
function DayColumn({ days }) {
return days.map((d, i) => (
<div
key={d.renderKey}
className={`half-view-day-cell${i === 30 ? ' last-item' : ''}${d.empty ? ' empty' : ''}`}
style={{... | true |
a5aafb28c4f01abc8230aacad0c19c49e2dd87b7 | JavaScript | takamin/transworker | /lib/transworker.js | UTF-8 | 12,554 | 2.625 | 3 | [
"MIT",
"CC-BY-NC-ND-2.0"
] | permissive | "use strict";
const { v4: uuidv4 } = require("uuid");
const globalContext = (Function("return this;")());
let globalContextName = globalContext.constructor.name;
if(!globalContextName) {
// Browser is NOT webkit, perhaps IE11
if(globalContext == "[object Window]") {
globalContextName = "Window";
} ... | true |
b3fc4961338d61a45e3bbaabc5421a8d02b494f4 | JavaScript | MYeager1967/House-Controller | /HeatIndex/index.js | UTF-8 | 4,157 | 2.53125 | 3 | [] | no_license | /*** HeatIndex Z-Way Home Automation module ***********************************
Version: 1.0
------------------------------------------------------------------------------
Author: Michael Yeager
Description: Uses temperature and humidity data from sensors to calculate the
current heat index. Creates a... | true |
c8ac98ec1969d52dcf2bc29072b3ebbcb0f73031 | JavaScript | JSunturaJavier/proyectofinal2 | /routes/restaFor.js | UTF-8 | 201 | 3.03125 | 3 | [] | no_license | //OPERACIONES Y EXPRESIONES LA RESTA
function numero(num){
var n=10;
for(var i=1;i<=10;i++){
console.log(num+"x"+i+"="+(num-i));
}
}
var num=5;
console.log("TABLA DE RESTA DE :"+num);
numero(num); | true |
1f3ecbd42713c21a66f5923f7334b90ec7d821f0 | JavaScript | Rjooby/AAarchive | /Javascript-day-2/ttt/cplayer.js | UTF-8 | 1,010 | 3.109375 | 3 | [] | no_license | var Board = require("./board")
function CompPlayer(board,mark) {
this.board = board;
this.mark = mark;
this.newBoard = function(){
var nb = new Board();
nb.grid = [[],[],[]]
for(var i = 0; i < this.board.grid.length; i++) {
for(var j = 0; j < this.board.grid[i].length; j++){
nb.grid[i... | true |
df724f4cb8fa3b92c8708611f1dcdf9c1bbaffd6 | JavaScript | isabroch/rts-hifi-corner-v3 | /src/functions/requestProductData.js | UTF-8 | 306 | 2.625 | 3 | [] | no_license | export async function requestProductData(idArray) {
const productData = await Promise.all(
idArray.map(async id => {
const response = await fetch(
`https://hifi-corner.herokuapp.com/api/v1/products/${id}`
);
return await response.json();
})
);
return productData;
}
| true |
8fcfdd34586d61dab74616e20589896ae0fed02c | JavaScript | risan/send-request | /__tests__/get-request-options.js | UTF-8 | 2,246 | 2.765625 | 3 | [
"MIT"
] | permissive | /* global expect:false, test:false */
const getRequestOptions = require("../src/get-request-options");
test("it can get request options from just a url", () => {
const options = getRequestOptions("https://example.com");
expect(options).toEqual({
protocol: "https:",
hostname: "example.com",
path: "/",
... | true |
3e573ac3d3821c97d4790950d9278a4e17780f09 | JavaScript | goanpixie/Algorithms | /Heap_insert.js | UTF-8 | 424 | 3.109375 | 3 | [] | no_license | //Heap
let MinHeap = function(){
let heap =[null];
this.insert = function(num){
heap.push(num);
if(heap.length>2){
let idx =heap.length -1;
while(heap[idx]<heap[Math.floor(idx/2)]){
if(idx>=1){
[heap[Math.floor(idx/2)], heap[idx]] = [heap[idx],
heap[Math.floor(idx/2)]];
if(Math.floor... | true |
9ac3bbd5e667382ab9e1adaffed2016a54ba3ab9 | JavaScript | finnshort/voting-server | /src/server.js | UTF-8 | 1,738 | 3.078125 | 3 | [] | no_license | import Server from 'socket.io';
// Create a socket.io server as well as regular http server bound to port 8090
export default function startServer() {
const io = new Server().attach(8090);
// We want our server to be able to broadcast to the users when something
// changes (ie is there a winner yet). For server... | true |
2d3a318d19125a52501e14e8cdc75d23680db64e | JavaScript | ion-cloud/compass | /maps/hogback.js | UTF-8 | 3,145 | 2.796875 | 3 | [
"MIT"
] | permissive | import {clipOrphaned} from '../tools/clipOrphaned';
import {getNeighbors} from '../tools/getNeighbors';
import {bresenhamsLine} from '../tools/bresenhamsLine';
import {fillRect} from '../tools/fillRect';
export function hogback({map}){
const points = [],
minD = 10,
maxD = 20;
let x1, y1, x2, y2;
... | true |
3b3f81c9ee28e33fba099a8c2729ced65af17125 | JavaScript | timruiterkamp/real-time-web-1819 | /week1/src/scripts/sockets.js | UTF-8 | 1,142 | 2.71875 | 3 | [] | no_license | const handler = require("./handlers");
module.exports = {
initSockets(io, players, socket) {
socket.on("new player", ({ name, id, color }) => {
players[socket.id] = {
playerName: name,
playerId: id,
playerColor: color,
x: 300,
y: 300
};
console.log(player... | true |
17cc30cb21aced78d5f437fa35d39dd5853e8193 | JavaScript | Demon000/uni | /web/lab4/assets/js/ajax_4.js | UTF-8 | 1,627 | 2.65625 | 3 | [] | no_license | import '../css/ajax_4.css';
import Vue from 'vue';
import Request from "./Request";
new Vue({
el: '#app',
delimiters: ['${', '}'],
data: {
table: [],
letters: ['X', '0'],
state: null,
},
mounted() {
this.shuffle(this.letters);
},
methods: {
shuffle(a... | true |
291d0ed26e70d2dd033223e4d6ac40fcea59a082 | JavaScript | stupidehorizon/new-weibo | /public/js/index.js | UTF-8 | 1,186 | 2.6875 | 3 | [] | no_license | $("body").on('change','.img',function(){
var objUrl = getObjectURL(this.files[0]) ;
console.log(objUrl)
if (objUrl) {
$(this).prev().attr('src',objUrl);
$(this).parent().removeClass("input-box").addClass("img-box");
var html='<div class="input-box"><img class="cover"><input type="file" name="img" class="img"><... | true |
0ae8f5139d347c432ecbe5015be724cc976312e7 | JavaScript | emmcc/node-switchmate | /bin/pair.switchmate | UTF-8 | 1,768 | 2.828125 | 3 | [
"MIT"
] | permissive | #!/usr/bin/env node
var SwitchmateDevice = require('../index').SwitchmateDevice;
(validateArgs()) ? createPairingSession() : displayUsage();
/**
* Validate commandline arguments.
* @returns {Boolean} True on valid, false on invalid.
*/
function validateArgs()
{
var valid = (process.argv.length>=2);
var inva... | true |
2cf653f97ec15f6ef07255da6d7720e93150e111 | JavaScript | jaeyoonw/js-200-examples | /part2/033.js | UTF-8 | 700 | 3.609375 | 4 | [] | no_license | const symbol = Symbol();
const hello = Symbol("hello");
console.log(Number(3) === Number(3));
console.log(Symbol("symbol") === Symbol("symbol"));
console.log(Symbol() === Symbol());
console.log(typeof Symbol());
console.log(hello);
console.log("");
const nationality = Symbol("nationlity");
const user = {
name: "ja... | true |
48c6a1d1f728d052187e2d3b463eb30e2aec51ae | JavaScript | Geresoju/Intro-Javascript | /home.js | UTF-8 | 2,084 | 3.671875 | 4 | [] | no_license | function showMessage(message)
{
document.getElementById('message').textContent = message;
}
//console.log("coucou")
let welcome = false;
//On peux déclarer plusieurs variables à la suite en utilisant les virgules et les indentations :
let price = 49.99,
name = "Hiking Boot",
discounted = fals... | true |
154e0340adeaf746985e9b96a156170ac6e868e9 | JavaScript | anudeep654/Data-Structures-Algorithms-in-Javascript | /patterns/SlidingWindowPattern.js | UTF-8 | 1,005 | 4.4375 | 4 | [] | no_license | //write a function that accepts array of numbers and also number n and gives the max sum of n numbers.
//trying with normal approach which is O(n^2) complexity
function maxSubArraySum(arr, num) {
let tempValue = 0;
let maxValue = 0;
for (let i = 0; i < arr.length - num + 1; i++) {
tempValue = 0;
for (le... | true |
92a267e901182acd26880085d0d6d9c2211396e4 | JavaScript | krok1029/orange | /src/component/Breadcrumbs.js | UTF-8 | 1,194 | 2.546875 | 3 | [] | no_license | import { withRouter, Link } from "react-router-dom";
function Breadcrumbs(props) {
const flattenRoutes = (arr, road = [], breadcrumb = []) =>
arr.reduce((prev, item) => {
item.road = [...road, item.path];
item.roadName = [...breadcrumb, item.breadcrumb];
prev.push(item);
return prev.conc... | true |
f1fa89bdde45842d762356a7986887fbf03155a7 | JavaScript | jakeirs/ReduxTodoListExample | /src/actions/index.js | UTF-8 | 575 | 2.703125 | 3 | [] | no_license | let nextTodoId = 0
/** action: is an JS object:
* {
* type: 'ADD_TODO'.
* text: 'Make a coffee'
* }
* */
/** Actions Creators: functions that create actions: */
export const addTodo = text => {
return {
type: 'ADD_TODO',
id: nextTodoId++,
text
}
}
export const setVisibilityFilte... | true |
6b5f9d2ddcc9cee9a04e7ea71f72d7295f50a6ed | JavaScript | paulsevere/ball-simulation-2 | /src/force-simulation/tick.js | UTF-8 | 611 | 2.890625 | 3 | [] | no_license | import m from 'mathjs';
const center = {
x: 50,
y: 50,
};
window.math = m;
export function defDx(circ, t) {
let {dx, x} = circ;
let ddx = -m.sign(x);
return Object.assign(circ, {x: x + dx + ddx, dx: dx + ddx});
}
export function defDy(c1, c2 = center, t) {
let {dy, y} = c1;
console.log('distance:', distan... | true |
37ca2c391bad2ce44f21c5815a55cb0d764e5935 | JavaScript | hoangrandy/liturgy | /public/scripts/views/song.js | UTF-8 | 661 | 2.5625 | 3 | [
"MIT"
] | permissive | define([
'jquery',
'backbone',
'views/medium'
], function( $, Backbone, MediumView ){
var SongView = Backbone.View.extend({
tagName: 'div',
className: 'song-details',
render: function(){
var media = this.model.media;
if( media !== null && typeof media !== 'undefined'){
// 1. collect all rendere... | true |
0c5b930004d7cf613d33602aa0577458f89df301 | JavaScript | FishGit2020/concurrent | /9/13/node/index.js | UTF-8 | 2,344 | 2.515625 | 3 | [] | no_license | 'user strict'
const Hapi = require('@hapi/hapi');
const fs = require('fs');
const init = async () => {
const server = new Hapi.server({
host: 'localhost',
port: 8080
});
server.route({
method: 'GET',
path: '/',
handler: (request, h) => {
return h.respon... | true |
5292fa572eaa3add8338f6aca40cdb24979d31d8 | JavaScript | axelhzf/kata-tennis | /src/Match.js | UTF-8 | 2,148 | 3.1875 | 3 | [] | no_license | (function () {
var ZERO = 'ZERO',
LOVE = 'LOVE',
FIFTEEN = 'FIFTEEN',
THIRTY = 'THIRTY',
FORTY = 'FORTY',
DEUCE = 'DEUCE',
ADVANTAGE = 'ADVANTAGE',
WINNER = 'WINNER',
LOSER = 'LOSER';
var Match = function (player1, player2) {
this.initial... | true |
d7964fdb45c1ac8a6763608ee8bdbe910771aa77 | JavaScript | TechToThePeople/urtime | /commands/timetrack/start.js | UTF-8 | 1,961 | 2.71875 | 3 | [] | no_license | var name = "start";
var _ = require('underscore');
var trigger= function(msg, user) {
return name == msg || msg.indexOf(name + " ") == 0;
}
function run (msg, user,callback) {
var taskList = user.getTaskList();
var m = msg.match(/^start (\!|)(.*)$/) // refactoring-> mv to this.param(msg) ??
if (m) {
va... | true |
1617d1501c371e8200afbeeb42319f305334c2a5 | JavaScript | victorgois/video-news-robot | /robots/text_Everything.js | UTF-8 | 1,844 | 2.53125 | 3 | [] | no_license | const NewsAPI = require('newsapi');
//const googleNewsapiKey = require('../credentials/googlenews.json').apiKey;
const newsapiKey = new NewsAPI('2de5d157d448424db4574be570b492d4');
var fs = require('fs');
//var readlineSync = require('readline-sync');
async function robot(content){
await fetchContentFromGoogleNews... | true |
fd9310c95f2b5dc42e394b5635cf3fae95de0552 | JavaScript | pfernandescaldeira/van_hack_tests | /node_test/tree.js | UTF-8 | 1,992 | 3.71875 | 4 | [] | no_license |
var children = []
const prioritizeNodes = (tree, targetVal) => {
looping(tree, targetVal)
rescueNodes(tree)
const expected = {
val : 1,
children: children
}
console.log(" " )
console.log(" " )
console.log(expected )
return expected
};
function findTa... | true |
94336cb0ca42a34b3b93de9ede31d0bd02607f27 | JavaScript | mrquydo/frontend | /JS/Bài 28 Array to string/app.js | UTF-8 | 231 | 3.34375 | 3 | [] | no_license | let emoj = ['😃', '😄', '😁', '😆', '😅', '😂', '🤣']
console.log(emoj)
console.log(emoj.toString());
let emoji = "😃 😄 😁 😆 😅 😂 🤣";
console.log (emoji);
console.log (emoji.split(" ")); | true |
737611d565248dd111c4d32b9e92747fbbedd8e9 | JavaScript | JIALIN-HUANG/mini-collection | /script.js | UTF-8 | 3,887 | 3.40625 | 3 | [] | no_license | //define our variable
let myMessage = document.querySelector(".message");
console.log(myMessage);
myMessage.innerText = "Hello";
myMessage.style.color = "000000";
myMessage.style.marginTop = "200px";
myMessage.classList.add("big");
///create new elements
//define and create element
let newMessage = document.create... | true |
c853ea0a7e1695b4f9168d96af1f580c9f0b5820 | JavaScript | everydayhero/logar-funnel | /index.js | UTF-8 | 1,357 | 2.640625 | 3 | [
"MIT"
] | permissive | require("es6-promise").polyfill();
var fetch = require("node-fetch");
var doProcess = require("./process");
var endpoint = process.env.ENDPOINT;
exports.handler = function(input, context) {
doProcess(input)
.then(post)
.then(summarize)
.then(context.succeed, context.fail);
};
function post(bulk) {
v... | true |
25cbb3e77ab114b1e8e9e4e7542dd196f136cdb7 | JavaScript | Aswini-D3/hyf-homework | /javascript/javascript2/week3/fastestPresser.js | UTF-8 | 2,161 | 3.359375 | 3 | [] | no_license | const input = document.getElementById("input-textbox");
const button = document.getElementById("btn");
const countS = document.getElementById("counter-s");
const countL = document.getElementById("counter-l");
const messageForS = document.getElementById("winning-message-s");
const messageForL = document.getElementById("... | true |
737f7ad6e77612d109f3afc28cefd1c5a273626f | JavaScript | Antoine07/fsd14 | /part1_introduction/Exercices/chap1/let_bar.js | UTF-8 | 218 | 3.3125 | 3 | [] | no_license | function bar() {
let x = 10; // portée dans le bloc
if (true) {
let x = 2; // on définit un autre symbole ou variable
console.log(x); // 2
}
console.log(x); // 10
}
bar(); // 2 10 | true |
7d74dcbc6bf967e1212a27987d8fd1b590b90a8f | JavaScript | Beatzevo/dshop-master | /backend/utils/discounts.js | UTF-8 | 5,205 | 2.625 | 3 | [
"MIT"
] | permissive | const get = require('lodash/get')
const pick = require('lodash/pick')
const { Sequelize, Discount, Order } = require('../models')
/**
* Finds and returns an active and valid discount with the given code
* @param {String} code
* @param {Models.Shop} shop
*
* @returns {{
* error,
* discount
* }}
*/
const valid... | true |
2062f6b13273f26104585194c403d714ae51f81b | JavaScript | FadySamirSadek/dependency-cruiser | /src/report/anon/index.js | UTF-8 | 3,668 | 2.78125 | 3 | [
"MIT"
] | permissive | const _clone = require("lodash/clone");
const _get = require("lodash/get");
const anonymizePath = require("./anonymize-path");
function anonymizePathArray(pPathArray, pWordList) {
return (pPathArray || []).map((pPath) => anonymizePath(pPath, pWordList));
}
function anonymizeDependencies(pDependencies, pWordList) {
... | true |
c8e6dfc1dfcef8f02fff817dfb08c247755b24a5 | JavaScript | shadowimmage/fcc-backend-challenges | /controllers/api/api_challenges/timestamp.js | UTF-8 | 948 | 3.3125 | 3 | [
"BSD-2-Clause"
] | permissive | // timestamp.js
// Challenge 1 - Timestamp conversion UNIX <--> Standard
exports.convert = function (req, res) {
var timestamp = req.params.timestamp
var resData = {
unix: null,
natural: null
}
if (!timestamp) {
res.json(resData)
} else {
const months = ['January', 'February', 'March', 'April... | true |
90645656cb4b9cc565a85452bf8ad8898c8bc1bd | JavaScript | cloneforyou/content-review-lookup | /dist/zelda/Gadget-Tooltips.js | UTF-8 | 4,198 | 2.5625 | 3 | [
"CC-BY-4.0"
] | permissive | /**
* Original by Osvaldas Valutis: http://web.archive.org/web/20180306004159/https://osvaldas.info/elegant-css-and-jquery-tooltip-responsive-mobile-friendly
* Modified and extended by KokoroSenshi for Zelda Wiki
*/
$(function() {
var EDGE_BUFFER = 2; // pixels
$(".explain, .tooltip").bind("mouseenter", func... | true |
f8cddbd7cf22c15e0621233ddc992391aaca67ac | JavaScript | sumeety29/promises | /index.js | UTF-8 | 786 | 3.453125 | 3 | [] | no_license | var promise = require('bluebird')
function mathsCal(inputParam1, inputParam2){
new promise(function(resolve, reject){
var addResult = inputParam1 + inputParam2;
if(addResult !== '' && !isNaN(addResult)){
resolve(addResult)
}
else{
reject('s... | true |
a6a08f831f666994fdc094bcae2714359c5252a3 | JavaScript | RosalvoPetrechen/DinheiroOuMilhas | /dist/jqueryScript.js | UTF-8 | 3,680 | 3.09375 | 3 | [] | no_license | $(document).ready(function () {
let posicaoPrograma;
let posicaoPlano;
let valorBonus;
let calculaTudo = false;
$('[data-toggle="popover"]').popover();
$('.money').mask('000.000.000.000.000,00', {
reverse: true
});
$("#sel1").focus();
//popula PROGRAMA
$.each(programas[0], function (i, p) {... | true |
60d55edb12ac6393b9fa35204ab5b6b47206f8e7 | JavaScript | hpcslag/node.js_try | /punycode/punycode.js | UTF-8 | 864 | 2.890625 | 3 | [] | no_license | var punycode = require('punycode');
// decode domain name parts
console.log(punycode.decode('maana-pta')); // 'mañana'
console.log(punycode.decode('--dqo34k')); // '☃-⌘'
console.log(punycode.encode('mañana')); // 'maana-pta'
console.log(punycode.encode('☃-⌘')); // '--dqo34k'
console.log(punycode.toUnicode('xn--maana-... | true |
52313a4aa0af8aadc865f9d29aff58ce87473b7a | JavaScript | hanhee-song/relux | /src/actions/user_actions.js | UTF-8 | 530 | 2.53125 | 3 | [] | no_license | import * as UserApiUtil from '../util/user_api_util';
export const RECEIVE_CURRENT_USER = "RECEIVE_CURRENT_USER";
export const RECEIVE_USER = "RECEIVE_USER";
export const receiveCurrentUser = (user) => {
return {
type: RECEIVE_CURRENT_USER,
user
};
};
export const receiveUser = (user) => {
return {
... | true |
e46bd8c1db4383bebceda7ac1785d2f4ddbb32c8 | JavaScript | code-tinkerer/fake-api | /db.js | UTF-8 | 1,195 | 3.375 | 3 | [] | no_license | const faker = require("faker");
const maxUsers = 10;
function generateUsers()
{
var users = [];
for (var userIndex = 0; userIndex < maxUsers; userIndex++)
{
var fullName = faker.name.findName();
var firstName = fullName.split(" ")[0];
var username = faker.internet.userName(firstNa... | true |
6371eff8f0f3e6c798df4c228f1d9039e6dc9054 | JavaScript | joaopaulosgomes/GTP_2021 | /Server/src/models/membership.model.js | UTF-8 | 2,765 | 2.765625 | 3 | [] | no_license | var dbConn = require('../../config/db.config');
var Membership = function(membership){
const date1 = membership.from_date;
const date2 = date1.split("T");
this.from_date = date2[0];
this.period = membership.period;
this.price = membership.price;
this.user_... | true |