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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0178f12d3cdc76f1416df27357ce1db72ef901e7 | JavaScript | jtgrenz/test_double_ocr_kata | /lib/parsed_account_number.js | UTF-8 | 1,579 | 3.390625 | 3 | [] | no_license | export default class ParsedAccountNumber {
constructor(account_number_array){
this.account_number_array = account_number_array;
this.account_number_string = account_number_array.join('')
}
is_valid() {
if(this._account_number_is_illegible()){ return false }
return this._calculate_checksum() === ... | true |
169fefb470aa966caf72013f60fdee7b1679380e | JavaScript | nehabo/React-Crosswords | /app/puzzle.js | UTF-8 | 1,213 | 2.546875 | 3 | [] | no_license | import _ from 'lodash';
import React from 'react';
import Template from './template';
require('./styles.css');
class Puzzle extends React.Component {
constructor(props) {
super(props);
this.onSubmit = this.onSubmit.bind(this);
}
onSubmit(data) {
if (_.isEqual(this.props.grid, data)) {
alert('... | true |
64ce56eea1e975a42bf1c14bd505dc95ce8703f7 | JavaScript | liuyu666/learning-demo | /牛客算法/原理/获取url参数.js | UTF-8 | 957 | 3.578125 | 4 | [] | no_license | // 获取 url 中的参数
// 1. 指定参数名称,返回该参数的值 或者 空字符串
// 2. 不指定参数名称,返回全部的参数对象 或者 {}
// 3. 如果存在多个同名参数,则返回数组
// http://www.nowcoder.com?key=1&key=2&key=3&test=4#hehe key
// [1, 2, 3]
let url = 'http://www.nowcoder.com?key=1&key=2&key=3&test=4#hehe key'
function getUrlDetail(url, key) {
let str = url.split('?')[1];
let params... | true |
674466b6a97ebbb0adfee02eb5a0b923ebfe8643 | JavaScript | maxdyy/ES6_practice | /classes.js | UTF-8 | 1,666 | 4.84375 | 5 | [
"MIT"
] | permissive | // ES6 introduced Classes, and we have two ways to create Classes.
class Person {
};
const Person = class {
};
// We are going to use the first one.
class Person {
// Inside our class we dont need to declare function
// with the function key word, the same as in new object
// literals. The constructor gets... | true |
50cc57cc716c40c3d0241844d5b1e468fce3b905 | JavaScript | kulturman/Golden-FX-Web-app | /backend/validation/util.js | UTF-8 | 939 | 2.671875 | 3 | [] | no_license | const { validationResult } = require('express-validator/check');
const getApiErrorsFormat = ({ location, msg, param, value }) => {
return {
field: param,
message: msg
}
}
const formatErrors = (errors) => {
if(errors.isEmpty()) {
return {}
}
const errorsAsAr... | true |
163a9568d5bbae5dc285ed924477c138e25c135f | JavaScript | team-siklab/pewpewpew-array | /webclient/src/components/TestForm/index.js | UTF-8 | 7,515 | 2.53125 | 3 | [] | no_license | import React, { Component } from 'react'
import { v4 as uuid } from 'uuid'
import { API_URL } from '../../config'
import './TestForm.css'
export class TestForm extends Component {
constructor (props) {
super(props)
this.state = {
TestId: uuid(),
targeturl: '',
rate: 10,
duration: 6... | true |
5e1610c40ecef0e6fb8a5a5f2104ec8f9802dd42 | JavaScript | KhanyisoHaman/khanyiso-desktop | /javascript/lecture5/js/functions.js | UTF-8 | 1,780 | 4.6875 | 5 | [] | no_license | // ===== functions ===== //
// A function is a group of instructions that performs a particular task.
function sayHello() {
console.log('Hello');
}
console.log('start of program');
sayHello(); //calling the function
console.log('End of program');
// declaring a function
// creating a function is cal... | true |
28e0bad776975a134126ccfbfe597802e851b0cc | JavaScript | skgandhi44/Vue-imdbAPI | /site.js | UTF-8 | 4,207 | 3.265625 | 3 | [
"MIT"
] | permissive | /* SITE.JS: THIS FILE CONTAINS THE METHODS/FUNCTIONS AND VARIABLES CONTROLLING YOUR SITE
//
*/
/* NOTE: MOVIES.JSON CONTAINS A LIST OF MOVIES AND ACCOMPANYING METADATA
//
// They are in the following format:
// title (String): the name of the movie
// iscore (Number): the IMDB score
// rating (String... | true |
ecb850814f0fa3f7be5ce8c283f5d25d63b77e0f | JavaScript | piyanshu/Frontend-Webd | /Understanding DOM/6_strict_mode/2_script.js | UTF-8 | 691 | 3.25 | 3 | [] | no_license | // 'use strict'
var box = document.getElementById('box');
var clickCount = document.getElementById('click-count');
// At this line if we do not write var it dont give any error. Javascript automatically creates the global variable
count = 0;
box.addEventListener('click', function(){
// At this line also javascript ... | true |
86c4ed08d14673b45aa2b88d6f88adfd1197cd48 | JavaScript | h2oboi89/nlox | /src/parsing/Expression/Grouping.js | UTF-8 | 492 | 2.859375 | 3 | [] | no_license | 'use strict';
/**
* Represents a node in the AST.
* @memberof parsing
*/
class GroupingExpression {
/**
* Creates a new GroupingExpression.
*/
constructor(expression) {
this._expression = expression;
}
get expression() {
return this._expression;
}
/**
* Accepts a visitor.
* @param ... | true |
dcd89112870c1f4b586356b49417cf18b29f0791 | JavaScript | dschnelzer/keycloak | /admin-ui/src/main/resources/META-INF/resources/admin/js/controllers.js | UTF-8 | 647 | 2.75 | 3 | [] | no_license | 'use strict';
var module = angular.module('keycloak.controllers', [ 'keycloak.services' ]);
Array.prototype.remove = function(from, to) {
var rest = this.slice((to || from) + 1 || this.length);
this.length = from < 0 ? this.length + from : from;
return this.push.apply(this, rest);
};
function randomSt... | true |
d2ae744f7bb7d9d3bb680d6c7a0134746e571f44 | JavaScript | rblalock/es6_titanium_classic | /src/layout_prototype/views/example.js | UTF-8 | 818 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | var BaseView = require('./baseView');
/**
* Example view class
*/
class ExampleView extends BaseView {
constructor() {
super();
this.parent = Ti.UI.createWindow({
backgroundColor: '#eee',
layout: 'vertical'
});
this.fullName = Ti.UI.createLabel({
top: 10,
left: 10,
right: 10,
width: Ti.UI.... | true |
c02b9848a4a22ad746040a61ad2b7dcd4514a4e6 | JavaScript | gprocell927/walker-texas-rangerbox | /src/components/App/App.js | UTF-8 | 1,689 | 2.75 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios'
import { browserHistory } from 'react-router'
import RandomJokes from '../RandomJokes/RandomJokes'
import DisplayJokes from '../DisplayJokes/DisplayJokes'
import './App.css';
class App extends Component {
constructor(props){
super(props)
thi... | true |
296fe98846cb9efbd4a3c0e436126bbe727527d9 | JavaScript | srikanthj09/keditor | /dist/js/kaudio-component-1.1.1.js | UTF-8 | 4,905 | 2.578125 | 3 | [
"MIT"
] | permissive | /**
* Created by Anh on 2/23/2016.
*/
(function ($) {
var KEditor = $.keditor;
var flog = KEditor.log;
var error = KEditor.error;
$.keditor.components['kaudio'] = {
/**
* Function will be called when initializing a component with this type
* @param {jQuery} contentArea
... | true |
cd6c239a730270f4c4c5ebabd38c129e03384a29 | JavaScript | pckz/poliglota-demo-frontend | /src/actions/userActions.js | UTF-8 | 2,923 | 2.609375 | 3 | [] | no_license | import {
GET_USERS,
SET_LOADING,
USERS_ERROR,
ADD_USER,
DELETE_USER,
SET_CURRENT,
CLEAR_CURRENT,
UPDATE_USER,
SEARCH_USERS,
GET_LOCATIONS
} from "./types";
import api from '../utils/api';
// GET USERS
export const getUsers = () => async dispatch => {
try {
setLoading();
const res = await... | true |
8777fde5ffdaa93fbc1d34b5fbff2745a2e1e9ed | JavaScript | MaliScheuer/capstone-project | /client/src/lib/validateFunctions.js | UTF-8 | 1,474 | 3.1875 | 3 | [] | no_license | export const isValidMentorName = (name) => {
const letters = /^[A-Za-z_äÄöÖüÜß ,.'-]+$/i;
if (name.length >= 2 && name.match(letters)) {
return true;
} else {
alert("Enter your right name");
return false;
}
};
export const isValidCompetence = (competence) => {
if (competence !== "") {
return ... | true |
d6477508016fd78b49c71d777824c9b69790a17e | JavaScript | o-deryabin/oxemtest | /src/store/modules/users.js | UTF-8 | 4,440 | 2.9375 | 3 | [] | no_license | import Axios from "axios";
export default {
actions: {
async fetchUsers({ commit }, value) {
try {
// Получаем данные таблицы
const sizeData = {
big:
"http://www.filltext.com/?rows=1000&id={number|1000}&firstName={firstName}&delay=3&lastName={lastName}&email={email}&ph... | true |
fdf28d71c09913792ca3ded3f878cb295e5ee158 | JavaScript | mozilla/gecko-dev | /devtools/client/webconsole/test/browser/sjs_cors-test-server.sjs | UTF-8 | 5,674 | 2.8125 | 3 | [
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
function handleRequest(request, response) {
const params = new Map(
request.queryString
.replace("?", "")
.split("&")
.map(s => s.split("="))
);
if (!params.has("corsEr... | true |
2c90a11c507889fa06bad49c2e9a6bab87a0cb5f | JavaScript | joebartels/quickoa | /tests/utils/arrays-test.js | UTF-8 | 603 | 2.640625 | 3 | [
"MIT"
] | permissive | const requiring = require('requiring').sync;
const {
camelize
} = requiring('utils/arrays');
const {
mapCompact
} = requiring('utils/arrays');
const { assert } = require('chai');
describe('utils/array.js', function() {
describe('#mapCompact', function() {
it('filters null values', function() {
let... | true |
02bf7f6dfc4a18106348c7723ec07b24339cf035 | JavaScript | CodingDojoTulsaMay2018/claire_elliott | /mean/express/group-chat/server.js | UTF-8 | 2,095 | 2.5625 | 3 | [] | no_license | const express = require("express");
var session = require('express-session');
var app = express();
// var ses = express-session();
const path = require("path");
const bodyParser = require('body-parser');
const server = app.listen(7084, function () {
console.log("listening on port 7084");
});
app.use(express.static(path... | true |
2d4f6fc580deab525c883eb0c9c1796d06674e3e | JavaScript | FedeIII/crypto-wallet | /src/utils/formatCoin.js | UTF-8 | 563 | 2.6875 | 3 | [] | no_license | import {roundTwoDecimals} from 'utils/numbers';
import {USD, EUR, GBP} from 'src/constants';
export function formatVariation (variationRatio) {
if (variationRatio === 0) return '';
const sign = variationRatio > 0 ? '+' : '';
return sign + roundTwoDecimals(variationRatio * 100) + '%';
}
const symbolFormat... | true |
e823fa2cfc375670ad7c2ad6cf979797d107f2fa | JavaScript | AAI-USZ/FixJS | /input/100+/after/ec1e74780dd7fd160ec2842a51d01bb217b23cd7_1_1.js | UTF-8 | 1,140 | 2.796875 | 3 | [
"MIT"
] | permissive | function() {
var m = mm.match;
var a = [1,2,[{x: 5}], 'string', function (x) { return x*x }];
expect(m(a, {
'_@a': function () {return this.a.length === 5}
})).toBe(true);
expect(m(a, {
'a': 'return true'
})).toBe(true);
expect(m(a, {
'... | true |
879b14037c0a92fcb75cdeac3cff2015b987d2f5 | JavaScript | jiang-bx/designMode | /chapter10/10.js | UTF-8 | 2,200 | 3.421875 | 3 | [] | no_license | /**
* 组合模式
* 组合模式是将对象组合成树形结构, 以表示 "部分-整体" 的层次结构,
* 再者, 利用对象的多态性统一对待组合对象和单个对象.
* (感觉这就是 javascript 鸭子类型, 或者说多态, 就是javascript 的特点.)
* 理解: 为了表示一堆 层次结构的东西. 将其组合起来.
* 注意点: 组合模式不是父子关系,
* 对叶对象操作的一致性,
* 双向映射关系
* 利用职责链模式提高组合模式性能.
*/
/**
* 扫描文件夹
*/
function test1() {
/* * * * * * 文件夹(Folder) * * * * * * */
... | true |
a1865a448ffbcf35c15c37239525ec10571141f1 | JavaScript | nadiiamein/javascript-teoria | /06_object.js | UTF-8 | 2,207 | 3.46875 | 3 | [] | no_license | //object
const person = {
name: 'Nadui',
age: 45,
isProgrammer: true,
languages: ['ru', 'ua', 'de', 'en'],
'complex key': 'Complex Value',
['key_' + (1+3)]: 'Computed key',
greet() {
console.log('greet from person');
},
info() {
console.info('Information uber persone... | true |
ec3e53836c31a46fae50c8d65cc4cac7f8292c20 | JavaScript | ayubova/codewars | /05-07-exes-and-ohs.js | UTF-8 | 421 | 4.40625 | 4 | [] | no_license | // Check to see if a string has the same amount of 'x's and 'o's. The method must return
// a boolean and be case insensitive. The string can contains any char.
function XO(str) {
const totalX = str.toLowerCase().split('').reduce((acc, value) => (value === 'x' ? acc + 1 : acc), 0);
const totalO = str.toLowerCase()... | true |
50f518009796a9c89a9a4f1d7b7c8bb06662b680 | JavaScript | hyongti/javascript-problem-solving | /programmers/removeByPair.js | UTF-8 | 822 | 3.90625 | 4 | [] | no_license | function solution(s) {
const arr = [];
let index = 0;
while (index < s.length) {
if (arr.length === 0 || arr[arr.length - 1] !== s[index])
arr.push(s[index]);
else
arr.pop();
++index;
}
if (arr.length === 0)
return 1;
else
return 0;... | true |
303b58af589293250b36aeabdd167295503a793a | JavaScript | stogashi146/SkillUp-JavaScript | /review/2/app.js | UTF-8 | 156 | 3.359375 | 3 | [] | no_license | // let hello = "Hello World"
// alert(hello);
let int1 = 1;
let int2 = 10;
alert(int1 + int2);
alert(int1 - int2);
alert(int1 * int2);
alert(int1 / int2); | true |
9b8342c47b2f3a7afc9dc7fc948e0fa373dfa2d3 | JavaScript | zap10/TheElectricFire.github.io | /JS/Audio.js | UTF-8 | 1,281 | 2.765625 | 3 | [] | no_license | var host = "theelectricfire.github.io";
if (window.location.host === host && window.location.protocol !== "https:") {
window.location.protocol = "https:";
}
var audioList = ["476128", "153594", "383793", "476613"];
var audioVol = 1;
var activeAudio = 0;
function playAudio() {
"use strict";
document.getEle... | true |
34ee21971e3173ee2c2f26c1d94f0ff036c27205 | JavaScript | tlindow/interviewCake | /wordCloudData/wordCloudData.js | UTF-8 | 1,901 | 3.390625 | 3 | [] | no_license | class WordCloudData {
constructor(inputString) {
this.wordsToCounts = new Map();
this.populateWordsToCounts(inputString);
}
populateWordsToCounts(inputString) {
const words = splitWords(inputString);
for (let i = 0; i < words.length; i++) {
addWordToHash.call(this, words[i]);
}
retu... | true |
5b728214a9d9b7d08b9c186e74367703086250ab | JavaScript | alanhc/drum.io | /public/serial.js | UTF-8 | 1,244 | 3.421875 | 3 | [] | no_license |
let serial="/dev/ttyACM0";
let latestData = "waiting for data";
function initSerial() {
serial = new p5.SerialPort();
serial.list();
serial.open("/dev/ttyACM0");
serial.on('connected', serverConnected);
serial.on('list', gotList);
serial.on('data', gotData);
serial.on('error', gotError);
serial.o... | true |
cf39bd5f22841f1d054eee065bc48b9d16678d64 | JavaScript | g-ram84/lotide-2 | /tail.js | UTF-8 | 443 | 3.65625 | 4 | [] | no_license | const assertEqual = (actual, expected) => {
if (actual === expected) {
console.log(`✅✅✅Assertion passed: ${actual} === ${expected}`)
} else {
console.log(`❌❌❌Assertion failed: ${actual} !=== ${expected}`)
}
}
const tail = (arr) => {
return arr.slice(1);
}
const words = ['Yo Yo', 'Lighthouse', 'Labs'];... | true |
d1de22ad317a36ef45153371c2dfebd4ca1aebbe | JavaScript | atuhaic/frontendpage | /chris.js | UTF-8 | 340 | 2.921875 | 3 | [] | no_license | function welcome(){
let username=document.getElementById("username").value;
let password=document.getElementById("pass").value;
if(username ==""){
prompt(" Please input username");
}
else if( password ==""){
prompt("Please enter your full password")
}
else{
window.open("c... | true |
5cb9096c1458f5ce6c8c1c37164a34404304196a | JavaScript | rosario-vandebron/happinessTool | /public/javascripts/happiness.js | UTF-8 | 2,371 | 3.421875 | 3 | [
"MIT"
] | permissive | var sad_canvas = document.getElementById("sad");
var happy_canvas = document.getElementById("happy");
var ws = MyWebSocket();
makeHappiness(sad_canvas, false);
makeHappiness(happy_canvas, true);
function drawSmile(ctx, level){
var width = 54
var x = 95 - width/2
var hsmooth = 10
var ysmooth = level*2*hsmooth ... | true |
af25b673f1ec24c2f849f37df57f34828c4394f1 | JavaScript | MfKrp/Border-Radius-Previewer | /main.js | UTF-8 | 4,985 | 3.859375 | 4 | [] | no_license | //Captura de variables y elementos que se van a utilizar y modificar
const box = document.querySelector("#stylised-box"); //contenedor a modificar
const topLeft = document.querySelector("#upper-left-side");
const topRight = document.querySelector("#upper-right-side");
const bottomLeft = document.querySelector("#l... | true |
4c3a43e007b387caa642ed83430e96766967ad13 | JavaScript | theghost1980/google-homepage | /js/bio-website.js | UTF-8 | 4,237 | 2.546875 | 3 | [] | no_license | const _arBookPaths = ['https://www.academia.edu/34599636/MANUAL_DE_SEMIOTICA','https://www.academia.edu/29176659/Cuerpo_y_discurso_cinco_ensayos_sobre_la_construcci%C3%B3n_social_del_sentido','https://www.academia.edu/9103998/IMAGOLETRAGRAFIA_Manual_de_semiotica_gr%C3%A1fica_y_visual'];
const _arFileNames = ['MANUAL_DE... | true |
f127307e4b566e481f13157bde47149227c3fafb | JavaScript | joemsak/gray-matter-lumber--preview | /models/report.js | UTF-8 | 530 | 2.875 | 3 | [] | no_license | class Report {
constructor(cardHolders) {
this.cardHolders = {}
Object.keys(cardHolders).sort().forEach(name => {
this.cardHolders[name] = cardHolders[name]
})
}
printSummary () {
console.log("")
Object.keys(this.cardHolders).forEach(name => {
const card = this.cardHolders[name]... | true |
2c67845fb92db27ad88a6654c22d6d039ce61e6f | JavaScript | yhc111/CrowdSharing-WeSense | /src/main/resources/static/js/userNameCookie.js | UTF-8 | 396 | 2.90625 | 3 | [] | no_license | $(function(){
var UsernameInfo = document.getElementById("UsernameInfo");
//var RoleInfo = document.getElementById("RoleInfo");
var arr=document.cookie.split(";");//获取cookie字符串并分割
//遍历匹配
for(var i=0; i<arr.length; i++){
var a = arr[i].split("=");
if(a[0].trim() == "userName"){
UsernameInfo.innerHTML = a[1];... | true |
0e344743e0c9d8c5098aa242f374632c640ffef2 | JavaScript | suleimansultanov/krista | /KristaShop.WebUI/wwwroot/js/CModel/Edit.js | UTF-8 | 796 | 2.515625 | 3 | [] | no_license | function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
$('#Image-img').attr('src', e.target.result);
}
reader.readAsDataURL(input.files[0]);
}
};
$("#Image").change(function () {
readURL(this)... | true |
6065b96ee82fa3388beecc79e5d496d25ce546d5 | JavaScript | velalejandro/Proyecto_TIC_Grupo_1 | /servidor/controllers/product.js | UTF-8 | 2,821 | 2.5625 | 3 | [] | no_license | const { response } = require('express');
const Categoria = require('../models/Category');
const Producto = require('../models/Product');
/** getProductos */
const getProducts = async( req, resp = response ) => {
// const productos = await Producto.find();
// const productos = await Producto.find()
//... | true |
84805bb8422b93f0fb3de9cdf9559e6390f09972 | JavaScript | lllllllllwith10ls/miratope | /src/main.js | UTF-8 | 739 | 2.953125 | 3 | [
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | //Configure OFF import button.
document.getElementById('file-input').addEventListener('change', Polytope.openFile, false);
//Basic variables. Should probably be put in a class in the future.
var P; //Temp variable. OFF imports to here.
//A small number, used as a threshold for certain rendering operations.
//Should p... | true |
1774133da2867fa41c618d8ff19a4fb4f30259df | JavaScript | EStellara/Previous-Work | /Individual Projects/Conway's Game of Life/life.js | UTF-8 | 3,889 | 2.78125 | 3 | [] | no_license | class Life{
m_cell;
m_boardSize;
m_grid;
isDone = false;
constructor(size){
this.m_boardSize = size;
let conf = new Config();
this.m_cell = conf.cell;
this.m_grid = new Grid(this.m_boardSize);
let output = "";
document.getElementById... | true |
0f5693c4acf76417c02138d2eb1413c42c56e278 | JavaScript | mdchristians/pullstart | /cli.js | UTF-8 | 3,978 | 2.625 | 3 | [] | no_license | #!/usr/bin/env node
const qoa = require('qoa');
const fs = require('fs-extra');
const path = require('path');
const os = require('os');
const {
createReduxActions,
createReduxReducer,
createReduxTypes,
createComponentIndex,
createComponentScss,
createFunctionalComponent,
createConnectedComponent,
createCompon... | true |
a5981ed5072ab9ce28411aca07d8612f3d9cd1c9 | JavaScript | sylvamadu/Javascript-Client-Side-Form-Validation | /app.js | UTF-8 | 6,072 | 3.140625 | 3 | [] | no_license | const form = document.querySelector("#form")
const usernameEl = document.querySelector("#Username")
const emailEl = document.querySelector("#Email")
const passwordEl = document.querySelector("#Password")
const confirmPasswordEl = document.querySelector("#ConfirmPass")
const info = document.querySelector('.info')
form... | true |
dfd1fe85c6ba6c4d70226b7d7bf4b8aa26518072 | JavaScript | DannyWhyte/jeanStationApi | /api/controllers/cartCounter.js | UTF-8 | 2,404 | 3.046875 | 3 | [] | no_license | /*
* Functin to get count of total items in cart of a user.
* Input userID from session
* Output count of total items
*/
let getCountClass = class getCount {
func(input) {
let deferred = q.defer();
let query = ` select count(1) as total_items from cart where is_active = true and user_id = ${in... | true |
e72c8400735197803478ebdcaf3bc6db6637245b | JavaScript | success-hexiangdong/subeeeee | /reactProject/src/components/common/CSpan.js | UTF-8 | 1,173 | 2.53125 | 3 | [] | no_license | /*
* Copyright (c) 2018-present, 网信智投, Inc.
*
* @Author: Jone.Lin
* @Date: 2018-08-10 15:07:40
* @Last Modified by: Jone.Lin
* @Last Modified time: 2018-10-23 14:35:26
* @Note 带防重复点击的div
*/
import React, { Component } from 'react'
const CLICK_INTERVAL = 300 //点击间隔
/**
* 组件
*
* @export
* @class CSPan
* @e... | true |
80cdc5ec0400987f24a38074f8593a7365b013e6 | JavaScript | ssht3jsbkk/Different-JS-Examples | /tabletask.js | UTF-8 | 898 | 3.078125 | 3 | [] | no_license | var arr = people['Chris',
'Nicola',
'Sonjeet',
'Sarah',
'Ash'];
var items = Array('Chris', 'Nicola', 'Sonjeet', 'Sarah', 'Ash');
var item = items[Math.floor(Math.random() * items.length)];
var newPerson = name;
function addPlayer() {
var counter = 0;
return function Person(name) {
this.name = name;
... | true |
7646a97ffcf0c3e1001ad28ef6a6b7c9e072d2c8 | JavaScript | BeamMW/beam | /wallet/unittests/api_client/test_wallet_status.js | UTF-8 | 861 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | var net = require('net');
var client = new net.Socket();
client.connect(10000, '127.0.0.1', function() {
console.log('Connected');
client.write(JSON.stringify(
{
jsonrpc: '2.0',
id: 123,
method: 'wallet_status',
params: {}
}) + '\n');
});
client.on('data', function(data) {
console.log('Received: ' ... | true |
3b76a1975264f2a9cac9c60c255e53665d0e25c7 | JavaScript | mshobeyri/PaymentFilesEditor | /utils.js | UTF-8 | 1,045 | 2.859375 | 3 | [
"MIT"
] | permissive | function pad(num, size, character) {
var schar = "0"
if(character!==undefined)
schar = character
var s = num+"";
while (s.length < size) s = schar + s;
return s;
}
function numberWithCommas(x) {
x = x.toLocaleString('fullwide', {useGrouping:false})
var pattern = /(-?\d+)(\d{3})/;
... | true |
857ec7ecc25c562e58dd4847a4bc45d06acc6bc5 | JavaScript | ThinkerOfJS/tgbk | /public/utils/dict.js | UTF-8 | 1,405 | 2.921875 | 3 | [] | no_license | /*
* @Author: TingGe
* @Date: 2021-05-26 14:14:18
* @LastEditTime: 2021-05-27 14:51:48
* @LastEditors: TingGe
* @Description: 字典 懂的都懂
* @FilePath: /ting_ge_blog/public/utils/dict.js
*/
import _ from 'lodash';
/**
* @description: 编译字典
* @param { path, value isRe}
* @return { result }
*/
export const filters... | true |
7716aebb0290549e341b37f5b7eccc56692f94fa | JavaScript | JohanaC-137/Evalucion-Css | /pruebas.js | UTF-8 | 2,000 | 2.609375 | 3 | [] | no_license | $(document).ready(function() {
//.data
$("#btnagregar").click(function(){
$("#parrafo").append("<br>");
$(function() {
"use strict";
var boton = $("#btnbusca2");
var resultado = $("#valor");
var input = $("#source");
boton.on("click", function() {
var valor = input.val()
... | true |
ff2132daf02d2354f395bf113d05e2b8e73e2148 | JavaScript | yoojeonghan/algorithm | /javascript/pascalTriangle2/index.js | UTF-8 | 757 | 4.03125 | 4 | [] | no_license | /*
Given an integer rowIndex, return the rowIndexth row of the Pascal's triangle.
Notice that the row index starts from 0.
In Pascal's triangle, each number is the sum of the two numbers directly above it.
Follow up:
Could you optimize your algorithm to use only O(k) extra space?
*/
/**
* @param {number} rowIn... | true |
cf89910d074d7d2186a6f252770243c04235df38 | JavaScript | Andre706/server_notificacao | /app.js | UTF-8 | 951 | 2.640625 | 3 | [
"MIT"
] | permissive | var express = require('express');
const app = express()
const cors = require('cors');
const fetch = require('node-fetch')
app.use(cors());
app.use(
express.urlencoded({
extended: true
})
)
app.use(express.json())
const PORT = process.env.PORT || 9940
async function sendPushNotification(title,body, token) {
... | true |
e9a4afbfc9efc2c2192d16a46b9e5e105e9746cc | JavaScript | thefubit/CIRCGame | /src/app.js | UTF-8 | 35,238 | 2.734375 | 3 | [] | no_license | //CIRC - Main Game LAyer
//to check whether the layer already exists - prevents duplicates
var GAMEINITIALIZED = false;
//initializing the speed of the satellites
var levelInner = 0;//controlling level of inner satellite
var speedInner = 0;//controlling the speed of inner satellite
var levelOuter = 0;//controlling l... | true |
f09274614eb4d80933221381f3512bd0170d98d8 | JavaScript | egandunning/trms-2 | /src/main/webapp/js/register.js | UTF-8 | 2,987 | 3.234375 | 3 | [] | no_license | "use strict";
window.onload = function() {
populateDepartments();
}
function populateDepartments() {
let dropdown = document.getElementById("department");
let xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if(xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr.responseText);
a... | true |
d117757db25d3123d22c5ff1e9e0444392a14296 | JavaScript | lucasrodrigues10/lifeofcards | /pages/jogo.js | UTF-8 | 2,529 | 2.640625 | 3 | [] | no_license | var game = new Phaser.Game(416, 448-64, Phaser.AUTO, 'center', { preload: preload, create: create, update: update},false,false);
function preload () {
loadAssets(); //carrega os assets necessários
}
function create (){
jogador1= {
vida:25,
cartas:0... | true |
b211ef77b77e98e9a9b61627550d6c3192ec4a90 | JavaScript | manoj6587/VulnerableWebApps | /subresource-integrity/html/function.js | UTF-8 | 195 | 2.703125 | 3 | [] | no_license | function displayDate()
{
document.getElementById("demo").innerHTML=Date();
}
window.onload = function() {
var btn = document.getElementById("myButton");
btn.onclick = displayDate;
}
| true |
d90f71f109fd42da25e99b5800ff2b26966ed08d | JavaScript | Science-for-Nature-and-People/hydraulic-fracturing | /webapp/scripts/CreateMaterialWordCloud.js | UTF-8 | 2,632 | 3.25 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | //prior to loading make sure to sort in descending order and filter those less than twice
function createMaterialWordCloud(filterData){
wordData = filterData;
//lop through and count number of words
var objectsDetails = {};
$.each(wordData, function(i,e){
objectsDetails[this.material_detail] = (ob... | true |
a940b83cda30e5f74cb479fdba2a0f840f4bcf08 | JavaScript | seanmart/mobilityAcceptance | /assets/scrollBuddy/utils.js | UTF-8 | 1,173 | 2.609375 | 3 | [] | no_license | export function lerp(start, end, amt){
return (1 - amt) * start + amt * end
}
export function getTranslate(el) {
const translate = {}
if(!window.getComputedStyle) return;
const style = getComputedStyle(el);
const transform = style.transform || style.webkitTransform || style.mozTransform;
if (... | true |
590e6f4483c1aeb4cd1f621638cc1ee38ca097f5 | JavaScript | yxmg/typescript-learning | /session-2/数组和元组.js | UTF-8 | 680 | 3.09375 | 3 | [] | no_license | "use strict";
/**
*Created by 夜雪暮歌 on 2021/3/15
**/
// 数组相关类型
// 1、多类型数组声明,用「()」包裹,用「|」隔开
var arr = ['1', 1, 2];
var objArr = [{ name: 'yxmg', age: 24 }];
// 3、TS对类的判断不限于instanceof,数据结构一致也视为同类型
var Person2 = /** @class */ (function () {
function Person2() {
this.name = '';
this.age = 0;
}
... | true |
84fc3b67ea9c17a977d78380ce0a2ad432340c59 | JavaScript | Aseem123/react | /src/challange/react-fragment.js | UTF-8 | 687 | 2.78125 | 3 | [] | no_license | import React from 'react'
import ReactDOM from 'react-dom'
const root = document.querySelector('#root')
ReactDOM.render(
<React.Fragment>
<h1>Important Notes</h1>
<p>
1. while using render we cannot use multiple element so we use div or
React.fragment
</p>
<p>
2. while using div to ... | true |
527716a34d363443d36a6daae66a876fa2058236 | JavaScript | ke-liang-liu/calculator | /src/App.js | UTF-8 | 8,279 | 2.515625 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import Typography from '@material-ui/core/Typography';
import Divider from '@material-ui/core/Divider';
import Button from '@material-ui/core/Button';
import HistoryIcon from '@material-ui/icons/History';
import BackspaceOutlinedIcon from '@material-ui/icons/Backspace... | true |
fad54fc9e9e129d59a7300fcb00b0b78bb03cd4c | JavaScript | elas7/monotron-duo-multiplayer | /app/widgets.js | UTF-8 | 10,021 | 2.65625 | 3 | [] | no_license | import $ from 'jquery';
import { getCursorPosition, convertRange, clamp, mean} from './utils/client'
import { qwertyMidiMap } from './lib/keyboard'
/*
* KNOB
*/
export var Knob = function(element, local) {
Knob.knobs.push(this);
this.element = element;
this.parentDiv = $(element).closest('div.monotron'... | true |
8069562c4ff94ab80542854d6104ff629acfb718 | JavaScript | travis4all/doodle | /lib/doodle-server.js | UTF-8 | 2,229 | 2.609375 | 3 | [
"MIT"
] | permissive | (function() {
var WebSocketServer, app, delay, fs, here, http, make, path, repeat, show, time, watchDir, watchFile, watchPath, wss;
fs = require('fs');
http = require('http');
path = require('path');
show = console.log;
repeat = function(t, f) {
return setInterval(f, t);
};
delay = function(t,... | true |
24f88325b9fc7af504a92a8534a42bec0a8ff17f | JavaScript | burunkus/2D-drawing | /scripts/index.js | UTF-8 | 8,510 | 3.15625 | 3 | [] | no_license | let program = new ShapeDistanceProgram();
console.log(program);
console.log(program.shape1);
console.log(program.shape2);
/**points in UI are 3 by default. so update points array
which ensures min(1) and max(10) points aren't exceded
**/
for(let x = 0; x < 3; x++){
program.shape1.addPoint();
program.shape2.addPoint()... | true |
1804649ed07995c44247f31475376ae5e13ab7a3 | JavaScript | MateuszLeo/adventofcode | /1/1.js | UTF-8 | 847 | 2.96875 | 3 | [] | no_license | function add(a, b) {
return a + b;
}
function sumArray(items) {
return items.reduce(add)
}
function findFirstDuplicate(items) {
function rec(sum, sums, index) {
if (sums.has(sum)) {
return sum;
}
if (index === items.length) {
index = 0;
}
... | true |
f732f50e00c17f4cb5690598eefc780e2354aeda | JavaScript | cog2010/Local-Weather-API | /script.js | UTF-8 | 1,085 | 2.984375 | 3 | [] | no_license | $(document).ready(function() {
var lat;
var long;
var tempf;
var tempc = (tempf - 32) * (5 / 9);
var temp;
var html = "";
//new api used for https
$.getJSON("https://ipapi.co/json/", function(lldata) {
lat = lldata.latitude;
long = lldata.longitude;
//New Open Weather API used for https
... | true |
962dc9abadf6d3f185b7095159281699d3302b62 | JavaScript | flynnforester/flynnforester.github.io | /projects/class exercises/jquery/assets/js/main.js | UTF-8 | 427 | 2.578125 | 3 | [] | no_license | $(function() {
let colors = ["seagreen", "coral", "darkgreen", "gold", "violet"];
let i = 0;
$(".circle").click(function() {
$(this).toggleClass("dropshadow off");
$(this).css("background-color", colors[i]);
if (i >= colors.length - 1) {
... | true |
2cd16ac32f0e34511f4dd8408e0e390ce24b7003 | JavaScript | alishoja88/Weather-Forecast | /src/components/Forecast/ListWeatherHours.jsx | UTF-8 | 1,877 | 2.578125 | 3 | [] | no_license | import React from 'react';
import WeatherinfoHors from './WeatherinfoHors'
const ListWeatherHours = (props) => {
const { weatherData } = props
// console.log("weatherData", weatherData);
// let day = new Date(weatherData[0].dt_txt);
// let hour = day.getHours()
// let lengthTime = (24 - hour) / 3... | true |
6344c99beca7d17c8032db41e09ed321cb89a557 | JavaScript | luoxinwhu/BAIDU-LESSON | /treeModule/treeModule.js | UTF-8 | 10,126 | 2.875 | 3 | [] | no_license | /**
* Created by LX on 2017/7/9.
*/
//=====================================================//
// treeNode 类封装 //
//=====================================================//
function treeNode(obj) {
this.parent = obj.parent;
this.childs = obj.childs || [];
this.data = o... | true |
c6b7df02f760e25e975c774aa53c6868d9c9a663 | JavaScript | ym-jackeroo/e_home-app | /e_home/src/utils/base64.js | UTF-8 | 537 | 2.75 | 3 | [] | no_license | function base64(e) {
// 利用fileReader对象获取file
var file = e.target.files[0];
var filesize = file.size;
var filename = file.name;
// 2,621,440 2M
if (filesize > 2101440) {
// 图片大于2MB
}
var reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = function (e... | true |
ca7337f55179fbd87f61647694858fd2ad328b6b | JavaScript | luaye/resistats | /static/js/view.js | UTF-8 | 8,393 | 2.5625 | 3 | [] | no_license |
var playerSlotTemplate;
var gameRowTemplate;
var gameRows;
var dateNowCheckbox;
var datePicker;
var gameRowClass = ".gameRow";
function initView()
{
playerSlotTemplate = $("#playerSlotTemplate");
playerSlotTemplate.remove();
gameRows = $("#gameRows");
gameRowTempla... | true |
9abe09e69482b113b810a834d5162b3769d1b281 | JavaScript | Agarriol/Groceries_front | /src/js/components/example/index.js | UTF-8 | 2,504 | 2.5625 | 3 | [] | no_license | import template from './index.pug';
import { assertNullLiteral } from 'babel-types';
// TODO, BORRAR TODO
export default Vue.extend({
template: template(),
data() {
return {
name: null,
email: null,
password: null,
passwordConfirm: null,
errors: [],
errorsVar: {
nameH... | true |
333a8fa05526f1b0371fe765fd775cd68f991b0d | JavaScript | desito07/JS-Fundamentals---May-2020 | /Final_Exam/2_Message Encrypter.js | UTF-8 | 1,214 | 2.859375 | 3 | [] | no_license | function solve(input){
let num = input.shift();
// console.log(num);
for(let line of input){
let pattern = /([\*\@])(?<tag>[A-Z][a-z]{2,})\1:[ ]\[(?<group1>\w)\]\|\[(?<group2>\w)\]\|\[(?<group3>\w)\]\|/g;
let match = pattern.exec(line);
if(match){
let tag = ... | true |
65b0c18d2671884889234fee372af7b22a3f3fbf | JavaScript | daandvs/otorace | /app/scripts/core/core.sandbox.js | UTF-8 | 1,139 | 3.046875 | 3 | [] | no_license | function CoreSandbox() {
// turning arguments into an array
var args = Array.prototype.slice.call(arguments),
// the last argument is the callback
callback = args.pop(),
// modules can be passed as an array or as individual parameters
modules = (args[0] && typeof args[0] === 'string') ? args : args[0],
i;... | true |
27c77b1300086db5ede314989a7630975805d1fb | JavaScript | oricalvo/course-hpe-advng-2016-09 | /01 JavaScript/10 Classes with ECMA6/test.js | UTF-8 | 204 | 2.90625 | 3 | [] | no_license |
var pt1 = new PointEx(5, 10, 20);
var pt2 = new PointEx(10, 20, 40);
pt1.dump();
pt2.dump();
console.log(pt1 instanceof PointEx);
console.log(pt1 instanceof Point);
console.log(pt1 instanceof Object);
| true |
3acf380db8ee4466516f91b5fd20caf7e25eb5a7 | JavaScript | kazmisimran/portfolio | /src/jsx/home.jsx | UTF-8 | 1,142 | 2.765625 | 3 | [] | no_license | import React, { useState, useEffect } from "react";
import ReactDOM from "react-dom";
import Typist from "react-typist";
import Footer from './footer.jsx';
import Cadre from './cadre.jsx';
export default function Home() {
const [count, setCount] = useState(1);
useEffect(() => {
// document.title = `Y... | true |
a046298af2735653114186de5781a03c9007dcc1 | JavaScript | jpcamba/TVXQinManila | /script.js | UTF-8 | 1,608 | 2.546875 | 3 | [] | no_license | $(function() {
var isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
if (isMobile) {
$('.modal-content').css('margin', '35% auto');
}
});
$(document).click(function(event) {
if (event.target.id === 'seat-view') {
$('#s... | true |
cbcd411e8646d5eefd13566f5f845c0ef93e83ee | JavaScript | dustinpfister/test_mathjs | /demos/s3_pow/mathjs_pow.js | UTF-8 | 170 | 3.390625 | 3 | [] | no_license | let math = require('mathjs');
let base = 2,
exp = 3,
n = math.pow(base,exp); // 8
console.log( math.log(n,base) ); // 3
console.log( math.log(n,base) === exp ) // true
| true |
aabd3ea5c34c23abe323d10f37a293fe25ef7587 | JavaScript | annd16/jsramverk-me-app | /src/DatePicker/DatePicker3.js | UTF-8 | 6,097 | 2.703125 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import CalendarBody from '../Calendar/CalendarBody.js';
import CalendarCtrl3 from '../Calendar/CalendarCtrl3.js';
import { isDate, getLocalDateInISOformat } from '../Calendar/functions.js';
class DatePicker3 extends React.Component {
constructor(p... | true |
1838eda69e120fb66a764a6b5a839695dbb78f19 | JavaScript | THISS/colordar-final-project | /client/src/js/reducers/reducer-groups.js | UTF-8 | 1,403 | 2.578125 | 3 | [] | no_license |
import {
GET_MY_GROUPS,
GET_GROUP_BY_ID,
GET_GROUP_BY_ID_WITH_USERS,
ADD_ME_TO_GROUP,
ADD_USERS_BY_EMAIL,
POST_GROUP,
UPDATE_GROUP
} from '../actions/group-actions';
const initialState = {
groups: [],
selected: null,
error: null
};
export default function(state=initialState, action) {
const rep... | true |
10b61febbd34e5987530d0e692ba27c3c8f61c1d | JavaScript | vguerrerobosch/advent-of-code-2019 | /day9/intcode.test.js | UTF-8 | 674 | 3.09375 | 3 | [] | no_license | const test = require('ava')
const { intcode } = require('./intcode')
test('quine', t => {
let program = '109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99'
let output
[program, output] = intcode(program, null)
t.is(output.toString(), '109,1,204,-1,1001,100,1,100,1008,100,16,101,1006,101,0,99')
})
te... | true |
96cb537ea1520aa2ba4d9253ea79bc26e702dcd3 | JavaScript | emcelyea/key-charts | /public/gantt/draw/team-drawer/team-drawer.js | UTF-8 | 237 | 2.640625 | 3 | [] | no_license | /*
* Team Draw class
* Takes a team data object and a canvas and
* renders the timeperiod to the screen
*/
function TeamDrawer(team, canvas){
this.team = team;
this.canvas = canvas;
}
TeamDrawer.prototype.draw = function(){
}
| true |
b21ebdcdc30007cdcc04c11f1d96bc366002fb37 | JavaScript | tumble1999/TGB | /TGB/hmm.js | UTF-8 | 1,593 | 2.515625 | 3 | [] | no_license | const fs = require('fs');
var o = "";
var opcodesJson = require("./opcodes.json").unprefixed;
var functions = [];
function paramSort(p) {
p = p.replace("(","$").replace(")","");
if(p.endsWith("+")) p = p.replace("+","I");
if(p.endsWith("-")) p = p.replace("-","D");
return p.replace("+","_").replace("-","_")
}
for... | true |
ca2b358bd12ddeaac718efd62f8d4aa3cde98901 | JavaScript | fpaula/idrop | /app/assets/javascripts/modules/election.js | UTF-8 | 4,401 | 2.765625 | 3 | [
"MIT"
] | permissive | var Election = function(electionId) {
this.electionId = electionId;
this.votesCount = 0;
this.root = $('#election');
this.finishedElection = $('[data-finished-election]');
this.leftPanel = this.root.find('#left');
this.rightPanel = this.root.find('#right');
this.nextButton = $('[data-next-candidates]');... | true |
991e77b5f4f231bb040548809958f609b88231d7 | JavaScript | markhext/ouroboros-poc | /views/admin/categoriesTable.jsx | UTF-8 | 2,036 | 2.6875 | 3 | [] | no_license |
import React from 'react';
class TableItem extends React.Component {
componentDidMount () {
console.log('Mounted view -----');
}
render () {
return (
<tr>
<td>{this.props.data.categoryName}</td>
<td>{this.props.data._id}</td>
<... | true |
172e4e9b448655d33018cd7cc9170e51d9c4a9bf | JavaScript | diegoeche/gardener | /static/home.js | UTF-8 | 2,262 | 2.765625 | 3 | [
"MIT"
] | permissive | function loadData() {
var url = "/api/plants";
return $.get(url)
}
$(function () {
var loadAndSetData = function () {
$.when(
loadData(),
).done(function (data) {
data.forEach(function (plant, i) {
var datasetTemplate = {
labels: plant.sensors.ma,
backgroundColor: ... | true |
a66d5e460ea4a061b33b6c792897e87b35d65ae8 | JavaScript | tuomasmakinen/fullstackopen | /osa6/redux_anekdootit/src/reducers/filterReducer.js | UTF-8 | 279 | 2.5625 | 3 | [] | no_license | const initialState = '';
const filterReducer = (store = initialState, action) => {
if (action.type === 'CHANGE') {
return action.filter;
}
return store;
};
export const changeFilter = (filter) => {
return {
type: 'CHANGE',
filter
};
};
export default filterReducer; | true |
08fda15a3bcaa18758bb25ea0e019eefb146c965 | JavaScript | vinogradov-am/kpi | /exampels/exercises-01/object.js | UTF-8 | 556 | 3.359375 | 3 | [
"MIT"
] | permissive | 'use strict';
const Object1 = {
name: 'Alexsander'
};
let Object2 = {
name: 'Oleg'
};
const Object3 = {
age: 25
};
console.log(Object1, Object2);
Object1.name = 'Mike';
Object2.name = 'Mark';
//Object1 = Object3; запрещено присвоение в константу указателя на новую ссылку
Object2 = Object3;
console.log(Object1, Ob... | true |
63feee192acf7985cd07e5c9faa634c93356a6e0 | JavaScript | ABitOfKylie/Whats4Dinner | /src/components/ParentComponent.jsx | UTF-8 | 6,229 | 2.640625 | 3 | [] | no_license | import React, { Component } from 'react';
import { Container} from 'semantic-ui-react';
import InfoHeader from './InfoHeader/InfoHeader';
import CardList from './CardGroup/CardList';
import FormStandAlone from './Form/addDinnerForm';
import DinnerCard from './CardGroup/DinnerCard';
let dinners = [
{
id:1,
m... | true |
ebf629bc78c6595727d9b903f3b27cfd74976650 | JavaScript | Eknarin/ACHOLIC | /server/api/comment/comment.controller.js | UTF-8 | 3,037 | 2.515625 | 3 | [] | no_license | 'use strict';
var _ = require('lodash');
var Comment = require('./comment.model');
var User = require('../user/user.model');
var PackageItem = require('../package-item/package-item.model');
var Bookmark = require('../bookmark/bookmark.model');
function handleError (res, err) {
return res.status(500).send(err);
}
/... | true |
25b938c9fa00bf7087acfce801961833f4ade53b | JavaScript | yesid2019500/pagina-primer-portafolio | /js/main.js | UTF-8 | 3,800 | 2.609375 | 3 | [
"MIT"
] | permissive | // ESTE CODIGO ES PARA EL EFECTO DE GOTICAS DE AGUA
// jQuery(document).ready(function() {
// "use strict"
// $('.lider').ripples({
// dropRadius: 10,
// perturbance: 0.01,
// });
// });
// esto es para el menu
let nav = document.getElementById('nav');
let menu = document.getElementBy... | true |
6feaf5903d2ac8ffe10f9fb1e840ef06b3524d42 | JavaScript | tjrghk92/ladder | /(javascript)ladder/ladder.js | UTF-8 | 13,993 | 2.6875 | 3 | [] | no_license | document.addEventListener("DOMContentLoaded", () => {
let heightNode = 10;
let widthNode = 0;
let LADDER = {};
let row =0;
let ladder = document.querySelector('#ladder');
let ladder_canvas = document.querySelector('#ladder_canvas');
let GLOBAL_FOOT_PRINT= {};
let GLOBAL_CHECK_FOOT_PRIN... | true |
e90d84d575ef8cb4d68bd060d9e4b79f6e0fc31b | JavaScript | silvermine/paprless | /src/PaprLess.js | UTF-8 | 745 | 2.9375 | 3 | [
"MIT"
] | permissive | function PaprLess($element, settings) {
this.$element = $element;
this.settings = settings;
}
PaprLess.prototype.onAfterAdd = function() {
// this is where you put your code that actually initializes your component
// after it is added to the DOM object selected by the jQuery selector.
// you can acc... | true |
10303c3b1bd266de37768dd39832930b0b639fcb | JavaScript | AC-graph/lookview | /src/core/instance/value.js | UTF-8 | 3,081 | 2.921875 | 3 | [
"MIT"
] | permissive | import isFunction from "@yelloxing/core.js/isFunction";
import isString from '@yelloxing/core.js/isString';
import evalExp from '../../tool/evalExp';
export function valueMixin(LookView) {
let w = 0, h = 0, min = 0, max = 0;
LookView.prototype.$$initValue = function (width, height) {
w = width * 0.01;
h... | true |
8c0799f4d3aa5ced4a9d8e8d84cc5927efb7391c | JavaScript | Dertod25/MyFirstAppReact | /changelog/lib/version.js | UTF-8 | 1,779 | 2.671875 | 3 | [] | no_license | var Bluebird = require('bluebird');
var CP = Bluebird.promisifyAll(require('child_process'));
var Release=function (commits) {
var level = 3;
var type = null;
commits.forEach(function (commit) {
if (commit.notes.length > 0) {
level = 0;
type='major';
} else if (comm... | true |
6b7dd687f15c6fdba3bc8ddfca7d8170d3e7e6f0 | JavaScript | wskhehe/front-end-manage | /client/src/utils/validator.js | UTF-8 | 4,769 | 2.84375 | 3 | [] | no_license | // 全局验证rules
var vali = {
// 手机号码验证
phone: function(val) {
return /^1[0-9]{10}$/.test(val);
},
// 大于或等于0 的整数
isInt: function(val, isZero = true) {
if (Math.floor(val) === val) {
if (!isZero && Math.floor(val) === 0) {
return false;
}
return true;
} else {
return fal... | true |
b29d0d26c79b007893608f755e3f4aa950133a4c | JavaScript | sabbir110/MERN-STACK-CRUD | /client/myapp/src/components/Users/Users.js | UTF-8 | 1,238 | 2.859375 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import { Link } from "react-router-dom";
const Users = () => {
const [user, setUser] = useState([]);
useEffect(() => {
fetch("http://localhost:5000/users")
.then((res) => res.json())
.then((data) => setUser(data));
}, []);
//Delete an User
... | true |
db7c8e63c0a1a1e72ac2abd56d212f481b13afd9 | JavaScript | Just-Danny/Portfolio | /java/gal.js | UTF-8 | 1,502 | 3.1875 | 3 | [] | no_license | var pictures= document.getElementById('pic');
var x=0;
var pic1= new Array;
pic1[0]= new Image();
pic1[0].src= "image/ds.png";
pic1[1]= new Image();
pic1[1].src = "image/Hobbie.png";
pic1[2]= new Image;
pic1[2].src= "image/store.png";
var pic = new Array;
pic[0]= new Image();
pic[0].src ="image/coding.png"... | true |
a4fa45a89077b2002fd486c6cd6c7d16dd8bf9a8 | JavaScript | ishenli/winnie-ui | /src/Position.js | UTF-8 | 6,043 | 3.140625 | 3 | [
"MIT"
] | permissive | /**
* @file 定位工具,将一个 DOM 节点相对于另一个 DOM 节点进行定位操作
* @author shenli(meshenli@gmail.com)
*/
define(function (require) {
var VIEWPORT = { _id: 'VIEWPORT', nodeType: 1 };
var Position = {};
var isPosFixed = false; // 是否fixed
var lib = require('winnie/lib');
/**
* @constructor
* @requires jQ... | true |
e5d036ae041647c425aa4d93c4334257a5413dfe | JavaScript | konarie1990/another-repo-for-checkpoint2Adv | /client/src/reducers/index.js | UTF-8 | 551 | 2.65625 | 3 | [] | no_license | import { combineReducers } from "redux";
const cats = (state = [], action) => {
console.log("reducer", action.type, action.value);
const newState = [...state];
switch (action.type) {
case "LIST_CATS":
return action.value;
case "CREATE_CAT":
newState.push(action.value);
return newState;
... | true |