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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
60db37635fb6909a4dc617b794bd626984949105 | JavaScript | Sneha14-sc/LearningApp | /client/src/hxNotification/hxNotification.controller.js | UTF-8 | 874 | 2.515625 | 3 | [] | no_license | (function() {
var isDlgOpen;
/**
*@memberof hxNotificationModule
*@ngdoc controller
*@name notificationCtrl
*@param {service} $mdToast angular Material service
*@description
* Control the manual close button
*/
angular.module('hxNotificationModule')
.controller('notificationCtrl', notifi... | true |
c50c336363099ffc35abbe97459db720a3db3279 | JavaScript | versionone/relay-graphql-demo | /src/data/dataAccess/Article.js | UTF-8 | 547 | 3.1875 | 3 | [] | no_license | export class Article extends Object {
}
// Fake data storage
const articles = [];
let article1 = new Article();
article1.id = 0;
article1.title = 'What is React?';
let article2 = new Article();
article2.id = 1;
article2.title = 'What is Relay?';
let article3 = new Article();
article3.id = 2;
article3.title = 'What is ... | true |
f07ee3c0db0c50bb4d1277ad26f0fcaac4f022ec | JavaScript | yevheniimoskalenko/parsing_ins | /src/img.js | UTF-8 | 439 | 2.765625 | 3 | [] | no_license | var Jimp = require("jimp");
var fileName = '1.jpg';
var imageCaption = 'привет как дела awdaw';
var loadedImage;
Jimp.read(fileName)
.then(function (image) {
loadedImage = image;
return Jimp.loadFont('./fonts/font.fnt');
})
.then(function (font) {
console.log(font)
loadedImage.print(font, 50, ... | true |
9a86400de0427519000c00c1fa0adcb30d115a0b | JavaScript | KoleMyers/streamlink-twitch-gui | /src/app/nwjs/Window.js | UTF-8 | 1,342 | 2.734375 | 3 | [
"MIT"
] | permissive | import { Window } from "nwjs/nwGui";
// get the main application window
const nwWindow = Window.get();
nwWindow.removeAllListeners();
let hidden = true;
let focused = true;
let maximized = false;
let minimized = false;
nwWindow.on( "focus", () => focused = true );
nwWindow.on( "blur", () => focused = false )... | true |
476ff2133356c4e910cc28b04df927cf7817ed7d | JavaScript | HeatherPost/midTerm | /test/common/util/math/myPowerTest.js | UTF-8 | 1,439 | 2.765625 | 3 | [] | no_license | const assert = require('chai').assert;
const mySquare = require('../../../../src/common/util/math/mySquare.js');
const myCube = require('../../../../src/common/util/math/myCube.js');
const num1 = 3;
const num1String = "3";
const ansCube = 27;
const ansSquare = 9;
describe('myCube', function() {
describe('cubeNum... | true |
caf9fb9aea19b66fa046c06998ece1a9a525d6f4 | JavaScript | davidsanchezuribe/chavasan-backend | /src/validation.js | UTF-8 | 5,060 | 2.75 | 3 | [] | no_license | import {
userExists,
channelExists,
checkChannelOwnership,
belongsToChannelUID,
channelNameExists
} from './databasememory';
export async function validateChannelName(name){
if(name === undefined){
return {
valid: false,
msg: 'Se debe pasar el parámetro name... | true |
590c2d705d9b5e7cccf64eba10d6069cd70f7de8 | JavaScript | zhaoweisi/zhaoweisi.github.io | /script.js | UTF-8 | 818 | 3.109375 | 3 | [] | no_license | //Carousel - Homepage
var index = 1;
console.log(index);
display_slides(index);
// Next/previous controls
function add_slides(n) {
display_slides(index += n);
}
//Carousel image controls
function cur_slide(n) {
display_slides(index = n);
}
function display_slides(n) {
var i;
var slides = d... | true |
69f9ce9a22b9114ff3288e18ef2f2e588901ebd6 | JavaScript | EveFer/7ma-generacion | /p11stringMethods/js/main.js | UTF-8 | 3,821 | 4.90625 | 5 | [] | no_license | // String Methods
// Practice 1
// Obtener el nombre completo del usuario e
// indicarle cuantos caracteres tiene su nombre
/*
1.- mediante un promt que solicite al usuario ingresar su nombre, asignamos
el nombre del usuario a la variable nameUser
4.- Eliminar los espacios entre cada palabra con la f... | true |
0f33f64f863cd00593a2bd20b05999238faac5dd | JavaScript | nikolajlauridsen/ASP-prac | /BookingSite/BookingSite/wwwroot/js/index.js | UTF-8 | 3,321 | 3.5625 | 4 | [] | no_license | const uri = 'https://localhost:5001/api/movie'
let movies = [];
function getMovies() {
// Fetch movies from API
fetch(uri)
.then(response => response.json()) // Turn em into json
.then(data => _displayMovies(data)) // Call _displayMovi... | true |
fbc4a5b7b40c3cc0d72ee1e584f635ca4b2f87ff | JavaScript | IsiBee/employee-challenge | /__tests__/Employee.test.js | UTF-8 | 1,079 | 3.546875 | 4 | [] | no_license | const Employee = require('../lib/Employee.js');
test('creates an Employee object', () => {
const employee = new Employee('Joe', 12345, 'joe@test.com');
expect(employee.name).toEqual(expect.any(String));
expect(employee.id).toEqual(expect.any(Number));
expect(employee.email).toEqual(expect.any(String))... | true |
346dccb58e78cd538cf1229731ffd423de8cfa9b | JavaScript | Rohit-Kavitake/ClipShare | /src/components/FirebaseFunctions/index.js | UTF-8 | 967 | 2.8125 | 3 | [] | no_license | const signIn = () => {
// User Google SignIn
let provider = new firebase.auth.GoogleAuthProvider();
firebase.auth().signInWithPopup(provider);
};
const signOut = () => {
// User Google Signout
firebase.auth.signOut();
};
//Resize user Profile to default google profile size
function addSizeToGoogleProfilePic(url)... | true |
71e26ac0e81abfbee0c7927480c0c34ca58c008e | JavaScript | Peterlollo/data-structures | /sprint-two/src/hashTable.js | UTF-8 | 2,170 | 3.5 | 4 | [] | no_license |
var HashTable = function() {
this._limit = 8;
this._storage = LimitedArray(this._limit);
//Reassign tempStorage to the old limitedArray(makes it easier to reassign)
this._tempStorage = undefined;
this._tupleCount = 0;
};
HashTable.prototype.insert = function(k, v) {
var index = getIndexBelowMaxForKey(k,... | true |
7cef744e797ffe73cc4ec7c6daac31462ea7d7f0 | JavaScript | pjaeyoung/ui-clone | /canvas_tutorial/ep_3/index.js | UTF-8 | 1,522 | 3.390625 | 3 | [] | no_license | class Particle {
constructor({ x, y, dx, dy, radius, $canvas, ctx }) {
this._x = x;
this._y = y;
this._dx = dx;
this._dy = dy;
this._radius = radius;
this._$canvas = $canvas;
this._ctx = ctx;
this.animate = this.animate.bind(this);
}
get dx() {
if (
this._x + this._radi... | true |
cbae61a81780f5d571f110d39fb6fb76f5421a05 | JavaScript | Izanael/Mal-it | /main.js | UTF-8 | 943 | 2.515625 | 3 | [] | no_license | //handle setupevents as quickly as possible
const setupEvents = require('./installers/setupEvents')
if (setupEvents.handleSquirrelEvent()) {
// squirrel event handled and app will exit in 1000ms, so don't do anything else
return;
}
const { app, BrowserWindow } = require('electron')
let win
functio... | true |
4ed77842ba91db46bf5f557ab1fd764bea342b9e | JavaScript | ftroncosom/webos-samples | /mojomatters/tests/stage_tests.js | UTF-8 | 2,378 | 2.546875 | 3 | [] | no_license | function StageTests() {
this.stageCreatedForProxyTest = this.stageCreatedForProxyTest.bind(this);
}
StageTests.prototype.kChildStageName = 'test-child-stage';
StageTests.prototype.testProxy = function(recordResults) {
// recordResults.delay(.75, Mojo.Test.passed);
var proxy;
Mojo.Controller.getAppController().cr... | true |
618dd030fe559fe93c68391b099b0c385f44578f | JavaScript | MaksymVolohin/News-Portal | /js/main.js | UTF-8 | 1,028 | 2.953125 | 3 | [
"MIT"
] | permissive | $(function(){
// var date = new Date();
// console.log(date.getHours());
// console.log(date.getMinutes());
// console.log(date.getSeconds());
var tableContainer = $('.calendar-table');
var tableBuild = "";
tableBuild = tableBuild + ('<table><th colspan="7">November</th><tr>');
// ta... | true |
214b5f519d5436c84b65d79ceda873b07b693afb | JavaScript | degvalentine/No-Install-Portfolio | /demo/lib/home.js | UTF-8 | 8,090 | 2.65625 | 3 | [] | no_license | // @todo wrap all js vars/funcs in portfolio object
var speed = 250;
var runIntro, isIntro = false;
var gid = 1;
var groupList = [];
$(function() {
loadPage();
// context menus
var contextMenus = $('<div id="contextMenus" />');
$('body').append(contextMenus);
// load specific item if set
if (wi... | true |
681fd39d729bc1d602ed022ecfac108fc76ee5cd | JavaScript | falbuquerque/nodejs-study | /juggling_async.js | UTF-8 | 478 | 2.9375 | 3 | [] | no_license | var bl = require('bl')
var http = require('http')
var count = 0
var results = []
var calls = 3
function print() {
for (var i = 0; i < calls; i++) {
console.log(results[i])
}
}
function get(index) {
http.get(process.argv[2 + index], function(response) {
response.pipe(bl(function(err, data) {
resu... | true |
5876d7590d13ba64345571a78cb2afcf287ad449 | JavaScript | akarsh-23/WebCalender | /myjs.js | UTF-8 | 1,801 | 3.125 | 3 | [] | no_license | var month = [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
];
var weekday = [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"
];
var weekdayShort = [
"sun",
"mon",
"tu... | true |
2b5293b419af425a817e6f60061c6782185c551c | JavaScript | paauw0/algorithm | /1/6.js | UTF-8 | 3,344 | 3.953125 | 4 | [] | no_license | /**
* @description: 广度优先搜索
*/
/**
* 广度优先搜索是一种用于图的查找算法,可帮助回答两类问题
* 第一类问题:从节点A出发,有前往节点B的路径吗?
* 第二类问题:从节点A出发,前往节点B的哪条路径最短?
*/
/**
* 目标是在你的人际关系网中找到一位芒果销售商
* 因此,如果Alice不是芒果销售商,就将其朋友也加入到名单中
* 这意味着你将在她的朋友、朋友的朋友等中查找
* 使用这种算法将搜遍你的整个人际关系网,直到找到芒果销售商
* 这就是广度优先搜索算法
*/
/**
* 实现图
* Anuj、Peggy、Thom和Jonny... | true |
5f9d06fc23a76ad344f36f1c5d581650dd7e5dd8 | JavaScript | lucaslumbex/engagements-tracker | /src/store/modules/baseModules/notification.js | UTF-8 | 2,020 | 2.53125 | 3 | [] | no_license | export const namespaced = true;
const defaultNotificationModalBody = {
type: "error", //error, success, warning
mode: "default", // default, yes-no
title: "",
message: "",
noAction: () => {},
noActionTitle: "",
yesAction: () => {},
yesActionTitle: ""
};
export const state = {
notifications: [],
te... | true |
070e120102236b289b5491b96314e67fa358989a | JavaScript | vishwanathovi/newTabb | /js/main.js | UTF-8 | 14,632 | 3.140625 | 3 | [] | no_license | // //////////////////////////////////////////////////////////////////
// Background //
// //////////////////////////////////////////////////////////////////
function createRandomBackground() {
var randomCount = 0;
setInterval(() => {
randomCount += 1;
/... | true |
e224e8b922f66661c979ebc1e0562d3b603c5d8e | JavaScript | arifin26/apk-pos | /kasir/home.js | UTF-8 | 9,396 | 2.6875 | 3 | [] | no_license | //This is an example code to Add Search Bar Filter on Listview//
import React, {Component} from 'react';
//import react in our code.
import {
Text,
StyleSheet,
View,
StatusBar,
ScrollView,
Image,
Modal,
FlatList,
TextInput,
ActivityIndicator,
AsyncStorage,
Alert,
TouchableOpacity,
} from 'rea... | true |
7b4420d87cf370cf78a8d5946d7ae89e0a844d02 | JavaScript | thinkful-ei22/w7d3-kev-jenn-proj | /src/components/EmotionSelect.js | UTF-8 | 544 | 2.59375 | 3 | [] | no_license | import React from 'react';
import './EmotionSelect.css';
export default function EmotionSelect(props) {
return (
<div className='buttons'>
<button className='happy emotion' value='happy'
onClick={e => props.handleEmotion(e.target.value)}>Happy</button>
<button className='sad emotion' value='... | true |
2f60dfcb89ef5ea7b560886526cd7c680b648041 | JavaScript | tracireed23/AAA_final | /app/scripts/main.js | UTF-8 | 1,664 | 3.203125 | 3 | [] | no_license | console.log('MEOW!!!');
$('.carousel').carousel({
pause: "hover"
})
var localKittenList = []; // local list
var collectionType = "kittens2";
// Set up add new kitten and event handlers
$(document).ready( function(){
initKittenList();
$("#addButton").click(addKitten);
$("#clearButton").click(clearList);
})... | true |
ecd4413cf4e83eaf873be03ded75a0696f99f41a | JavaScript | InSight-Hack-the-North-2021/backend | /controllers/premium.js | UTF-8 | 5,464 | 3.125 | 3 | [] | no_license |
// Routes functions
const vision = require('@google-cloud/vision');
const { scorePerson,food_scorer, safe_search_scorer}=require(`../controllers/score`);
const { Storage } = require('@google-cloud/storage');
const score = async (req, res) => {
// The ID of your GCS bucket
console.log("reached");
const buc... | true |
46385a05b55f33b0871b815276e9903eee740ead | JavaScript | hunnit-log/Server | /src/modules/seeder.js | UTF-8 | 1,399 | 2.71875 | 3 | [] | no_license | import fs from 'fs';
import path from 'path';
import mongoose from 'mongoose';
import config from '../config.js';
import Logger from '../loaders/logger.js';
// Load models
import Sprint from '../models/sprintModel.js';
import User from '../models/userModel.js';
const { url } = config.database;
// Connect to DB
mongoo... | true |
0b2ac3dabdfe5b5be62ff41176c161e64469eff8 | JavaScript | edwilliams/NodeAuthServer | /src/utils/userDB.js | UTF-8 | 2,528 | 2.671875 | 3 | [] | no_license | const AWS = require('aws-sdk')
AWS.config.update({
region: process.env.AWS_region,
accessKeyId: process.env.AWS_accessKeyId,
secretAccessKey: process.env.AWS_secretAccessKey,
})
const docClient = new AWS.DynamoDB.DocumentClient()
/**
* Get user from DynamoDB
* @function
* @param {string} username - name of ... | true |
9962d1fd89bc91925d4456a403810c3ca1307a35 | JavaScript | linhgraphic/game-of-life | /src/utils/generateGrid.js | UTF-8 | 354 | 2.828125 | 3 | [] | no_license | export const cellSize = { x: 32, y: 32 };
const generateGrid = (width, height, percentageAlive) => {
const row = Math.floor(height / cellSize.y);
const col = Math.floor(width / cellSize.x);
return Array.from({ length: row }, () =>
Array.from({ length: col }, () => Number(Math.random() < percentageAlive))
)... | true |
83b682a9e5a6f40f65af66da6ec7611e3acaa09f | JavaScript | d0542218/gdpj | /static/dist/js/register.js | UTF-8 | 1,890 | 2.75 | 3 | [] | no_license | function register(){
var username = document.forms["registerForm"]["username"].value;
var email = document.forms["registerForm"]["email"].value;
var pw = document.forms["registerForm"]["PW"].value;
var checkPW = document.forms["registerForm"]["checkPW"].value;
console.log(username+email+pw);
if(username==""||emai... | true |
6c1637fb8ae1bc837ffd5ca1b6237686b3b5dddb | JavaScript | takeruun/chat_app | /front/react-project/src/reducers/mention.js | UTF-8 | 496 | 2.5625 | 3 | [] | no_license | const initialState = {
mentionList: [],
};
export default (state = initialState, action) => {
switch (action.type) {
case 'SET_MENTION_THREAD_LIST':
return Object.assign({}, state, {
mentionList: action.data,
});
case 'ADD_MENTION_THREAD_LIST':
var addMention = state.mentionList;... | true |
a82eb66388ca16c6fe04299361f7db0917e1994e | JavaScript | winfyho/MyNotes | /JavaScript/防抖和节流/tools.js | UTF-8 | 2,072 | 3.140625 | 3 | [] | no_license | export function debounce(func, delay = 1000, immediate = true) {
let timer = null
return function () {
if (immediate) {
// 立即执行版本
if (timer) {
clearTimeout(timer)
} else if (timer === null) {
func.apply(this, arguments)
}
... | true |
ef7cce29c149b3fde2bd466196d8a8ba19a02d9c | JavaScript | Chanson9892/DSA-practice | /DSA_Questions/climbingStairs.js | UTF-8 | 722 | 4.625 | 5 | [] | no_license | // You are climbing a staircase. It takes n steps to reach the top.
// Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
// Example 1:
// Input: n = 2
// Output: 2
// Explanation: There are two ways to climb to the top.
// 1. 1 step + 1 step
// 2. 2 steps
let stairs = 4... | true |
54ad9c87ea2ee94626ddd9c2afc001dcfaa44e85 | JavaScript | zy424/react_comment | /src/reducers/Comment.jsx | UTF-8 | 508 | 2.75 | 3 | [] | no_license | /*
include all reducer functions, use old state and action create new state
*/
import {ADD_COMMENT,DELETE_COMMENT, RECEIVE_COMMENTS} from '../actions/ActionTypes'
const initComments = []
export function comments(state = initComments, action) {
switch(action.type){
case ADD_COMMENT:
return [action.data, ..... | true |
2d1cd5458f8fdc52a374e6f72b4c24fa5788d092 | JavaScript | iakbarp/projek-probo | /public/js/full-screen.js | UTF-8 | 1,447 | 3.109375 | 3 | [
"MIT"
] | permissive |
/* Get into full screen */
function GoInFullscreen(element) {
if(element.requestFullscreen)
element.requestFullscreen();
else if(element.mozRequestFullScreen)
element.mozRequestFullScreen();
else if(element.webkitRequestFullscreen)
element.webkitRequestFu... | true |
01d1fface8073cac48742035c8d5b38c98c0c90d | JavaScript | francisco-jrl/francisco-jrl.github.com | /boletines/javascript/script.js | UTF-8 | 997 | 3.078125 | 3 | [] | no_license | // Obtener los elementos de la clase close
let links = document.querySelectorAll(".close");
// Recorrerlos
links.forEach(function(link) {
// Agregar un evento click a cada uno de ellos
link.addEventListener("click", function(ev){
// Previniendo los eventos por Default
ev.preven... | true |
6a8e5992dcb6590a85e1c4d0d2a8185cd18b000d | JavaScript | AlbertAxel95/Entrega-1 | /js/filters.js | UTF-8 | 1,304 | 3.078125 | 3 | [
"MIT"
] | permissive | class Filters{
// No necesito constructor, pero prefiero tener los métodos a mano y que no ocupen tanto espacio en mi Script principal.
grey(r, g, b){
let grey = ((r + g + b) / 3);
return [grey, grey, grey];
}
sepia(r, g, b){
// Sepia image processing.
let new_r = (0.39... | true |
5a088e570e0f649a37e503ade5d296dcd4ade718 | JavaScript | Angel-Go/gifexpet-reactapp | /src/functions/getGifs.js | UTF-8 | 1,237 | 3.15625 | 3 | [] | no_license | export const getGifs = (category) => {
/*
Esta funcion hace una peticion asincrona a la API de Giphy mandandole la categoria y el numero de
resultados que espera recibir (8) y retorna una promesa con un objeto que contiene el id, titulo y url
de la data regresada por la API mencionada.
*/
cons... | true |
4114d6f8ab792e97dee08ab9ffbb60ba8ed2f462 | JavaScript | jdotcole233/marvel | /index.js | UTF-8 | 1,559 | 2.765625 | 3 | [] | no_license |
const axios = require('axios');
const md5 = require('md5');
const prompt = require('prompt-sync')({sigint: true});
const axios_instance = axios.create({
baseURL: "https://gateway.marvel.com:443/v1/public/",
headers: {accept: 'application/json'}
});
const PUBLIC_KEY = "ee6c172d393c1c2d88c9e16f76f0a768";
const PRI... | true |
dfd0a0dbd307badd5708556cc97bda41ddfe7865 | JavaScript | axemclion/grunt-node-qunit | /test/testFiles/tests.js | UTF-8 | 726 | 2.90625 | 3 | [
"MIT"
] | permissive | test("a basic test example", function(assert) {
ok(true, "this test is fine");
var value = "hello";
equal("hello", value, "We expect value to be hello");
});
QUnit.module("Module A");
test("first test within module", 1, function(assert) {
ok(true, "a dummy");
});
test("second test within module", 2, ... | true |
7fef90054b064c6f8e9e92831eafd73e1af82a64 | JavaScript | jajulaht/unicafe-redux | /redux-anecdotes/src/reducers/filterReducer.js | UTF-8 | 547 | 2.78125 | 3 | [] | no_license | const initialState = ''
// Action creator functions
export const createFilter = (content) => {
return {
type: 'NEW_FILTER',
data: content
}
}
export const deleteFilter = () => {
return {
type: 'DEL_FILTER',
}
}
const filterReducer = (state = initialState, action) => {
console.log('state now: ', ... | true |
427b3038a3ab214a7bc56de1bc28ea345c26f70a | JavaScript | gutzy/pixel-editor | /js/_replaceAllOfColor.js | UTF-8 | 1,012 | 3.859375 | 4 | [] | no_license | //replaces all of a single color on the canvas with a different color
//input two rgb color objects {r:0,g:0,b:0}
function replaceAllOfColor (oldColor, newColor) {
//convert strings to objects if nessesary
if (typeof oldColor === 'string') oldColor = hexToRgb(oldColor);
if (typeof newColor === 'string') n... | true |
eabdfc80d50a5a2918dd64153f48a9cac8978124 | JavaScript | cahweb/cah-ajax-query | /js/cah-ajax-admin.js | UTF-8 | 15,149 | 3.125 | 3 | [] | no_license | jQuery(document).ready(function() {
// Grab the #edit-dialog <div> and turn it into a jQuery UI Dialog box.
jQuery('#edit-dialog').dialog({
autoOpen: false,
height: 400,
width: 550,
modal: true,
buttons: [
{
text: 'Update',
cli... | true |
904cee35f0737073bdd93710886512665a643d2b | JavaScript | Thatguyjs/Citation-Extension | /inject/general/textarea.js | UTF-8 | 1,086 | 3.28125 | 3 | [
"BSD-3-Clause"
] | permissive | // Dynamically resize textareas
const Textarea = {
// A list of textareas
_textareas: [],
// Update a textarea's height
_update: function(event) {
event.target.style.height = '0';
event.target.style.height = event.target.scrollHeight + 'px';
},
// Add all textareas in the current document
addAll: func... | true |
329a0b5af7e619da817a88e9a0d8e28e537e3554 | JavaScript | blakepercy/DepartureBoard | /frontend/src/components/CrsForm.js | UTF-8 | 810 | 2.71875 | 3 | [] | no_license | import React from 'react';
class CrsForm extends React.Component {
constructor(props) {
super(props);
this.state = {crs: "MTB"};
this.crsCallback = props.crsCallback;
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleChange(event)
... | true |
5136176917fe243273db8d6c5cf0d97c03e35fd1 | JavaScript | lowbract/LogiFruit | /anagrafiche/js/script.js | UTF-8 | 1,311 | 2.53125 | 3 | [] | no_license | // autocomplet : this function will be executed every time we change the text
function autocomplet(campo) {
var min_length = 0; // min caracters to display the autocomplete
var radice = campo.substr(0, 4);
var idriga = campo.substring(5);
var keyword = $('#'+ campo +'_txt').val();
if (keyword.l... | true |
4668551a19a7a0915848935c7817a38029e7f873 | JavaScript | hp0809/DSA | /Hash-maps/hashmaps-drills.js | UTF-8 | 5,504 | 3.8125 | 4 | [] | no_license | const HashMap = require("./hash");
const HashSepChain = require("./hashSepChain");
function main() {
const lor = new HashMap();
lor.MAX_LOAD_RATIO = 0.5;
lor.SIZE_RATIO = 3;
lor.set("Hobbit", "Bilbo");
lor.set("Hobbit", "Frodo");
lor.set("Wizard", "Gandolf");
lor.set("Human", "Aragorn");
lor.set("Elf"... | true |
769f9dbe3439998d45f91afb5c15a6ead4020a9b | JavaScript | YukiYuko/jianshu-server | /utils/Exception.js | UTF-8 | 554 | 2.578125 | 3 | [] | no_license | class HttpException extends Error {
/**
* @description 异常错误抛出
* @param msg 错误消息
* @param code 返回code
* @param status http code
*/
constructor(msg = "服务器错误", code = 10000, status = 200) {
super();
this.code = code;
this.message = msg;
this.status = status;
}
}
class ParameterExcept... | true |
68eaa4dee650e52830b803bbf7a7b69dba76cf90 | JavaScript | HigorAntonio/nodejs | /Aplicacoes_web_realtime_com_nodejs/Capitulo_2/hello_server.js | UTF-8 | 514 | 2.890625 | 3 | [] | no_license | const http = require('http');
const PORT = 3000;
const server = http.createServer(function(request, response) {
response.writeHead(200, { "Content-Type": "text/html" });
if (request.url === '/') {
response.write("<h1>Pagina Principal</h1>")
} else if (request.url === '/bemvindo') {
response.write("<h1>B... | true |
02c51a37d1cbcd85d82aa701f338eba54dca996a | JavaScript | bricelambi/CWB206_HW5 | /wk5.js | UTF-8 | 608 | 2.765625 | 3 | [] | no_license |
const sqlite3 = require('sqlite3').verbose();
// open database in memory
let db = new sqlite3.Database('student_data.sqlite3', (err) => {
if (err) {
return console.error(err.message);
}
console.log('Connected to the SQlite database.');
});
let sql = "SELECT DISTINCT name FROM student ORDER BY name";
db.a... | true |
04b60a5cee32756802b31c694e65aa14a9287efe | JavaScript | paigen11/jquery-101 | /scripts.js | UTF-8 | 3,430 | 3.265625 | 3 | [] | no_license | console.dir($); // pseudonym for console.dir(jQuery); - they're the same thing
$(document).ready( // whatever is inside parantheses is the thing you want to target
function(){
// This code will only run when the ready event has happened. In other words,
// the DOM must be fully loaded before this event will run.... | true |
09133ee2e87364e62afc7ae422d99e8afb2d8e15 | JavaScript | aurelianofs/celebrities | /src/Socket.js | UTF-8 | 1,386 | 2.640625 | 3 | [] | no_license | let HOST = window.location.origin.replace(/^http/, 'ws');
if(process.env.NODE_ENV === 'development') {
HOST = HOST.replace(':3000', ':8080');
}
const savedPlayerID = localStorage && localStorage.getItem('playerID') ? JSON.parse(localStorage.getItem('playerID')) : null;
class Socket {
ws = new WebSocket(HOST);
... | true |
f88b392a9d1893ad37f69c39e791f01068a09d5c | JavaScript | mkclairhong/lt_exemplar_rule | /lt_task/Training/Web Stuff/www/lib/pwbscript/AnimationBuffer.js | UTF-8 | 5,211 | 2.71875 | 3 | [] | no_license | define([
"Class",
"pwbscript/ImageBuffer"
], function(
Class,
ImageBuffer
) {
var AnimationBuffer = Class.extend({
domNode: null,
img: null,
frameW: null,
frameH: null,
frameOffsetX: null,
frameOffsetY: null,
doWrap: true,
totalFramesX: 0,
totalFramesY: 0,
imageBuffer: null,
isLoaded: f... | true |
bc4067f1bd283d97af93c32d90ce7cc73ca5ef7f | JavaScript | tamirogers/16fullstacktodo | /vstd/app/todo.factory.js | UTF-8 | 4,124 | 2.671875 | 3 | [] | no_license | (function() {
'use strict';
angular
.module('myApp')
.factory('TodoFactory', TodoFactory);
TodoFactory.$inject = ['$http', '$q'];
/* @ngInject */
//run all the functions in this factory
function TodoFactory($http, $q) {
var service = {
getItems: getItems,
... | true |
13dc77703e756c262aff9d9a97547aab3ef776ed | JavaScript | thinkful-ei-emu/Jordon-Recursive-Alg | /ReverseStr.js | UTF-8 | 629 | 4.125 | 4 | [] | no_license | // const reverseString = (str) => {
// //Base Case
// if (str === '') {
// return '';
// }
// //General Case
// return reverseString(str.substr(1)) + str.charAt(0);
// }
// reverseString('Abc')
// function reverseString(str) {
// if (str === "")
// return "";
// else
// ... | true |
3e9c0e78c58a49fe33ad5ef06a7c69a647a58c0c | JavaScript | ntnbrtnkv/stack-overflow-copy-paste | /src/getTriangleType.js | UTF-8 | 684 | 3.46875 | 3 | [
"MIT"
] | permissive | export default getTriangleType
/**
* Original Source: https://stackoverflow.com/questions/12491976
*
* This function will return the type of a triangle, given its sides (a, b, c) length. It's a copy.
*
* @param {String} a - The sides to determine which triangle it belongs to
* @param {String} b - The sides to de... | true |
2bb8ba682daa57da371494a45a0d13736677a137 | JavaScript | hahaliu1029/react-demo1 | /src/index.redux.js | UTF-8 | 844 | 3.03125 | 3 | [] | no_license | // action
const ADD_PERSON = "招聘";
const REMOVE_PERSON = "裁员";
let num = 1;
const initState = {
person: ["贾伟", "田琳", "张玉峰"],
};
// reducer处理函数, 参数是状态和新的action
export function editPerson(state = initState, action) {
switch (action.type) {
case ADD_PERSON:
return {
person: [...state.person, `员工${n... | true |
7d11636f934bad5c9cbe56470d6726d40bf046c2 | JavaScript | debasish283/ilovemycity | /routes/routes.js | UTF-8 | 901 | 2.828125 | 3 | [] | no_license | function homeFn(req, res) {
res.render('home.ejs', {
title: 'I love my city',
headline: 'Every city is unique in its own way'
});
};
function cityFn(req, res) {
var cityName = req.params.city;
var cityTitle;
var cityHeadline;
if (cityName === 'newjersey') {
cityTitle = ... | true |
1de54bd0520286b1420bdfd28ff34e8cb44f7d82 | JavaScript | carlos-escamilla33/FitnessTrackerBackend | /db/tableFunctions/users.js | UTF-8 | 1,644 | 2.796875 | 3 | [] | no_license | const util = require("util");
const client = require("../client");
const bcrypt = require('bcrypt');
const createUser = async ({ username, password }) => {
try {
const SALT_COUNT = 10;
const cryptedPass = await bcrypt.hash(password, SALT_COUNT);
const { rows: [user] } = await client.quer... | true |
7e703abcf86c1d3a0afe657250206dbe39c7ad24 | JavaScript | study2018-9-5/summary | /learnJS/4.对象.js | UTF-8 | 1,171 | 4.625 | 5 | [] | no_license | /*
对象:是一种无序的集合数据类型,它由若干个键值对组成。
*/
var person = {
name: '小明',
'middle-school': 'No.1 Middle School'
};
// .操作符必须接有效的属性,若属性中含有特殊的字符,就必须用''括起来。
console.log("person.name", person.name)
console.log("person['middle-school']", person['middle-school'])
// 添加属性
person.age = 18;
console.log("person.age", person)
// 删除属性... | true |
e52c4f7ea53f3cb23b73a4cc7b3be7d7792797ee | JavaScript | XavierPrudent/openTripPlanner_Civilia | /PHP_CiviliaPortal/res/js/res_javascript.js | UTF-8 | 562 | 3.140625 | 3 | [
"MIT"
] | permissive | var xmlHttp = createXmlHttpRequestObject();
function createXmlHttpRequestObject() {
var xmlHttp;
if(window.ActiveXObject){
// if the user uses Internet Explorer
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
smlHttp = false;
}
}... | true |
0eb1d66199f6a80d630dd80a705b34d8f43e1824 | JavaScript | whorldm/FullStackCourse | /11.15dynamic-program/01背包升级版.js | UTF-8 | 3,813 | 3.84375 | 4 | [] | no_license | /**
* @file 01背包问题
* @description 假设背包可承受重量W,物品个数n,物品重量存储在数组items,物品价格存储在values,
* 如何装物品才能在不超过背包的最大限重条件下,使得装入物品的总价值最高
*/
const n = 5; // 物品数量
const items = [2, 2, 4, 6, 3]; // 每个物品重量
const values = [3, 4, 8, 9, 6]; // 每个物品的价值
const packageWeight = 9; // 背包的限重
let maxWeight = 0; // 记录背包物品中的最大重量
let ma... | true |
a239d187b2a13c7df82908953d18c5bd57524b7b | JavaScript | Yinghuochongxiaoq/JavascriptBookCode | /UnderstandingJavaScript/Js03.js | UTF-8 | 265 | 2.71875 | 3 | [] | no_license | var yourName="杨洪俊";
function rewriteFunction(){
console.log("复写函数");
}
function rewriteFunction(){
console.log("最终版本的function"+yourName)
var yourName="FreshMan";
console.log(rewriteFunction.toString());
}
rewriteFunction(); | true |
012ed3cd2880f613ff83c58b03edc632d29e0984 | JavaScript | ShebaAnnaPhilip/starwars_react | /src/containers/PlanetDetails.js | UTF-8 | 1,346 | 2.640625 | 3 | [] | no_license | import React, {useState} from 'react'
import Card from '../components/Card'
import { getAllData } from '../utils';
export default function PlanetDetails({details}) {
const [filmList, setFilmList] = useState([]);
const getFilmDetails = (urls) => {
Promise.all(urls.map((url) => getAllData(url)))
... | true |
5824c7cd73cf0053fbd38a8877289e223d5151a2 | JavaScript | docker-ms/microservice-module-multimedia-resource-processing | /lib/FfmpegWrapper.js | UTF-8 | 4,562 | 2.578125 | 3 | [
"MIT"
] | permissive | 'use strict'
const fs = require('fs');
const shortid = require('shortid');
const Promise = require('bluebird');
const ffmpeg = require('fluent-ffmpeg');
class FfmpegWrapper {
// `input` available values:
// a file name (eg. /path/to/file.avi)
// an image pattern (eg. /path/to/frame%03d.png)
// a reada... | true |
a6e483324ddbf7ec73ef78ea4da97c465109e6c8 | JavaScript | andyseracuse/algorithms-and-structures | /Graph.js | UTF-8 | 2,024 | 3.265625 | 3 | [] | no_license | class Graph {
constructor() {
this.adjacencyList = {}
}
addVertex(value) {
if(!this.adjacencyList[value]) this.adjacencyList[value] = []
}
addEdge(v1, v2) {
if(this.adjacencyList[v1] === undefined || this.adjacencyList[v2] === undefined) {
return undefined
}
this.adjacencyList[v1].... | true |
a8dac0575d75bf8792b5eed7022a35d6a8bdeefe | JavaScript | worldstar/App-Cloud-DatabaseBook2014 | /AndroidStudio/Ch3/HelloWebViewTarget9/app/build/intermediates/assets/debug/searchNearestStation.js | UTF-8 | 5,673 | 2.890625 | 3 | [] | no_license | //地圖相關物件 (Map related objects)
var map; //map object
var bounds; //地圖顯示邊界
var myLatlng; //本地圖中心點座標物件
var markers; //顯示多個地標的物件陣列
var infowindow;//資訊視窗
//在本程式主要相關所需變數 (The variables used for searching purpose.)
//設定要顯示幾個最近加油站 (To set how many nearest stations we want to record.)
var numberOfNearestStations... | true |
ef4eeea4ee93562ef92652e120e566a1dc3de5b3 | JavaScript | surinder12/React-testing | /App.js | UTF-8 | 1,674 | 2.796875 | 3 | [] | no_license | import React, { useState } from 'react';
import 'bootstrap/dist/css/bootstrap.min.css';
import Header from "./components/Header";
import Card from "./components/Card";
import Sdata from "./Sdata";
import './App.css';
let curDate = new Date();
curDate = curDate.getHours();
let greeting = "";
if (curDate > 1 && curDat... | true |
aa96f05aebff1101ac24450e924f3c2b565b320b | JavaScript | milesAwayAlex/lighthouse-labs-katas | /multiplicationTable.js | UTF-8 | 393 | 3.828125 | 4 | [] | no_license | const multiplicationTable = function (maxValue) {
let res = [];
for (let x = 1; x <= maxValue; x++) {
let row = [];
for (let y = 1; y <= maxValue; y++) {
row.push(x * y);
}
res.push(row.join(' '));
}
res = res.join('\n\n') + '\n\n';
return res;
};
console.log(multiplicationTable(1));
co... | true |
61a09d811ef7bfd988046fb9e2937ba26baa5821 | JavaScript | rahulnair25283/xFu | /app/auth/auth.service.js | UTF-8 | 1,116 | 2.53125 | 3 | [] | no_license | 'use strict';
angular.module('service.authentication', [])
.service('AuthService', ['$q', function($q) {
var service = this;
var currentUser;
service.login = function(credentials) {
console.log("In AuthService, attempting to login...");
var response = {
userLoggedIn: false,
error: null
};
try {
... | true |
45a078fcc4010a7ff40802c5e2806d850eed290e | JavaScript | NhiHieu/Healthy-Farm-v2 | /healthy-farm2/public/javascripts/user/postLogin.js | UTF-8 | 2,837 | 2.6875 | 3 | [] | no_license | let validateLogin = false;
let loginEmail = $('#login-email'),
loginPassword = $('#login-password');
$(document).ready(function(){
if (localStorage.getItem('status')) {
toastr.success(localStorage.getItem('status'), "Success");
localStorage.clear();
}
$('#signup-link, #login-link').click((... | true |
48ed2779d87f52c457a86268d35250ec8a4d79fc | JavaScript | mprasu/Sample-Projects | /javascriptexamples/display.js | UTF-8 | 379 | 3.015625 | 3 | [] | no_license | function phonenumberValidate(){
var Phonenumber=document.getElementById('Phonenumber').value;
var PhonenumberId=document.getElementById('PhonenumberId')
if(Phonenumber.length==8 || Phonenumber.length==10)
{
PhonenumberId.textContent="valid"
PhonenumberId.style.color="green"
}
else
{
PhonenumberId.textConte... | true |
4fc8f337dadd7aaa8d4115fd4d2b7de6268b361a | JavaScript | danletson/canvas_BG | /chevs/chevs.js | UTF-8 | 1,258 | 3.125 | 3 | [] | no_license | // "Chevs" canvas element background generator
// Copyright 2013 Daniel Letson
// canvas.daniel-letson.com
$(document).ready(function(){
var canvas = $("#c")[0]; //initialize your canvas element here
canvas.width = $(window).width(); //comment this out if you're not using this as a background
canvas.height = $(windo... | true |
d896f99c89590dd1414321959fa7275d29704bb5 | JavaScript | ZhangChuanyi/swagger-document-ui | /config/generatePom.js | UTF-8 | 869 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | const fs = require("fs");
const pg = JSON.parse(fs.readFileSync(__dirname + '/../package.json', { encoding: 'UTF-8' }));
let data = fs.readFileSync(__dirname + '/pom.template.xml', { encoding: 'UTF-8' });
data = data.replace(/{{artifactId}}/g, pg.name);
data = data.replace(/{{version}}/g, pg.version);
const contribu... | true |
41933bb2237739b092f7f78c780ef5d3d98e357b | JavaScript | zcySmile/docker-test | /learnVirtualDom/src/snabbdom/h.js | UTF-8 | 807 | 2.578125 | 3 | [] | no_license | /*
* @Author: zcySmile
* @Date: 2021-01-03 09:37:52
* @LastEditors: zcySmile
* @LastEditTime: 2021-01-03 09:55:08
* @Description:
*/
import vnode from './vnode.js'
// 三个参数,sel, data, c(c可能是文本,数组,或者vnode实例)
function h(sel, data, c) {
if (arguments.length !== 3) {
throw new Error('必须三个参数')
}
/... | true |
8c99688bcdb7f1fa200fc4c88c10c6eb96cbc5a2 | JavaScript | ericnishio/finnish-holidays-js | /test/finder-spec.js | UTF-8 | 1,060 | 2.75 | 3 | [
"MIT"
] | permissive | var expect = require('chai').expect;
var finder = require('../lib/finder');
describe('finder', function() {
it('should find next holiday', function() {
var nextHoliday = finder.after(6, 2016, 0);
expect(nextHoliday).to.eql({
description: 'Independence Day',
day: 6,
month: 12,
year: 2... | true |
d23c51f2d0770e880534fef61363303af39d17b4 | JavaScript | joellobo/express-playground | /app2/server/index.js | UTF-8 | 305 | 2.546875 | 3 | [] | no_license | var express = require('express');
var cors = require('cors')
var app = express();
app.use(cors())
app.get('/',function(req,res){
const body = req.body;
//res.send("Body:" + body);
res.json({ body: body })
});
app.listen(8080,function(){
console.log("Servidor ativo no porto 8080");
});
| true |
2b0c3e269816fde72771c03533801bab693ad86a | JavaScript | pavmohan/corvus | /admin/scripts/auth.js | UTF-8 | 747 | 3.046875 | 3 | [] | no_license | var token = getCookie('CheeseDiary_token')
var isAdmin = getCookie('CheeseDiary_isAdmin')
if (token == "" || isAdmin == "") {
window.location.href="/admin/home";
}
if (isAdmin != "1") {
window.location.href="/admin/home";
}
// TODO: call API to ensure its a valid token
// https://www.w3schools.com/js/js_cookies... | true |
c11bc1f3a8301715229597cbfdf0423cbf643df2 | JavaScript | avery-pierce/push-dispatch-store-sqlite | /lib/index.js | UTF-8 | 7,138 | 2.625 | 3 | [] | no_license | 'use strict';
const fs = require('fs');
const sqlite3 = require('sqlite3');
const uuidv4 = require('uuid/v4');
const DEVICES_TABLE = 'Device';
const TRANSACTIONS_TABLE = 'PushTransaction';
const USER_DEVICE_TABLE = 'UserDevice';
const INITIALIZE_SCHEMA_1_FILEPATH = `${__dirname}/sql/initialize_schema_1.sql`;
class... | true |
756513cf3600cc2c79555d1a091ac20240dfa0af | JavaScript | intelie/puppeteer-bin | /wrapper.js | UTF-8 | 786 | 2.984375 | 3 | [] | no_license | /**
* This should work just like node: node ./jsfile-to-drive-puppeteer.js
*
*/
var fs_ = require('fs');
var { promisify: promisify_ } = require('util');
require('puppeteer');
require('path');
async function main() {
try {
const fileAccess = promisify_(fs_.access);
await fileAccess(process.... | true |
07b25d5c1ea18c24861171b76bebe5e1a9b4118a | JavaScript | carlixyz/Arkadium | /scripts/Congratulations.js | UTF-8 | 3,376 | 2.859375 | 3 | [] | no_license |
BasicGame.Congratulations = function (game) {
// this.music = null;
this.logo = null;
this.playButton = null;
this.WinnerText = null;
this.gameMessageText = null;
this.scoreText = null;
};
BasicGame.Congratulations.prototype = {
create: function () {
// We've already preloaded our assets, so l... | true |
985a385faf6d0a2644bb5acdd2a68f07adebacc7 | JavaScript | silviya-stoyanova/software-university | /JS Web/ReactJS Fundamentals/03. Events and Forms/Exercise/solution/client/src/components/pokemon/getAll.jsx | UTF-8 | 1,076 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react'
class AllPokemons extends Component {
constructor(props) {
super(props)
this.state = {
pokemons: []
}
}
render() {
return (
<div>
{this.state.pokemons.map((p, index) => {
... | true |
8bcc9f86d24d4d5731f6705e24d33f3cf28ed050 | JavaScript | joydip-git/verizon-reactjs-12thOctober2020 | /codes/day-4/react-hooks-demo/src/Counter.js | UTF-8 | 1,203 | 2.890625 | 3 | [] | no_license | import React, { useState } from 'react'
const Counter = () => {
//(obj)=>{ return [stateData,functionToUpdateData]; }
const [counterState, setCounterState] = useState({ counter: 0, name: 'anil' })
//const [counterState, setCounterState] = useState(0)
const [showState, setShowState] = useState(true)
... | true |
ab98bfdf674de33bee798e6484fcca3ff88f4a0f | JavaScript | Two-Progamador-BR/Two-Music-Oficial- | /index.js | UTF-8 | 894 | 2.5625 | 3 | [
"MIT"
] | permissive | const dbd = require("dbd.js")
const bot = new dbd.Bot({
token:process.env.TOKEN,
prefix: "prefixo do seu bot"
})
const app = require("express")();app.get('/', (req, res) =>{res.send("Estou funcionando");});app.listen(8080);
// Callbacks
bot.onMessage()
bot.status({
text: "Status do seu bot",
type: "STREAMI... | true |
a22d84dcb6a40ad4422aa46f4e7f634236c7a4e0 | JavaScript | sugarlabs/gci2016 | /attachments/5479184614817792-script.js | UTF-8 | 9,428 | 2.859375 | 3 | [] | no_license | var t_initial,r_initial,t_final,r_final;
function loaded(){
var table = document.getElementById("environment");
var header = table.createTBody();
var r;
var i;
for (r=0;r<15;r++){
var row = header.insertRow(0);
for (i = 0; i < 25; i++) {
var cell = row.insertCell(0);
}}
obstruct();
target(... | true |
874f81ae2f04227f3bb1ce5559bd9be3524ec270 | JavaScript | lightyaer/MyCodingTrain | /Binary Search Tree/Main.js | UTF-8 | 256 | 3.015625 | 3 | [] | no_license | let Tree = require('./Tree');
let tree = new Tree();
for (var i = 0; i < 10; i++) {
tree.addValue(Math.ceil(Math.random() * 100) + 1);
}
console.log(JSON.stringify(tree, undefined, 2));
tree.traverse();
let res = tree.search(10);
console.log(res); | true |
9be83a34ab5c5aaf6ee09134f6b7fcf8b7e35395 | JavaScript | MZMonster/apimaster | /client/src/reducers/site.js | UTF-8 | 2,366 | 2.53125 | 3 | [] | no_license | import { actionTypes } from '../actions/site';
const initialState = {
isFetchingSites: false,
sites: [],
selectedSite: null,
isFetching: false,
site: {},
changeFlag: false,
};
export default function (state = initialState, action) {
switch (action.type) {
// 获取站点
case actionTypes.FETCH_SITE_PEND... | true |
4852be0135081b0d787357afff54fa387fdadfcf | JavaScript | matthewtregg/RashiRepository | /src/components/SourceBrowser/SourceBrowser.js | UTF-8 | 2,613 | 2.5625 | 3 | [] | no_license |
import React from 'react';
import './SourceBrowser.css';
import moment from 'moment';
import CustomContextContainer from '../../containers/CustomContextContainer';
export const SourceBrowser = ({
pgmSourceList,
screenId,
setPgmListWindowMode,
setWhereUsed,
pgmListWindowMode
}) => {
//date cre... | true |
296a8e12da8eca1bd1275bd665e4dd282cd740ec | JavaScript | hamsent/CodiGo6-avance | /Semana10/Dia5/01-ajax.js | UTF-8 | 3,423 | 3.3125 | 3 | [] | no_license | window.onload = function () {
var btnTraerDatos = document.getElementById("btnTraerDatos");
var tabla = document.getElementById("tabla");
function ponerDatos(personas) {
tabla.ennerHTML = `<thead>
<th>ID</th>
<th>Nombre</th>
... | true |
68b516f06a8cb023e173d9ec67e255bc97e166de | JavaScript | IPConvergence/sensorCO2 | /index.js | UTF-8 | 1,064 | 2.984375 | 3 | [
"Apache-2.0"
] | permissive | // Part 1: Generate the Crypto Material for Eliptic Curve
const { zenroom_exec, zencode_exec } = require('zenroom')
// Zencode Hello World!
const zencode = `
Scenario 'ecdh': Create the keypair
Given that I am known as 'Alice'
When I create the keypair
Then print my data
`
zencode_exec(zencode)
.then((resul... | true |
0a98092511b16d5033c8d844e181e1b4ef85c0fa | JavaScript | wojtas-f/discord_bot_with_rasa | /src/parseMessage/parseMessage.js | UTF-8 | 363 | 2.734375 | 3 | [] | no_license | exports.parseMessage = (data) => {
const response_list = []
data.forEach((rasa_response) => {
response_list.push(rasa_response.text)
if (rasa_response.buttons) {
console.log(rasa_response.buttons)
let buttons = rasa_response.buttons
buttons.forEach((button) => {
response_list.push(`_> ${button.title... | true |
b69aa46c0e708bba81c683085e53659592be1895 | JavaScript | philister16/html-email | /index.js | UTF-8 | 5,423 | 3.171875 | 3 | [
"MIT"
] | permissive | const path = require('path');
const fs = require('fs');
const hbs = require('handlebars');
/** Global class from which a new HtmlEmail object is created */
class HtmlEmail {
/** Class constructor for HtmlEmail class. Takes 3 arguments.
* @constructor
* @param {string} name - Name of the email json template to... | true |
f282b61246137f09746ba5849db6199f35664500 | JavaScript | deniseli/StrunkAndWhiteLinter | /tests/MDFA.js | UTF-8 | 2,012 | 2.78125 | 3 | [] | no_license | "use strict";
var MDFA = require("../js/MDFA.js");
var sinon = require("sinon");
var assert = require("chai").assert;
/**
* @param {String} word
* @return {Array<String>} errs
*/
var runCheck = function(word) {
var checks = new WordMatchChecks();
return checks.run(word);
};
/**
* @param {String} err: sh... | true |
695e03374a9d3ec7b5b81a106183d34d3df5ab4b | JavaScript | Turfjs/turf | /packages/turf-buffer/index.js | UTF-8 | 5,984 | 2.828125 | 3 | [
"MIT"
] | permissive | import center from "@turf/center";
import { BufferOp, GeoJSONReader, GeoJSONWriter } from "@turf/jsts";
import { geomEach, featureEach } from "@turf/meta";
import { geoAzimuthalEquidistant } from "d3-geo";
import {
feature,
featureCollection,
radiansToLength,
lengthToRadians,
earthRadius,
} from "@turf/helper... | true |
24793f92e5acef938e54312b9799de02ebb7891c | JavaScript | zbinlin/mkdir-promise | /index.js | UTF-8 | 1,550 | 2.828125 | 3 | [] | no_license | "use strict";
var path = require("path");
var fs = require("fs");
function _exists(filepath) {
return new Promise(function (resolve) {
fs.exists(filepath, function (exists) {
resolve(exists);
});
});
}
function _stat(filepath) {
return new Promise(function (resolve, reject) {
... | true |
7a6874a99d21164efad44fb1bf8f44c5e0f47673 | JavaScript | sanchitgoel/esLint-project | /js/components/Footer.js | UTF-8 | 1,179 | 2.53125 | 3 | [] | no_license | //This component displays the footer element
//This will help in pagination of the search results
//Import Statements
import React from "react";
import ReactDOM from "react-dom";
// Favourite Class created which extends component from class "React"
class Footer extends React.Component {
render(){
let paginat... | true |
54fc1a7571dc5dabbb8388de419edd276fc6ec9c | JavaScript | ldesrosi/iot-tank-server | /openwhisk-vision/analysis.js | UTF-8 | 7,904 | 2.640625 | 3 | [] | no_license | /**
* Copyright 2016 IBM Corp. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the “License”);
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... | true |
7a2a81a560c0f7c7b037e8973cb66a78458cd0d1 | JavaScript | kdolic/web-guided-project-lifecycle | /pokemon/src/App.js | UTF-8 | 1,587 | 3.15625 | 3 | [] | no_license | import React from 'react';
import data from '../data';
import './styles.scss';
import Pokemon from './components/Pokemon';
class App extends React.Component {
state = {
pokemon: [],
highlightedPokemon: {}
};
// set up cDM, set 'data' to the pokemon state
componentDidMount() {
conso... | true |
41467dea3b78606bfc86540072699bcaf396a5e1 | JavaScript | Pyro-Chicken/PP-BOT | /PP_DC_BOT - REPO/commands/Info/args-info.js | UTF-8 | 1,227 | 2.546875 | 3 | [] | no_license | const Discord = require('discord.js');
const { prefix, token, version } = require('./../../config.json');
const { red, green, blue, lime, orange, yellow, turquoise } = require('./../../colors.json')
module.exports.run = async (bot, message, args) => {
if(!args.length){
return message.channe... | true |
883d9a5f8d55800c120b9cb1a97fa67b7ef724fd | JavaScript | bigbanggk01/BestWebSite | /script.js | UTF-8 | 1,289 | 2.5625 | 3 | [] | no_license | //variable definition
var modal = document.querySelector('.modal');
var loginAndRegisterElements= document.querySelectorAll('.header__nav__item');
var switchBtn=document.querySelector('.account-form__1 .account-form__switch-btn');
var accountLogForm;
var accountRegForm;
//app declaration
document.querySelector('.modal'... | true |