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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2e906aafb3184c9675bf14df7c1bd8008c0d3fef | JavaScript | oliverlai55/Programming-Practices | /Exercises/reverse-string.js | UTF-8 | 665 | 4.34375 | 4 | [] | no_license | // Using the JavaScript language, have the function FirstReverse(str) take the str parameter
// being passed and return the string in reversed order.
// Input:"coderbyte"
// Output:"etybredoc"
//
// Input:"I Love Code"
// Output:"edoC evoL I"
//Method 1
function FirstReverse(str){
var stringArray = [];
revers... | true |
40155dd9a93a7bfc5288d17c1d04a268f8a909f7 | JavaScript | B34tdb/Digimon- | /JavaScript/Storabimon.js | UTF-8 | 487 | 2.9375 | 3 | [] | no_license | function escolha(){
var escolha = prompt ('Digite 1 para procura o Digimon lendario e 2 para derrotar a Lilithmon')
while(true)
if (escolha == 1 ){
return location = ('../HTML/Storabimon4alt.html')
}else if (escolha == 2 ){
return location = ('../HTML/Storabimon4.html')
... | true |
057fb33b2864978cef1b2eae659d780ffd630bbc | JavaScript | mokiwis/ProyectoFinal | /js/action.js | UTF-8 | 821 | 2.53125 | 3 | [
"MIT"
] | permissive | function mandarEvidencias(){
var evidencias = "";
evidencias = "<form id='fotosYvideos'>" +
"<h1 class='textoExplicativo2'>foto1: <input type='file' name='foto1'></h1>" +
"<h1 class='textoExplicativo2'>foto2: <input type='file' name='foto2'></h1>" +
"<h1 class='textoExplicativo2'>foto3: <input type='fil... | true |
615d160383e20da2355130d6aafd2d5b7a2da47d | JavaScript | ConchordanceProject/simplesvg-js | /simplesvg.js | UTF-8 | 3,247 | 2.96875 | 3 | [
"MIT"
] | permissive | /*
* 2014 Alex Foran
* https://github.com/forana/simplesvg-js
*/
var ns = "http://www.w3.org/2000/svg";
var applyProperties = function(obj, properties) {
if (properties) {
for (var property in properties) {
if (properties.hasOwnProperty(property)) {
obj.setAttribute(property... | true |
dd7c44581e0e89ea6a48c3650449d14933e5820b | JavaScript | zalora/sproxy-web | /static/js/rules.js | UTF-8 | 2,896 | 2.65625 | 3 | [
"MIT"
] | permissive | var postUrl = '/domain/' + domain + '/privilege/' + privilege + '/rules';
makeEditable('.path-edit', pathUpdate, postUrl);
makeEditable('.method-edit', methodUpdate, postUrl);
function sendRule(pathField, methodField, onSucc, onErr, addRow) {
$.post( postUrl
, { operation: "add", path: pathField, method... | true |
5d8c06f61576fd478886a797ced76e8d6c652967 | JavaScript | vinaygunnam/REACTions | /apps/like-meter/App.jsx | UTF-8 | 756 | 2.90625 | 3 | [
"MIT"
] | permissive | var Post = require("./Post");
var post = {
title: "Some title",
body: "A long story about another story.",
votes: 0
};
class App extends React.Component {
constructor() {
this.state = {
posts: [post]
};
}
updatePost(index, post) {
var posts = this.state... | true |
758540e09b57691ce931125bb12fc130e7bdd7e2 | JavaScript | gabetsang/es6-with-mocha | /test/curry.js | UTF-8 | 654 | 2.65625 | 3 | [] | no_license | import assert from 'assert';
import cuAdd from '../curry';
describe('Test cuAdd function', function() {
it('should return 6 when there are 1,2,3 in the argument', function() {
assert.equal(cuAdd(1, 2, 3), 6)
})
it('should return 6 when there is 1 in the first call and 1,2 in the second call', f... | true |
df47996c74734abf56fde2fa3cadbc52acf87ed2 | JavaScript | coreline/sandbox | /watch/js/entity.js | UTF-8 | 1,395 | 3.421875 | 3 | [
"CC0-1.0"
] | permissive |
function VisaulizeCircle(x, y, r, fillStyle, strokeStyle) {
context.beginPath();
context.arc(x, y, r, 0, 2 * Math.PI);
context.fillStyle = fillStyle;
context.fill();
context.strokeStyle = strokeStyle;
context.stroke();
}
var Entity = function() {
this.fillStyle = 'black';
this.strokeStyle = 'black';... | true |
89dd842e8ce62a356347b4965350747c887f4fef | JavaScript | jhhoward/WebSCI | /html/js/Segment.js | UTF-8 | 4,220 | 2.59375 | 3 | [] | no_license | var SegmentType = {
SEG_TYPE_INVALID : 0,
SEG_TYPE_SCRIPT : 1,
SEG_TYPE_CLONES : 2,
SEG_TYPE_LOCALS : 3,
SEG_TYPE_STACK : 4,
// 5 used to be system strings, now obsolete
SEG_TYPE_LISTS : 6,
SEG_TYPE_NODES : 7,
SEG_TYPE_HUNK : 8,
SEG_TYPE_DYNMEM : 9
// 10 used to be string fragments, now obsolete
/*#ifdef EN... | true |
4edd35344e6f4837e7e264fc97e61279963028b5 | JavaScript | surgentt/angular-learning | /app/assets/javascripts/angular-tut/core/checkmark/checkmark.filter.js | UTF-8 | 318 | 2.515625 | 3 | [] | no_license | angular.
module('core').
filter('checkmark', function() {
return function(input) {
return input ? '\u2713' : '\u2718';
};
});
//The input evaluates to either true or false,
//and we return one of the two unicode characters we have chosen to represent true (\u2713 -> ✓) and false (\u2718 -> ✘) | true |
e83e077efcd4e550d5d7b38d1abf964c7d893c79 | JavaScript | endojs/endo | /packages/test262-runner/test262/test/language/literals/regexp/u-astral.js | UTF-8 | 1,892 | 2.78125 | 3 | [
"Apache-2.0",
"BSD-3-Clause",
"LicenseRef-scancode-ecma-no-patent"
] | permissive | // Copyright (C) 2015 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Literal astral symbols within a pattern
es6id: 21.2.2.8.2
info: |
21.2.2.2 Pattern
The production Pattern :: Disjunction evaluates as follows:
1... | true |
50f5b846af19799af89b322d316b4b90cf9de612 | JavaScript | paoim/CollectionJs | /advanceJQuery/js/controller/EventListenerController.js | UTF-8 | 722 | 2.984375 | 3 | [
"MIT"
] | permissive | //Create Class by using closure
var ListenerController = function(){
//private functions
var setListItemListener = function(selector, eventHandler){
selector.click(function(){
selector.removeClass("active");
$(this).addClass("active");
eventHandler($(this),selector);
});
},
setOnButtonClickListener = f... | true |
b30f5ac50ab764a738617bd60db0a909e3185b2f | JavaScript | AlicePorton/react-tutoriial | /src/website/components/common/slider/mouse-event.js | UTF-8 | 1,737 | 2.671875 | 3 | [] | no_license | import document from 'global/document';
function nope() {}
export default class MouseEventHandler {
constructor({
vertical = false,
valueListener = nope,
toggleMouseOver = nope
}) {
this._vertical = vertical;
this._valueListener = valueListener;
this._toggleMouseOver = toggleMouseOver;
... | true |
1f2cb99f5fa2a9a6ba11dc7f7f4c2687b181481e | JavaScript | mrlnlng/Game-of-Life | /app.js | UTF-8 | 2,658 | 3.265625 | 3 | [] | no_license | ///<reference path="p5.global-mode.d.ts"></reference>
class Game {
constructor(gridWidth) {
this.numX = Math.floor(width / gridWidth);
this.numY = Math.floor(height / gridWidth);
this.matrix = [];
for (let i = 0; i < this.numX; i++) {
this.matrix[i] = []
for (... | true |
6f3967cb689542148c8206dbe939df93eadf9e84 | JavaScript | dariodanielbenitez/MyBondi | /index.js | UTF-8 | 2,574 | 2.765625 | 3 | [] | no_license | //creacion del servidor
const express = require('express');
const app = express();
const server = require('http').createServer(app);
const io = require('socket.io').listen(server);
server.listen(process.env.PORT || 4000);
console.log('el servidor esta corriendo...');
Send_Users();
app.use(express.static('pu... | true |
e8f8afa1524d72399d59aa7560e3bbb34556bbb1 | JavaScript | kurokoda/loki-boilerplate-mern | /src/actions/page/index.js | UTF-8 | 3,408 | 2.65625 | 3 | [] | no_license | import { push } from 'connected-react-router';
import { setIsLoading } from '../../actions/application';
import { getConfigForType } from '../../utils/route';
export const FETCH_PAGE_DATA = 'FETCH_PAGE_DATA';
export const FETCH_PAGE_DATA_ERROR = 'FETCH_PAGE_DATA_ERROR';
export const FETCH_PAGE_DATA_SUCCESS = 'FETCH_PA... | true |
db80c450001606ed029a1f413030f682bbaa2c5e | JavaScript | augustolimald/trophys-room | /src/public/games/update/index.js | UTF-8 | 4,036 | 2.953125 | 3 | [
"MIT"
] | permissive | const user = createNavBar();
let selectedGenre = -1;
function handleGenreDropdownClick(id, name) {
selectedGenre = id;
document.getElementById('dropdown-genres-text').innerHTML = name;
}
let selectedPublisher = -1;
function handlePublisherDropdownClick(id, name) {
selectedPublisher = id;
document.getElementBy... | true |
7b88d34b3ea1453d63138479fedf3516270b003b | JavaScript | nxj1129/myPortfolio | /assets/js/obfuscate.js | UTF-8 | 383 | 2.734375 | 3 | [] | no_license | function obfuscate() {
const baffleText = baffle(document.querySelector("#baffle-this"));
baffleText.set({
characters: "█░▓ >▒▓▒> ▓▒▓▓▒ /▓░ ▓//█/ ▓>█▓ ▒<░ ▒▒░▒ ░>██",
speed: 120,
});
baffleText.once();
baffleText.reveal(3000);
}
document.addEventListener("DOMContentLoaded", function () {
obfuscat... | true |
0a6a81770e5c42d7660d0057e6400264d2fe0715 | JavaScript | vtproduction/vuibongda | /05_IMPLEMENTATION/05_01_HYBRID/Trunk/assets/www/js/objects.js | UTF-8 | 7,229 | 2.84375 | 3 | [] | no_license | // Bet info
function betObj(bet, matchId, betType, betValue, matchHandicap, betHomeGoal, betGuestGoal, betResult, betResultValue)
{
this.bet = bet;
this.matchId = matchId;
this.betType = betType;
this.betValue = betValue;
this.betHomeGoal = betHomeGoal;
this.betGuestGoal = betGuestGoal;
th... | true |
fc0fc6a92185ab05ff66b16ab2948f4624e2df5a | JavaScript | cheminfo/dataset-plugin | /src/org/cheminfo/scripting/dataset/Dataset.js | UTF-8 | 60,456 | 2.734375 | 3 | [] | no_license | /**
* @object Dataset
* Library that allows to load datasets and apply functions on the whole data.
**/
var Dataset = (function () {
'use strict';
var Dataset = {};
Dataset.toJSON = function () {
return 'Dataset plugin';
};
/**
*
* @function show(path, exportName, options)... | true |
21edf60259545c4798541b6627278cb699013061 | JavaScript | Zangetu121345/React | /module1/hooks/src/useState/Infinite.js | UTF-8 | 1,312 | 3 | 3 | [] | no_license | // import React, {useState} from 'react'
// function Uswo() {
// const [msgObj,setMsgObj]=useState({message:''});
// const handleChange =(e)=>{
// // bellow to line m nya object nhi bnra to change hoga lekin
// //react detect nhi karega chaneg kyuki object ka address compare krta h or
// ... | true |
29f50d3b08fd981da11eb1ad4b1964db6c872334 | JavaScript | SrGodrik/tools | /RouterScan/help/data/code.js | UTF-8 | 1,550 | 2.5625 | 3 | [] | no_license | function ShowCode(Code)
{
var tPAS = document.getElementById('CodeSnippetContainerTab_PAS');
var cPAS = document.getElementById('CodeSnippetContainerCode_PAS');
var tPS = document.getElementById('CodeSnippetContainerTab_PS');
var cPS = document.getElementById('CodeSnippetContainerCode_PS');
var tCPP = docume... | true |
e768b13eedee15837163f127d04515865836e542 | JavaScript | shahmehul/javascript-cracking-the-coding-interview | /Front-End/FindNodeFromDOMTree.js | UTF-8 | 1,547 | 3.578125 | 4 | [] | no_license | /**
* Created by mshah on 5/7/17.
*/
var rootA, rootB;
// recursive
function findNodeB(nodeA) {
// Variable to store path up the DOM tree
var travelPath = [];
// Method to travel up the DOM tree and store path to exact node
var establishPath = function(travelNode) {
// If we have reached the top level node we ... | true |
5a9b991544498d42eea637e0ebcc8ac89ced7dca | JavaScript | zdurham/TriviaGame | /assets/javascript/app.js | UTF-8 | 10,486 | 2.984375 | 3 | [] | no_license | $(document).ready( function() {
// Declare objects (actual trivia questions) in an array of objects
var questions = [
{
question: "This film, released in 1958 and directed by Akira Kurosawa, is considered one of the greatest inspirations for George Lucas' Star Wars: Episode IV - A New Hope.",
answer... | true |
3cce1087cbd608a3aad7da5107e15397a0c0c2ed | JavaScript | Misacorp/leetclient | /src/util/addEmptyMessagesToAbsentDates.js | UTF-8 | 1,642 | 3.15625 | 3 | [] | no_license | import MessageObject from '../types/User/MessageObject';
/**
* Message arrays do not contain any records for dates where a message was not posted.
* This function fills the gaps with empty messages.
* @param {Array} messages Array of messages
*/
const addEmptyMessagesToAbsentDates = (messages) => {
const message... | true |
c9512f474fadc802add8f0b486f36461454565bd | JavaScript | huohuoit/leetcode-practice | /leetcode-practice/049字母异位词分组group-anagrams/group-anagrams.js | UTF-8 | 549 | 3.328125 | 3 | [] | no_license | /* leetcode 049字母异位词分组group-anagrams JavaScript实现 */
/** * @param {string[]} strs * @return {string[][]} */
var groupAnagrams = function(strs) {
var obj = {};
for (var i = 0; i < strs.length; i++) {
var str = strs[i];
var key = strs[i].split('').sort().join('');
if (!obj[key]) {
... | true |
d11f17101807eab96b22cd6aa7c0020f5d069e57 | JavaScript | cmatlock/clover-community-bot | /assets/izzy.js | UTF-8 | 1,036 | 2.90625 | 3 | [] | no_license | $(document).on('show.bs.modal', function(event){
// Quick View; Grabs the body of the question based on the ID
var button = $(event.relatedTarget);
var nodeID = button.data('commid');
var modal = $(this);
makeRequest(nodeID);
});
var httpRequest;
function makeRequest(nodeID){
httpRequest = new XMLHttpRequ... | true |
c5dcb333b333b1bfd4f6d4a7babe95a8c15fa3b2 | JavaScript | ankitaambewadikar/JAVASCRIPT_ASSIGNMENTS | /DAY_1/NodeJS_Assignments/que_4.js | UTF-8 | 306 | 3.5625 | 4 | [] | no_license | function main(){
var num = 27,cnt=0;
for(var count = 1; count <= num ; num ++){
if( num % count == 0){
break;
}
}
if(cnt==2){
console.log("the given number is prime");
}
else{
console.log("Number is not prime");
}
}
main(); | true |
e1db5420017df6d0e73ba9eef850265be3aaca37 | JavaScript | g-szerminski/nodeschool | /lodash/countTheComments.js | UTF-8 | 809 | 3.046875 | 3 | [] | no_license | const lodash = require('lodash');
const countedComments = function(arr) {
return lodash.chain(arr)
.groupBy('username')
.map(function(item, name) {
return {username: name, comment_count: lodash.size(item)}
})
.sortBy(function(counted) {
return -counted['comment_count'];
})
};
module.exports = countedComment... | true |
db01e327dae6c6b34cbc13f1de0078b80c91e5e3 | JavaScript | iliyaST/TelerikAcademy | /JavaScript-Fundamentals/9-Strings/07.ExtractUrl.js | UTF-8 | 1,012 | 2.90625 | 3 | [
"MIT"
] | permissive | function solve(args) {
var url = args[0].split(''),
inProtocol = false,
inServer = false,
protocol = '',
server = '',
resource = '',
index;
inProtocol = true;
for (index = 0; index < url.length; index += 1) {
if (inProtocol) {
if (url[inde... | true |
19afcb1b7b7fd9fef9cc17e4bbc40e60222ad98b | JavaScript | kAVArd/mern-crud-todos | /react/src/actions/editTodo.js | UTF-8 | 1,221 | 2.5625 | 3 | [] | no_license | import axios from 'axios'
export const FETCH_TODO = 'FETCH_TODO'
export const UPDATE_TODO_COMPLETED = 'UPDATE_TODO_COMPLETED'
export const UPDATE_TODO_DESCRIPTION = 'UPDATE_TODO_DESCRIPTION'
export const UPDATE_TODO_PRIORITY = 'UPDATE_TODO_PRIORITY'
export const UPDATE_TODO_RESPONSIBLE = 'UPDATE_TODO_RESPONSIBLE'
exp... | true |
8d6d71cef1a0372249ccc1d76e456b4e21237530 | JavaScript | fabricedano/DNDGeneration-front | /src/Components/CharacterComponents/CharacterAbilityComponent.js | UTF-8 | 11,761 | 2.578125 | 3 | [] | no_license | import React, { Component } from 'react'
import './characterComponent.css'
import { Form, Row, Col, Table } from 'react-bootstrap';
import Select from 'react-select'
class CharacterAbilityComponent extends Component {
constructor(props){
super(props);
this.onStrengthChange = this.onStrengthChange.b... | true |
9fa62520b134055936c3f081d2535e883e1c0434 | JavaScript | mganandraj/HubAppHost | /packages/build-tools/teams-common/teams-mobile-sdk/dist/tools/config/SdkConfigManagerCli.js | UTF-8 | 1,610 | 2.53125 | 3 | [] | no_license | "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const minimist = require("minimist");
const SdkConfigManager_1 = require("./SdkConfigManager");
try {
const args = minimist(process.argv.slice(2));
if (args['k'] && args['v']) {
SdkConfigManager_1.SdkConfigManager.set(ar... | true |
c9302dff9c53572feca6ce28174ed9f0884690c3 | JavaScript | VAIBHAV-2303/GKuiz2 | /react-app/src/components/DeleteQuiz.js | UTF-8 | 3,136 | 2.96875 | 3 | [] | no_license | import React, { Component } from 'react';
import './DeleteQuestion.css';
class DeleteQuiz extends Component {
constructor() {
super();
this.state = {
data: [],
curQuizNumber: 0,
numberOfQuizzes: new Array(100),
curCategory: "",
}
this.state.numberOfQuizzes.fill(0);
this... | true |
a1f80ff94f6b7f73a51e4d88f080ed808125b19e | JavaScript | wangdingfeng/myblog-master | /src/main/webapp/static/js/utils.js | UTF-8 | 2,274 | 3.375 | 3 | [
"MIT"
] | permissive |
/**
* @description: 日期格式化
* @param : 格式类型 例:yyyy-MM-dd
* @example:
* var date = new Date().format("yyyy-MM-dd");
* console.info(date);
* 控制台输出:2016-05-10
* @author: zhaxianhe
* @createtime: 2016年5月10日下午2:28:47
*/
Date.prototype.format = function(fmt){
var o = {
"M+" : this.getMonth() + 1, ... | true |
f2b7206cad6aba5a559d7f9d33757b56321ca3d6 | JavaScript | Febianodja/pertemuan-7 | /upperCaseArray.js | UTF-8 | 550 | 3.40625 | 3 | [] | no_license | let animals = ["kucing","sapi","AyAm","anJinG"]
let animalsUpperCase = animals.map(upperCase => {
return upperCase.toUpperCase()
})
console.log(animalsUpperCase);
function swapCase(words){
let result = [];
let wordsArr = words.split(' ');
for(let i = 0 ; i < wordsArr.length ; i++){
if(i % 2 =... | true |
4923a5e2ab1f8d7727b9c66ac59a8fdcdbddf46a | JavaScript | Shreenidhi7/JavaScript | /Oops/StockAccount/StockCompany.js | UTF-8 | 5,925 | 2.796875 | 3 | [] | no_license | module.exports={
commercial(data, data1, data2) {
var answer = readline.question("Press.. \n 1. create \n 2. open \n 3. edit \n 4. exit ");
if (answer == 1) {
this.create(data, data1, data2);
}
else if (answer == 2) {
this.open(data, data1, data2);
}
... | true |
a9a5557cb5d6b9cdb7028db87bc0f460e409b43d | JavaScript | vsparrow/nodeschool-learnyounode | /10TimeServer.js | UTF-8 | 747 | 3.5 | 4 | [] | no_license | // ## TIME SERVER (Exercise 10 of 13)
const net = require("net")
const port = process.argv[2]
const padDate = dateItem => {return dateItem < 10 ? '0' + dateItem : dateItem}
const getDate = ()=>{
const date = new Date() //format: "YYYY-MM-DD hh:mm"
let year = date.getFullYear()
let month... | true |
c4168f48ac1659932eb14105ece7c382b56c8f79 | JavaScript | armec19/imtrade | /IMTRADE/src/main/webapp/Account/File/steps/css/table_att_ap.js | UTF-8 | 1,194 | 2.6875 | 3 | [] | no_license | var fileTypes = ['pdf']; //acceptable file types
function readURL(input) {
if (input.files && input.files[0]) {
var extension = input.files[0].name.split('.').pop().toLowerCase(), //file extension from input file
isSuccess = fileTypes.indexOf(extension) > -1; //is extension in acceptable t... | true |
353edd9fb5c4eb9d8687ab63c81d1b2bf6d009e5 | JavaScript | FreddyFreaker/FSW-113 | /Week 2/Arrow Function/CLO3.js | UTF-8 | 102 | 2.828125 | 3 | [] | no_license | var temp = ( multiplier, devider ) => 104 * multiplier/ devider
console.log(temp(3, 6))
//value = 52 | true |
d3695cd44ae74ff553b482f89354a34b9d54c6fa | JavaScript | DSPMC/html5-canvas-sample | /animate/app2.js | UTF-8 | 10,443 | 3.578125 | 4 | [] | no_license | // 1
function writeMessage(context, message){
context.font = "18pt Calibri";
context.fillStyle = "black";
context.fillText(message, 10, 25);
}
function basicSample(){
var events = new Events("myCanvas");
var canvas = events.getCanvas();
var context = events.getContext();
canvas.addEventListen... | true |
cafac9e85f3c26f2b095df982b1b8606cf3a4f9a | JavaScript | meteor-atomic/atomic | /packages/comments/common/comments.js | UTF-8 | 862 | 2.65625 | 3 | [
"MIT"
] | permissive | /**
* Common methods for the Comments model.
*/
_.extend(Comments, {
/**
* Add the collection
* @type {Meteor}
*/
collection: new Meteor.Collection('comments'),
/**
* Return all comments
* @param {Function} callback Callback
* @return {Cursor}
*/
all: function(callback) {
return Co... | true |
520889c4cf3645ce89baf6d06b59fb80ee92e0c8 | JavaScript | SIholin/lunch-app | /packages/backend/src/controllers/categories.test.js | UTF-8 | 3,243 | 2.625 | 3 | [
"MIT",
"CC0-1.0",
"CC-BY-3.0"
] | permissive | const supertest = require('supertest')
const Category = require('../models/category')
const app = require('../app')
const authorization = require('../util/authorization')
const dbUtil = require('../test/dbUtil')
const testCategoryData = [
{
name: 'Krapula',
},
{
name: 'Salad',
},
{
name: 'Burger... | true |
4ab8e5cd219c631d0266536e606717132a0c5e93 | JavaScript | cassiecorey/Neural-Network | /js/three-app.js | UTF-8 | 26,271 | 2.96875 | 3 | [
"MIT"
] | permissive |
(function main() { "use strict";
// Neuron ----------------------------------------------------------------
function Neuron(x, y, z) {
this.connection = [];
// represents the 1:1 ratio astrocyte associated w/ neuron
this.astrocyte = null;
// the neurons this neuron is connected to
thi... | true |
db85c1d855b0cebeeae54ec2e0526dbb2e9e5944 | JavaScript | focuspadding/fridaMemoryAccessTrace | /index.js | UTF-8 | 6,657 | 2.6875 | 3 | [
"MIT"
] | permissive | const arch = Process.arch;
let breakpoint_ins = null; //不同架构不同的软断点hex 要小写
let writer = null;
// const break_mem = Memory.alloc(4);
// const memcpy_addr = Module.findExportByName('libc.so', 'memcpy');
// const memcpy = new NativeFunction(memcpy_addr, 'pointer', ['pointer', 'pointer', 'int']);
(_=>{
switch (arch) {
... | true |
899bdf052195bd00aa8025c09475a952163fdaf3 | JavaScript | simskiy/template | /src/blocks/logo/logo.js | UTF-8 | 1,068 | 2.921875 | 3 | [
"WTFPL"
] | permissive | let logo = document.querySelector('.logo__img');
let img = document.querySelector('#logo__img');
function changeLogo() {
// if (document.body.innerWidth > 0) {
if (window.innerWidth > 0) {
img.attributes['xlink:href'].value = 'img/svg/index-sprite.svg#logo-mobile';
logo.attributes.width.value = '86';
l... | true |
8aab71020440a106c7f7108935711b9017f09809 | JavaScript | SBGMU/Projet-NewsFeed | /front-end/src/app.js | UTF-8 | 578 | 2.859375 | 3 | [] | no_license | import axios from 'axios'
axios.get('http://127.0.0.1:8080/news')
.then((response) =>{
console.log(response)
var news = "";
for(var i = 0; i < response.data.articles.length; i++ )
{
news = news + response.data.articles[i].publishedAt + " - "+ response.data.articles[i].title +"<li href>... | true |
24281c9e8283f99f059cad49acc4adfa56e54bbc | JavaScript | QWQW9300/CarrlandMZforSSMBS | /js/plugins/DotMoveSystem.js | UTF-8 | 85,320 | 3.609375 | 4 | [] | no_license | /*:
@target MV MZ
@plugindesc Dot movement system v1.5.4
@author unagi ootoro
@url https://raw.githubusercontent.com/unagiootoro/RPGMZ/master/DotMoveSystem.js
@help
It is a plug-in that allows you to move in dot units.
【How to use】
Basically, it can be used just by installing it, but more detailed control is possible ... | true |
41908c58d2f49baac8775911a29d7ce51d0c2157 | JavaScript | VladWild/SimpleChat | /target/simple-chat-1.0/chat/View.js | UTF-8 | 3,151 | 2.953125 | 3 | [] | no_license | function View(model) {
this.model = model;
this.username = $("ins")[0];
this.messages = $("textarea")[0];
this.users = $(".users")[0];
this.send = $("button")[0];
this.field = $("input")[0];
this.logout = $("a")[0];
this.init = function(){
let that = this;
/*отправки н... | true |
9b5f1a330ae82887afdb7e17052e2f1964d5a537 | JavaScript | MurphyPicard/choose_your_own_adventure_js | /adventuregame.js | UTF-8 | 705 | 3.75 | 4 | [] | no_license | // alert("the game is starting");
//
// alert("This is a crime story about a man who went down the wrong road.");
let protagonist = prompt("His name was: _______ ", "Bob");
if (protagonist === "Bob"){
protagonist = prompt("Pick a different name, stop being lazy!");
}
else {
let goodOrBad = prompt("Are you good ... | true |
6b0bb7d31a6f8aaf3cc6961f3f6a53a39b44e9d7 | JavaScript | guzmonne/aos_node_2 | /tests/spec/specs.js | UTF-8 | 39,617 | 2.828125 | 3 | [
"MIT"
] | permissive | describe("App", function() {
describe("isObjectsArray", function(){
beforeEach(function(){
this.error1 = "test";
this.error2 = ["test", "test"];
this.error3 = [ {}, "test", "test" ];
this.success = [{}, {}, {}];
});
it("should return false if the value is not an object's array"... | true |
804c8e458c7029531aa3361bd611f117497165e0 | JavaScript | icanhaskick/voluntary.app | /source/library/node/nodes/BMTextNode.js | UTF-8 | 2,556 | 2.8125 | 3 | [
"MIT"
] | permissive | "use strict"
/*
BMTextNode
A node that contains Text, stores it's:
content, color, font, padding, margin
and has an inspector for these attributes
support for links?
*/
window.BMTextNode = class BMTextNode extends BMStorableNode {
initPrototype () {
this.protoA... | true |
103edc1fccc7074d3feb0125a98a5e447c73faa7 | JavaScript | ceccode/string-type-parser | /test/string-type-parser.js | UTF-8 | 4,392 | 3.25 | 3 | [
"MIT"
] | permissive | 'use strict';
const assert = require('chai').assert;
const stringParser = require('../lib/string-type-parser.js');
describe('can parse json object', () => {
it('should return an object', () => {
const obj = {
a: 'a',
b: 'b',
};
const result = stringParser.parse(obj);
assert.typeOf(re... | true |
f935ddb9028598a4a00b544cc4b81156794f0dec | JavaScript | MarcelaBarella/addressbook | /controllers/auth.js | UTF-8 | 1,397 | 2.546875 | 3 | [] | no_license | const jwtGenerator = require('../utils/jwtGenerator')
const { user } = require('../models')
const { encrypt, validatePassword } = require('../utils/password')
const User = {}
User.register = async (req, res, next) => {
const { email, password } = req.body
if (!email || !password) {
const error = new Error('Y... | true |
9ff9330de92815d6c1820205f72c69211330c2cd | JavaScript | nchen0/Redux-Friends2 | /friends/src/App.js | UTF-8 | 3,257 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import "./App.css";
import { connect } from "react-redux";
import { fetchFriends, addFriends, deleteFriend, changeName } from "./actions";
class App extends Component {
constructor() {
super();
this.state = {
name: "",
age: "",
email: "",
edit... | true |
7b46ccef1c91ce404d80a3ffaf49682a9924f199 | JavaScript | hichamw/sjefapp | /src/Home/Components/ItemQuickView.js | UTF-8 | 3,057 | 2.59375 | 3 | [] | no_license | import React, { Component } from "react";
import "./ItemQuickView.css";
import leftArrow from '../../img/icons/leftArrow.svg';
import rightArrow from '../../img/icons/rightArrow.svg';
import minus from '../../img/icons/minus.svg';
import plus from '../../img/icons/plus.svg';
import reservationButton from '../../img/ico... | true |
a908591477bfbcfec28a8be665bbaf66d2a61455 | JavaScript | issuemd/issue | /plugins/issue-plugin-github/commands/limit.js | UTF-8 | 1,277 | 2.59375 | 3 | [] | no_license | (function () {
'use strict';
var _ = require('underscore');
module.exports = function (helper, api) {
return limit;
function limit() {
var w = helper.chalk.white;
var g = helper.chalk.green;
return api.rateLimit().then(function (rateLimits) {
... | true |
1df3697b6104feb606bc79f9328400fb456bea06 | JavaScript | ronizshakya/React | /42. EcmaScript2020/index.js | UTF-8 | 3,134 | 3.609375 | 4 | [] | no_license | //optional chaining
plantFlowers?.()// undefined
//Nullish Coalescing
//The right-hand side value will only be assigned if the left-hand value is equal to null or undefined.
const delay = windowAnimDelay ?? 300; // delay is only set to 300 in case windowAnimDelay is null or undefined
const title = windowTitle ... | true |
5d337d7ae6f1b33eb85ea5e1e7563a876921b214 | JavaScript | pedrohenriquemop/QUIZ-CREATOR | /script.js | UTF-8 | 3,466 | 3.09375 | 3 | [] | no_license | let novoQuiz = document.querySelector('#novo-quiz')
let botaoAdd = document.querySelector('#botao-add')
let criarQuiz = document.querySelector('#criar-quiz')
let botaoFechar = document.querySelector('.botao-fechar')
let vetorQuizes = []
let listaQuizes = document.querySelector('#quizes ul')
let itensLista = document.qu... | true |
f8bda6c04201991a57bc536d029b6b023ee51fc4 | JavaScript | andyols/javascript-workbook | /06week/functionalJavascript/07basicRecursion.js | UTF-8 | 435 | 3.609375 | 4 | [] | no_license | // Basic: Recursion
function reduce(arr, fn, initial) {
// SOLUTION GOES HERE
let temp = [...arr]; // create copy of arr to avoid mutation of input
if (temp.length > 0) { // recursive step
initial = fn(initial, temp[0]); // currect value to work on
temp.shift(); // remove current item from temp (temp[0])
... | true |
4db001ab8c1324fa0e20dfdb8f0e639dc31cca04 | JavaScript | ahdinosaur/fancy-select | /test/integration.js | UTF-8 | 8,297 | 2.546875 | 3 | [] | no_license | var RCSS = require('rcss')
var mercury = require('mercury')
var raf = require('raf')
var test = require('tape')
var document = require('global/document')
var event = require('synthetic-dom-events')
var ENTER = 13
var BACKSPACE = 8
var UP = 38
var DOWN = 40
var FancySelect = require('../')
var comp, el, selected, inp... | true |
ed7238c8f7e8653aff6b2e54fe2b7418a76217b2 | JavaScript | FbW-E01/pb-operators-comparison-AlexandruPaiul | /start.js | UTF-8 | 1,942 | 4.65625 | 5 | [] | no_license | // These exercises are aimed at making you familiar with the comparison operators.
// **Print all your checks to the conso
// 0. Declare two variables "apples" and "oranges".
// Assign a value of 20 to apples. Assign a value of 30 to oranges.
const apples =20;
const oranges=30;
console.log(apples,oranges);
// 1. Ch... | true |
3138652b4c4f767927ddc5eaf475aa96ee0ad6b7 | JavaScript | pamelafox/translation-telephone | /src/static/js/script.js | UTF-8 | 3,175 | 2.578125 | 3 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | import { get, set } from "./user-store.js";
import { genRoundPath } from "./shared-logic.js";
import "./translations-ui-element.js";
import "./translations-footer-element.js";
import "./message-translation-element.js";
import "./round-summary-element.js";
let LS_ROUNDS = "rounds";
function loadRound(id) {
fetch(`/... | true |
95e9dd3050c0cfb94717ac10eca57480d8f50ff9 | JavaScript | s17084/tin_zaoczne_15c_s17084_react | /node_api_app/public/js/validationTournamentForm.js | UTF-8 | 2,564 | 3.265625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | const AVAILABLE_RANKS = { C: 100, "B+": 500, A: 1500 };
function validateForm() {
const tournamentNameInput = document.getElementById("name");
const tournamentDateInput = document.getElementById("date");
const prizePoolInput = document.getElementById("prizePool");
const rankInput = document.getElementById("ran... | true |
cb0cee23afd47f85052b5d57e5b03aad29a98e9f | JavaScript | xxxlrlovegd/biao-class | /practive/other-vueStudy/test2-Vuex/my-project/src/vuex/store.js | UTF-8 | 1,993 | 2.546875 | 3 | [] | no_license | import Vue from 'vue';
import Vuex from 'vuex';
import Zanwei from '../assets/logo.png'
Vue.use(Vuex)
export default new Vuex.Store({
state: {
//类似于data
//这里写入数据
goods: {
totalPrice: 0,
totalNum: 0,
goodsData: [{
id: '1',
title: '大芒果',
price: 8.00,
... | true |
b55a0fbc7eb9f7b9a5be7c4026a482a00876ff40 | JavaScript | raselratan/react-redux-list-handler | /src/components/books/book/Book.js | UTF-8 | 1,318 | 2.59375 | 3 | [] | no_license | import React,{Component} from 'react'
class Book extends Component{
state={
isEditable:false,
}
changeKeyHandler = (event) => {
if(event.key === 'Enter'){
this.setState({
isEditable:false
})
}
}
render(){
let output = this... | true |
8b5dfde3e397163cfcab542cb386d512e2479fa2 | JavaScript | ChrisJan00/TrapRunner | /gameloop.js | UTF-8 | 3,532 | 3.15625 | 3 | [] | no_license | // USAGE: you have to overload these interface functions. You will then get an object called gameControl. Just call
// gameControl.start() to start the game, gameControl.stop() to finish it (it will just stop working, no restarting possible)
// at any time you can change the fps through gameControl.fps and the time ... | true |
bfd47262be3bd2f3ba48c542f08a2c9cd5b140cc | JavaScript | pkin159/project | /stickanimate.js | UTF-8 | 1,170 | 2.71875 | 3 | [] | no_license | //////////class for Stick and StickAnimate
var Stick = function(){
this.bpm = 0;
this.intensity = .3;
this.thetaHit = -.2;
this.thetaMax = this.intensity;
this.thetaStandby = .1;
this.S = 0;
this.keyfames = [
{key: 0, value: thetaStandby},
{key: .3, value: thetaMax},
{key: .5, value: thetaHit},
{key: 1,... | true |
9c209d7e9422330dcc4e6aca85be5e232553608c | JavaScript | axeldelat/s2jqueryajax | /main.js | UTF-8 | 2,659 | 3.15625 | 3 | [] | no_license | const postCharacter = () => {
let name = $("#name").val()
let gender = $("#gender").val()
let country = $("#country").val()
let birth = $("#birth").val()
let review = $("#review").val()
let photo = $("#photo").val()
let character = { name, gender, country, birth, review, photo }
$.ajax... | true |
56a287474a9a5eb2805fbcfeaa91d5efcd61c573 | JavaScript | Michele-Prova99/js-simon | /js/script.js | UTF-8 | 1,537 | 3.703125 | 4 | [] | no_license | // Un alert espone 5 numeri casuali.
// Dopo la chiusura (manuale, cioè facendo click su ok) dell'alert, parte un timer di 30 secondi.
// Dopo i 30 secondi l'utente deve inserire un prompt alla volta i numeri che ha visto precedentemente.
// Dopo che sono stati inseriti i 5 numeri, il software dice quanti e
// quali de... | true |
6e7f67b1f2763a660fac267464fa05fd78b46692 | JavaScript | ppyaxin/leetcode | /jianzhioffer/jianzhi58-1.js | UTF-8 | 783 | 3.8125 | 4 | [] | no_license | /**
* @param {string} s
* @return {string}
*/
var reverseWords = function (s) {
let length = s.length
let result = ""
let tempIndex = s.length
for (let i = length - 1; i >= 0;) {
if (s[i] == ' ') {
//有空格
result = result + ' ' + s.slice(i + 1, tempIndex)
/... | true |
3dc6899eb69e5b6f7c5d6a8104bffcfc7effee0f | JavaScript | OrisakaToshihiko/photodiary | /assets/js/run.js | UTF-8 | 6,130 | 2.71875 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded', function () {
const gridElement = document.querySelector('.grid');
const sortField = document.querySelector('.grid-control-field.sort-field');
const filterField = document.querySelector('.grid-control-field.filter-field');
const authorField = document.queryS... | true |
34834a18ad0de2f1dec4b4f70155a566e896636a | JavaScript | Kimbangg/TIL | /Algorithm/BoostCamp/유형 분류/그리디/1541 잃어버린 괄호.js | UTF-8 | 466 | 3.46875 | 3 | [] | no_license | function solve() {
expression = expression.split("-");
for (let i = 0; i < expression.length; i++) {
if (expression[i].includes("+")) {
let tmpArr = expression[i].split("+").map((e) => +e);
expression[i] = tmpArr.reduce((acc, value) => acc + value);
}
}
let answer = Number(expression[0]);
... | true |
9387001b541023b7ed4c4fa80087caee1a620b0c | JavaScript | terryarbase/next-keystone | /utils/helper/index.js | UTF-8 | 8,338 | 2.53125 | 3 | [] | no_license | /*
* Utility included some helper static function
*/
const keystone = require('keystone');
const moment = require('moment');
const _forEach = require('lodash/forEach');
const _findIndex = require('lodash/findIndex');
const _filter = require('lodash/filter');
const _sortBy = require('lod... | true |
9e178fa90ed4da197c5329ad54030d3c247d779b | JavaScript | ft-interactive/uk-broadband-map | /config/sanitise.js | UTF-8 | 430 | 2.5625 | 3 | [] | no_license | import cheerio from 'cheerio';
export default async function sanitizeDoc(html) {
const $ = cheerio.load(html);
return $('body')
.children()
.map((idx, el) => $.html(el)) // N.b., this is Cheerio's bizarro jQuery-esque .map()
.toArray() // Now it's an actual Array-like.
.filter(e => e !== '<p></p>'... | true |
c0504a19d1d5e3a7f0253376f725b42881b4a256 | JavaScript | BlackthornYugen/rollercoaster-mayham | /server/Card.js | UTF-8 | 1,809 | 3.796875 | 4 | [
"MIT"
] | permissive | var util = require("util");
// Constructor
function Card(paths) {
this.paths = expandPath(paths || [5,4,7,6]); // All straight lines
}
Card.prototype.travelPath = function(entryPoint) {
for (var i = 0; i < this.paths.length; i++) {
if (this.paths[i] !== null) {
if (this.paths[i] === entryPoint) return i... | true |
3e0798811fe716716da0444f7828e7ee3cda2707 | JavaScript | xchen5/term2work14 | /script.js | UTF-8 | 1,085 | 3.0625 | 3 | [] | no_license | var revenue2008 = [911, 308, 68.1, 108, 1160];
var revenue2016 = [986, 262, 86.7, 195, 1460];
var chart = d3.select(".chart");
var chartDiv = document.getElementsByClassName("chart")[0];
var bar = chart.selectAll("div");
var toggle = 2016;
var year = document.getElementById("year");
var button = document.getElementById... | true |
09374d43a725581fc78bb9ed5e9af2f5260a5143 | JavaScript | denmoza/old-discord-bot | /modules/DeleteQueue.js | UTF-8 | 678 | 2.75 | 3 | [] | no_license | class DeleteQueue {
constructor() {
this.todelete = [];
this.start();
}
add(message, delay) {
this.todelete.push({ message: message, delay: new Date().valueOf() + delay });
}
tick(queue) {
for (var index in queue.todelete) {
if (queue.todel... | true |
7795e08e13bce5240af1a259e89fc8a1f1da3be4 | JavaScript | Mohammadxoja/helllo202020202 | /index.js | UTF-8 | 1,017 | 3.296875 | 3 | [] | no_license | const btn = document.getElementById('click');
const data = document.querySelector('ol');
btn.addEventListener('click', () => {
data.classList.toggle('hide');
})
const input = document.querySelector("#input").oninput = function() {
let val = this.value.trim();
let listItem = document.querySelectorAll('o... | true |
c5064f6cc7131169cbd22e31f9a6ba0c2f8bbd96 | JavaScript | sakivks/problem-s-solutions | /slayingNext.js | UTF-8 | 564 | 3.546875 | 4 | [] | no_license | var N = 100;
var a = Array.from(new Array(N), (val, index) => index + 1);
var lastManHit = true;
while (a.length > 1) {
slayer(a);
}
function slayer(a) {
i = 0;
if (!lastManHit) {
a.splice(0, 1);
}
var kill = false;
while (i < a.length) {
if (!kill) {
i++;
kill = true;
lastManHi... | true |
9e98b4de0d28b20564dadc42fecdc6943356a339 | JavaScript | KaleTEvans/reddit-stock-tracker | /utils/ticker-search.js | UTF-8 | 682 | 3.328125 | 3 | [] | no_license |
const findByTicker = (string, tickers) => {
// filter out symbols attached to string;
if (string.includes('$')) {
let newString = string.replace('$', '');
const altResult = tickers.filter(ticker => ticker.Symbol === newString.trim())[0];
return altResult;
}
if (string.includes(... | true |
986326ef6f08e4833ce2b49f0d2e6eae3e83f250 | JavaScript | StellaGreen/calc | /main.js | UTF-8 | 1,539 | 3.296875 | 3 | [] | no_license | /*
const op = require('./operation')
// const op = require('./operation.js') possible mais bug avec node
// on import le fichier operation pour calculer avec sur notre fichier différent
const { add } = require('./operation')
pour n'importer qu'un (ou des points) special (aux) du fichier operation
pratique dans le fi... | true |
c62c36f6f7171376b0cce1052fdfe414e010dac9 | JavaScript | lucadena/its_exam | /backend/libraries/queueManager/queues/queue.js | UTF-8 | 1,104 | 3.0625 | 3 | [] | no_license | /**
* This class simulate a sort of Interface of Queue classes.
* @author Luca De Nadai <denadai.luca99@gmail.com>
*/
class Queue {
/**
* Initialize the Queue Object.
* @param {Object} Instance of the Queue (SQS, Rabbit, ....).
* @constructor
*/
constructor(queue) {
this.queue = ... | true |
0a22001496c7d67b3a8c25f1359a260fa087c536 | JavaScript | Binary-objects/mean | /server.js | UTF-8 | 1,446 | 2.734375 | 3 | [] | no_license |
/* packages */
var express = require('express'); // import express module
var app = express(); //invoking express into a variable
var port = process.env.PORT || 8080; // use any port availabe or use 8080
var morgan = require('morgan'); // HTTP request logger middleware for node.js
var mongoose =... | true |
7134f70628c7d9a51131dfe018a29759e6c4627d | JavaScript | soniakaushal1990/basic_coding_concepts | /microsoft/question2.js | UTF-8 | 433 | 3.640625 | 4 | [] | no_license | function largestNum(integer){
let numString = integer.toString();
let largest = -Infinity;
for(let i = 0;i < numString;i++){
if(numString.charAt(i) == '5') {
let currLargest = parseInt(numString.slice(0,i)+numString.slice(i+1,numString.length));
if(currLargest > largest) ... | true |
9c38d13b3ccca48ce804b1ec624170395669eade | JavaScript | maheshgarkhwal/react-test | /src/Student.js | UTF-8 | 245 | 2.859375 | 3 | [] | no_license | //props with function
function Student(props) {
console.log(props.name);
return (
<div style={{ backgroundColor: "blue" }}>
<h1>hello {props.name}</h1>
<h1>email: {props.email}</h1>
</div>
);
}
export default Student;
| true |
0d5ea0f06326094e84e5e839eb40420029885fd3 | JavaScript | andreszohar/taller_evaluativo-_numero-_1 | /tercerProblema.js | UTF-8 | 720 | 3.78125 | 4 | [] | no_license | /*
3. PROBLEMA: La luna de Endor pierde temperatura día a día,
para ello hay que hacer un monitoreo constante, Cree una
función de flecha que permita calcular la temperatura media de
la luna a partir de la temperatura máxima y mínima de cada día
*/
let tempMaxDay1=40
let tempMaxDay2=34
let tempMaxDay3=38
let tempMinD... | true |
ab599964a41da3889fdae112f862f914c209ddcc | JavaScript | torivika/frontend-course-2019 | /homeworks/viktoriya.kharchenko_torivika/homework_markup_1/index.js | UTF-8 | 1,177 | 3.25 | 3 | [
"MIT"
] | permissive | const formEl = document.querySelector("[data-contact-form]");
function validateEmail(email) {
var re = /\S+@\S+\.\S+/;
return re.test(email);
}
function validateUserName(userName) {
var regName = /^[a-zA-Z]+ [a-zA-Z]+$/;
return regName.test(userName);
}
function validateRequired(fieldValue) {
return fieldV... | true |
42f09056396e38a06b61092201726d40b0b0fb8f | JavaScript | miguelitoelgrande/save-as-ebook | /web-extension/utils.js | UTF-8 | 9,210 | 2.515625 | 3 | [
"MIT"
] | permissive | function setIncludeStyle(includeStyle) {
chrome.runtime.sendMessage({
type: "set include style",
includeStyle: includeStyle
}, function(response) {
});
}
function getIncludeStyle(callback) {
chrome.runtime.sendMessage({
type: "get include style"
}, function(response) {
... | true |
f342492a8245f370f3f399b2f3da36e391e9742c | JavaScript | tanuj-pandey/Ecmascript6 | /6.modules/utils.js | UTF-8 | 416 | 3.375 | 3 | [] | no_license | /**Js Module pattern provides a way to wrap
* public, private methods and variables into a single entity.
* The functions or variables defined in a module are not visible outside
* unless we explicity export them
*/
export function add ( x, y ) {
return x + y;
}
export function subtract ( x, y ) {
return x... | true |
478784cd554445d9d6823cb8da52a7ea70aa4050 | JavaScript | BETH-A/coding-log | /src/Entries.js | UTF-8 | 18,623 | 2.796875 | 3 | [] | no_license | const Entries = [
{
title: 'Jan 1, 2021',
content: {
p1: 'To start the new year, I decided to try to log my coding activities for the year. Today, I worked on debugging an API Key issue I was having with the Translate component of my Widgets app. I could get the API to respond if I har... | true |
c7bb90f6632c7252e193d0a21efe8b529f275589 | JavaScript | vijay627/ttcs | /web/view/js/hoverpopup.js | UTF-8 | 5,170 | 2.515625 | 3 | [] | no_license | $(document).ready(function() {
$(function () {
$('.bubbleInfo').each(function () {
var distance = 10;
var time = 250;
var hideDelay = 0;
var hideDelayTimer = null;
var beingShown = false;
var shown = false;
var trigger =... | true |
6814213ded2f898071703d76913fb4d680405b44 | JavaScript | GPojoga/Sharing_Logistics_Simulation | /application/src/util/avg.js | UTF-8 | 123 | 2.65625 | 3 | [] | no_license | export default function avg(array){
return array.reduce((accumulator,current) => accumulator + current)/array.length;
} | true |
9573d241dd2bacad3ac69757c16e8eb930ac6d86 | JavaScript | jiup/wegasst | /src/popup/popup.js | UTF-8 | 2,610 | 2.828125 | 3 | [] | no_license | // function popup() {
// alert("This is the Link : ( " + document.URL + " )");
// }
function switchStatus() {
const data = localStorage.getItem('status');
if (data) {
if (data === 'off') {
const data0 = localStorage.getItem('uid');
if (data0 && 'user_exists') {
... | true |
56cd67f85399cf1d12a14548bc27483fb96d687b | JavaScript | morozserge1st/CRUD | /app.js | UTF-8 | 1,461 | 3.0625 | 3 | [] | no_license | // Const
const headers = [
'Id',
'Name',
'Email',
'Dob'
]
const styles = {
wrapper: {
display: 'flex',
justifyContent: 'center',
},
table: {
fontSize: '24px',
margin: '20px',
borderSpacing: '5px'
},
tr: {
textAlign: 'center',
},
th: {
fontWeight: 'bold',
background... | true |
4fbf54b4e0c3ee3915415319492153780ca738a7 | JavaScript | Siqister/BMAP-Viz | /carto/script/script.js | UTF-8 | 5,756 | 2.609375 | 3 | [] | no_license |
/*Start by setting up the canvas */
var margin = {t:0,r:200,b:0,l:200};
var width = $('.canvas').width() - margin.r - margin.l,
height = $('.canvas').height() - margin.t - margin.b;
var padding = 3;
var canvas = d3.select('.canvas')
.append('svg')
.attr('width',width+margin.r+margin.l)
.attr('height... | true |
3aae9a67d8f6a9975bc54aa0363970c8695ae903 | JavaScript | hectorcoronado/learnAngular | /spa/index.js | UTF-8 | 1,758 | 2.609375 | 3 | [] | no_license | // dependencies are added via the 2nd (array) argument to the angular.module method:
let app = angular.module('app', [ 'ngRoute' ])
// config is a method that takes a function that injects e.g. $routeProvider
app.config(function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: 'pages/main.html', //... | true |
f221eb9455feace2e1572a231c9b7cd6450d930e | JavaScript | karuneshapk/test-repo | /dependencies/apollo-library/src/components/Forms/CheckboxGroup.jsx | UTF-8 | 3,615 | 2.515625 | 3 | [] | no_license | import React, { Component, PropTypes } from 'react'
import ImmutablePropTypes from 'react-immutable-proptypes'
import { List } from 'immutable'
import ValidationMessage from 'apollo-library/components/Forms/ValidationMessage'
import Checkbox from 'apollo-library/components/Forms/Checkbox'
import { composeClassName } f... | true |
cc3a6c36aa12ad0671f37aafa7d0083489f90227 | JavaScript | ultraarc/My-notes | /coding-practice/Untitled-1.js | UTF-8 | 7,844 | 3.375 | 3 | [] | no_license | //605. Can Place Flowers
/**
* @param {number[]} flowerbed
* @param {number} n
* @return {boolean}
*/
var canPlaceFlowers = function(flowerbed, n) {
let count = 0;
let len = flowerbed.length;
for(let i=0; i<len; i++){
if(flowerbed[i]===0){
if((flowerbed[i-1]===0 || flowerbed[i-1]==... | true |
47da1d5a58c3916b9c6fc57adf55ae0c10ce3a00 | JavaScript | swpuhu/Js-Computer-Graphics | /rasterization/rasterization.js | UTF-8 | 4,790 | 2.9375 | 3 | [] | no_license | import { Vec2 } from '../util/Vec.js';
import { PrimitiveTriangle } from '../util/Triangle.js';
import { Input } from '../MVP/UICreator.js';
const width = 640;
const height = 360;
const canvas = document.createElement('canvas');
document.body.appendChild(canvas);
canvas.width = width;
canvas.height = height;
const ctx... | true |