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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a8497a060acef1ac9765a64e336bd466220397d5 | JavaScript | osu-cs290-sp19/weather-app | /src/UserInput/WeatherForm.js | UTF-8 | 2,732 | 3.171875 | 3 | [] | no_license | import React, { useState } from "react";
import '../App.css';
import "bootstrap/dist/css/bootstrap.min.css";
/*
This whole function is a react component named WeatherForm.
*/
function WeatherForm({ getRH }) {
const [dryBulb, setDry] = useState(""); //sets the initial state for dry bulb
const [wetBulb, setWet] ... | true |
ea0cb7bfbe809c1a10e50820a07c121620dac801 | JavaScript | cybbyc/cms_20161024 | /resources/home/js/lunbotu.js | UTF-8 | 2,806 | 3.15625 | 3 | [
"MIT"
] | permissive | //window.onload = function(){
var div = document.getElementById("tab");
var images = div.getElementsByTagName('img');
var p = div.getElementsByTagName("p");
var li = div.getElementsByTagName("li");
var bnt = div.getElementsByTagName("div");
var pos = 0; //用作下标
var len = images.length;
//图片描述数组
var ... | true |
8171bc709a2a5b3ae38a7d91a7a2a5a1e2568f00 | JavaScript | rodenmonte/diceroller | /src/App.js | UTF-8 | 2,076 | 2.859375 | 3 | [] | no_license | import React from 'react';
import './App.css';
import DiceRoll from './DiceRoll.js';
const defaultDieRollAttrs = [
{
closeable: false,
}
];
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
diceRollAttrs: defaultDieRollAttrs
}
}
closeDiceRollCompon... | true |
f84e49237292594a37bf3e5a2e665d345e0b6a5d | JavaScript | BrandonHarwood/BrandonHarwood.github.io | /js/app.js | UTF-8 | 1,605 | 2.625 | 3 | [] | no_license | $(document).ready(function () {
(function () {
var words = [
'pursuing a career in UX design & research',
'working at UNT ITSS',
'planning a hackathon',
'enjoying some coffee at West Oak',
'craving some tacos right about now'
],
i = 0;
setInt... | true |
04f8912e3ee53cf6fe6dd01fb0a506595f26ceb0 | JavaScript | pentheraphobia/pentheraphobia.github.io | /sideshooter.js | UTF-8 | 5,966 | 3.0625 | 3 | [] | no_license | var canvas = document.getElementById("theCanvas");
var ctx = canvas.getContext("2d");
document.getElementById("theCanvas").style.backgroundColor = '#000010'
var shipWidth = 25;
var shipHeight = 10;
var shipX = 30;
var shipY = (canvas.height-shipHeight)/2;
var shipSpeed = 0;
var shipAccel = 0.25;
var shipMaxSpeed = 3;
... | true |
efbb5fbe1252e3be72ded0c60c31554b606cfd57 | JavaScript | bepronetwork/b2c-layout | /src/lib/api/coinGecko.js | UTF-8 | 1,187 | 2.5625 | 3 | [] | no_license | import axios from "axios";
import { isEmpty, isUndefined, multiply } from "lodash";
import {
formatCurrency,
formatForCurrency,
} from "../../utils/numberFormatation";
const URL = "https://api.coingecko.com/api/v3";
async function getCoinConversion({ from = "", to = "", balance = 0 } = {}) {
try {
const { d... | true |
ff5675ea6e1a7a50fb74a1e2722a8d536bff311d | JavaScript | NoorAzar11/data-structures-and-algorithms-401 | /MergeSort/__test__/MergeSort.test.js | UTF-8 | 292 | 2.71875 | 3 | [] | no_license | 'use strict';
const sorted= require('../MergeSort');
describe('Testing Merge Sort', ()=>{
test('Testing merge Sorting', ()=> {
let arr = [8,4,23,42,16,15];
let outcome = [ 4, 8, 15, 16, 23, 42 ];
expect(sorted(arr)).toEqual(outcome);
});
});
| true |
4020a34e2dd4007d5b484fa7845c9262d9affff2 | JavaScript | M3nozzi/Focus | /src/components/Content/FormContents.js | UTF-8 | 4,057 | 2.625 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
class FormContents extends Component{
constructor(props){
super(props);
this.state = {
name:"",
icon:"",
}
this.handleFormSubmit = this.handleFormSubmit.bind(this);
... | true |
6ca467d2d5f193015d24d46cad0dee3f5dd6bbed | JavaScript | techuram/C10 | /sketch.js | UTF-8 | 529 | 3.015625 | 3 | [] | no_license |
function preload(){
sea_img = loadImage("sea.png");
ship_img = loadAnimation("ship-1.png", "ship-2.png", "ship-3.png", "ship-4.png");
}
function setup(){
createCanvas(400,400);
sea = createSprite(10, 150, 50, 200);
sea.addImage(sea_img);
sea.scale = 0.3;
sea.velocityX = -10
//sea.x = sea.width... | true |
6d4edebdc0e38065850d5727c44f5a4fac3845fd | JavaScript | luckymeday/itviec | /src/store/action/authAction.js | UTF-8 | 722 | 2.625 | 3 | [] | no_license | function login(user) {
return { type: "LOGIN", payload: user };
}
function loginFail(message) {
return { type: "LOGIN_FAIL", payload: message };
}
// function loginSuccess() {
// return { type: "LOGIN_SUCCESS", payload: null };
// }
function loginMiddleware(user) {
return (dispatch) => {
try {... | true |
904b9bc365182c0d806b3305dc4bf90869761f72 | JavaScript | KristaRutz/stereotype-me-by-name | /src/main.js | UTF-8 | 744 | 2.8125 | 3 | [] | no_license | import $ from 'jquery';
import 'bootstrap' ;
import 'bootstrap/dist/css/bootstrap.min.css' ;
import './styles.css' ;
import { StereotypeService } from './stereotype-service';
$(document).ready(function(){
$("#nameForm").submit(function(event) {
event.preventDefault();
let name = $("#name").val();
(asy... | true |
be518c1f70f71ba5afe0b8c37e03724c4b2f36a9 | JavaScript | ifell/FAR | /far/test/Entity.spec.js | UTF-8 | 1,390 | 2.6875 | 3 | [] | no_license | 'use strict';
var Entity = require('../src/Entities/Entity');
describe('Entities', function() {
it ('can not create an unknown entity', function(done) {
var unknown = function() { Entity.create('ThisTypeDoesNotExist', {}) };
expect(unknown).toThrowError('Unknown Entity');
done();
});
it ('can crea... | true |
cdecb71fae6a9b74763d396b63e13e5f10e49f52 | JavaScript | plm9606/programmers_hash_04 | /programmers/sort/k-number.js | UTF-8 | 823 | 3.984375 | 4 | [] | no_license | //k번째 수
function solution(array, commands) {
var answer = [];
commands.forEach(command => {
const i = command[0];
const j = command[1];
const k = command[2];
const newArr = array.slice(i - 1, j);
newArr.sort((a, b) => a - b);
answer.push(newArr[k - 1]);
});
return answer;
}
solution... | true |
ea2bd23e037080da7bd00375e4a70f8af108603f | JavaScript | Daniely2564/Design-Pattern | /0. From Tutorials/1. SOLID Design/00. Single Responsibility Principle/index.js | UTF-8 | 1,329 | 3.5 | 4 | [] | no_license | const fs = require("fs");
// A class should only have one primary responsibility
class Journal {
constructor() {
this.entries = {};
}
addEntry(text) {
let c = ++Journal.count;
let entry = `${c}: ${text}`;
this.entries[c] = entry;
return c;
}
removeEntry(index) {
delete this.entries[... | true |
c06f7e234681485da9d37be08b41553e2b77faa9 | JavaScript | Appanaktu/therappy-web | /Webapp/static/javascript/firebase.js | UTF-8 | 3,174 | 2.90625 | 3 | [] | no_license | // Initialize Cloud Firestore through Firebase
var config = {
"apiKey": "AIzaSyAUHFqNblYKWTCrje07bkdNeorlQ4IuNEs",
"appId": "1:728300584033:web:ed2bf8534da27bacc53e20",
"authDomain": "iamphysiotherappy-17757.firebaseapp.com",
"databaseURL": "https://iamphysiotherappy-17757.firebaseio.com",
"measurementId": "G... | true |
38d4166cd7910d2f1f18289dba4c86202bae8082 | JavaScript | randyjap/sentrycity | /app/javascript/packs/locales.js | UTF-8 | 390 | 2.59375 | 3 | [] | no_license | let setCookie = (cname, cvalue, exdays) => {
var d = new Date();
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
var expires = "expires="+ d.toUTCString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
window.custom.setLocales = (event, language) => {
event.preventDefault();
... | true |
e6407015a164f530e63b610ce8b808b719953503 | JavaScript | andrewhu0209/meta | /javascript/0329.longest-increasing-path-in-a-matrix.329.js | UTF-8 | 1,184 | 3.359375 | 3 | [
"MIT"
] | permissive | /**
* @param {number[][]} matrix
* @return {number}
*/
// 就是DFS
function dfs(x,y,matrix,counts){
if(counts[x][y] !== 0){
return counts[x][y];
}
let subCount = 0;
if(x>0 && matrix[x-1][y]<matrix[x][y]){
subCount = Math.max(subCount,dfs(x-1,y,matrix,counts));
}
if(y>0 && matrix[... | true |
2f7ec5d6253f79a0ab289054931f408198969794 | JavaScript | micxye/recursion-review | /src/stringifyJSON.js | UTF-8 | 1,334 | 4.25 | 4 | [] | no_license | // this is what you would do if you liked things to be easy:
// var stringifyJSON = JSON.stringify;
// but you don't so you're going to write it from scratch:
var stringifyJSON = function(obj) {
// your code goes here
var resultStr = '';
if (obj === undefined || typeof obj === 'function') {
return undefi... | true |
052b3d6293ff16797201f8d143c9a0f675a734db | JavaScript | ssharif10/Flashcard-Generator | /cloze-cards.js | UTF-8 | 1,018 | 3.359375 | 3 | [] | no_license | var inquirer = require ("inquirer");
var ClozeCard = require ("./Clozecard.js");
var ClozeCards = require ("./cloze.json");
var fs = require ("fs");
function createClozeCard() {
inquirer.prompt([
//full text
{
type: "input",
name: "text",
message: "Please type in your full text..."
}, {
//cloze deletion ... | true |
8c864672f5c9535cca538f2ec1c413223322e3a1 | JavaScript | AtaxyaNetwork/uptime-kuma | /extra/update-version.js | UTF-8 | 1,548 | 2.546875 | 3 | [
"MIT"
] | permissive | const pkg = require("../package.json");
const fs = require("fs");
const child_process = require("child_process");
const util = require("../src/util");
util.polyfill();
const oldVersion = pkg.version;
const newVersion = process.argv[2];
console.log("Old Version: " + oldVersion);
console.log("New Version: " + newVersi... | true |
976528eebb703535b616ce03bbac09b0a63af113 | JavaScript | RITAZARUBINA/Git | /JS/script.js | UTF-8 | 1,447 | 3.5625 | 4 | [] | no_license | function buttonClick(){
var x1 = parseInt(document.getElementById("x1").value);
var x2 = parseInt(document.getElementById("x2").value);
var resultDiv = document.getElementById('result');
if (Number.isNaN(x1) || Number.isNaN(x2) ){
alert('Wrong input');
return;
}
resultDiv.appen... | true |
c4eb6cbf1dfaca15196d5488bd7240bf51d767fe | JavaScript | smeshchankin/slicing-spacex | /js/data.js | UTF-8 | 1,912 | 2.625 | 3 | [] | no_license | (function() {
const data = {
'menu-1': ['Falcon 9', 'Falcon Heavy', 'Dragon', 'Updates'],
'menu-2': ['About', 'Gallery', 'Shop'],
'features': [
{ name: 'height', metric: '70 m', us: '229.6 ft' },
{ name: 'diameter', metric: '12.2 m', us: '39.9 ft' },
{ nam... | true |
8fc87327c11a8ec3f31523351720a5b5a77c0637 | JavaScript | rechenzentrum/screeps | /src/role.scavenger.js | UTF-8 | 1,858 | 2.625 | 3 | [] | no_license | module.exports = {
run: function(creep) {
var storage = creep.room.storage;
var droppedResources = creep.room.find(FIND_DROPPED_RESOURCES);
var droppedChemicals = creep.room.find(FIND_DROPPED_RESOURCES, {
filter: function(object) {
return object.reso... | true |
accefc0d4e631f0170e76183bc1debedced24822 | JavaScript | Senthilselva/java_practice | /BetterOO.js | UTF-8 | 272 | 3.515625 | 4 | [] | no_license |
var sq = new Square(3);
sq.side = 3;
var area = sq.area;
var sq2 = new Square(3);
sq2.side = 3;
console.log(sq2.area);
function Square(side){
console.log
this.side = side;
this.area = this.side * this.side;
}
| true |
063c6ee4d9ef00351acc0dcfdc13256a12d462c0 | JavaScript | awswer10/slubay | /Code/routes/ban.js | UTF-8 | 699 | 2.609375 | 3 | [] | no_license | // Ban user page
var users = require('../models/users');
var validator = require('validator');
module.exports = function(request,response) {
var banname = validator.escape(request.body.banname);
var username = validator.escape(request.body.username);
// Bans user and returns to user mana... | true |
1bd6ebbe265e7999124fa75e6a961ab24a0f59eb | JavaScript | adhiyatmarama/h8-p0-w4 | /exercise6.js | UTF-8 | 744 | 4.0625 | 4 | [] | no_license | function digitPerkalianMinimum(angka) {
var arr = []
// Mencari angka faktor dan dimasukin ke array yang isinya string dari faktor
for(var i=1; i<=angka; i++){
for(var j=i; j<=angka; j++){
if(i*j === angka){
arr.push(`${i}${j}`)
}
}
}
// Mencari digit terkecil
... | true |
7a5317553f259c239e745a747f2b69ebf9cd09b5 | JavaScript | daniel70/eyerisk | /risk/static/risk/js/selection.js | UTF-8 | 1,618 | 2.859375 | 3 | [] | no_license | // this file is no longer used
var SelectionBox = React.createClass({
loadSelectionsFromServer: function() {
$.ajax({
url: this.props.url,
dataType: 'json',
cache: false,
success: function(data) {
this.setState({data: data});
}.bin... | true |
c19d7db8220331a9c003a8bf6d59d822ff554c26 | JavaScript | Arno67000/ApiFilmsNeomanis | /models/movieModel.js | UTF-8 | 1,750 | 2.609375 | 3 | [] | no_license | const { doQuery, doQueryParams, doPostQuery } = require('../handlers/queryHandlers');
async function findAllMovies() {
let query = 'SELECT DISTINCT title, author FROM movies';
let data = await doQuery(query);
return data;
};
async function findTop100(year) {
if(year) {
let query = "SELECT year... | true |
790b64c2d9f074b239734293ba245c7dec4d2a7b | JavaScript | miragejs/miragejs | /lib/db-collection.js | UTF-8 | 10,876 | 3.375 | 3 | [
"MIT"
] | permissive | import isEqual from "lodash.isequal";
import map from "lodash.map";
function duplicate(data) {
if (Array.isArray(data)) {
return data.map(duplicate);
} else {
return Object.assign({}, data);
}
}
/**
Mirage's `Db` has many `DbCollections`, which are equivalent to tables from traditional databases. They... | true |
fcb31619e87293595bd924a1cf1b5bdaa4c1cb82 | JavaScript | Thi-tran/Find-Address-React-native | /App.js | UTF-8 | 2,191 | 2.53125 | 3 | [] | no_license | import React from 'react';
import { StyleSheet, Text, View, TextInput, Button, Alert, KeyboardAvoidingView } from 'react-native';
import {Location, Permissions, MapView} from 'expo';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
address: '',
... | true |
7a7fcef3bffd0ba4272f9e873dce443b98acdc11 | JavaScript | adamschuetze/GoogleCalendarToEvernote | /Code.gs | UTF-8 | 5,915 | 2.546875 | 3 | [] | no_license | /*
A Google Apps script to extract Google Calendar entry notes, and send them to Evernote. Install in your Google Drive,
with Create>More>Script.
You can change existing Google Calendar entry notes and the script will detect that, and send an updated entry to
Evernote, which you can Merge with existing entries.
... | true |
5d07e6be880ad01bed671472d8697edb36db461c | JavaScript | dev-z/airmon | /src/components/Flight.js | UTF-8 | 2,517 | 2.75 | 3 | [] | no_license | // Core imports
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
// Helper functions
/**
* Transforms date string from ISO_8601 to human friendly format.
* @param {String} dtStr The date string to be parsed.
* @returns {String}
*/
function parseTime(dtStr) {
return mome... | true |
c67dd80e256aa79d1f6d914bda2f41e47037c6a8 | JavaScript | arnaskro/advent-of-code | /2020/04/part2.js | UTF-8 | 1,295 | 2.734375 | 3 | [] | no_license | const input = require('./input.js').split('\n\n').map((passport) => {
const obj = {}
passport.replace(/\n/g, " ").split(" ").forEach((field) => {
const [key, value] = field.split(":")
obj[key] = value
})
return obj
})
const required = ["ecl", "pid", "eyr", "hcl", "byr", "iyr", "hgt"]
c... | true |
2406c1d3ca2a7b9a696c5e7cfc452ef9756da4bc | JavaScript | ag-77/shopify-theme | /dev/js/theme-template-password.js | UTF-8 | 458 | 2.578125 | 3 | [] | no_license | // Focus on password
function passwordForcus(){
window.setTimeout(function(){
if ( !$('#Login').hasClass('.no-js') ) {
$('#Password').focus();
}
},500);
}
// open login on click
$('a[href="#Login"]').on('click', function () {
$('#Login').toggleClass('no-js');
passwordForcus();
});
// Allow deep ... | true |
b61ad13a2463965e42492ea51f7e67c653710ef0 | JavaScript | Shymi7/PocketTarnow | /js/weatherFull.js | UTF-8 | 10,125 | 3.265625 | 3 | [] | no_license | let daneNow = 1;
function getWeather()
{
let weatherXhr = new XMLHttpRequest();
weatherXhr.open('POST','js/ajax/getWeather.php',true);
weatherXhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
weatherXhr.addEventListener('load',function(){
if(this.status ==... | true |
a7631c8108a7b083fb60b96480bd615e3de6db06 | JavaScript | agomezjuan/JS-Core | /JS Advanced/03 DOM Manipulations/5. Mouse Gradient/gradient.js | UTF-8 | 511 | 2.984375 | 3 | [
"MIT"
] | permissive | function attachGradientEvents() {
let gradient = document.getElementById('gradient-box');
gradient.addEventListener('mousemove', mouseInside);
gradient.addEventListener('mouseleave', mouseOutside);
function mouseInside(event) {
let result = Math.floor((event.offsetX / (event.target.clientWidth ... | true |
51efc8c404271df4159b48193ae1f9cf51155489 | JavaScript | LeoLoureiro-code/Weather-App | /index.js | UTF-8 | 1,427 | 3.578125 | 4 | [] | no_license | const apiKey = "681487c04faf808d7fd9446d204afde5";
document.getElementById("btn").addEventListener("click", getWeather);
function getWeather(){
const inputVal = document.getElementById("input").value;
const url = `https://api.openweathermap.org/data/2.5/weather?q=${inputVal}&appid=${apiKey}&units=metric`;
... | true |
ae7a7dfa7dcdaf36cae133492b88bd48357ffc82 | JavaScript | gMorning-Wp/ES6-Study | /Proxy/proxy-10-construct-02-this指向.js | UTF-8 | 408 | 3.640625 | 4 | [] | no_license | //construct 方法中的this指向的时handler,而不是实例对象
const P = function (){return {a:1}};
const handler ={
construct:function(P,args){
console.log(this === handler);
console.log(new P(...args));
console.log(...args);
return new P(...args);
}
}
let p = new Proxy(function () {}, handler);
new... | true |
417bbdcac1d38e29e7eb5ef95af9d13f8f0e9d6c | JavaScript | alexjking/advent-of-code | /src/2016/day_18/part_2.js | UTF-8 | 292 | 2.703125 | 3 | [] | no_license | 'use strict';
const Part1Solution = require('./part_1');
/**
* Part 1 solution is fast enough.
* Just change the input and defer to part 1.
* Currently runs at roughly 6 seconds.
*/
module.exports = (input) => {
input[1] = 400000;
return Part1Solution(input); // Part 2: 20002936
}
| true |
2c2c176c5cf03d10840a1952d9571a60583723aa | JavaScript | marcelovicentinicoelho/grasshopper | /modulo01/projeto03/aula02/exercicio09.js | UTF-8 | 214 | 2.59375 | 3 | [] | no_license | import { obj, string } from 'grasshopper.data';
for (let i = 0; i < string.length; i++) {
let letter = string[i];
obj[letter] = i;
}
for (let property in obj) {
console.log(property + ': ' + obj[property]);
} | true |
c8be8a0698bc908f447bbc6150c7f74f2c4d5585 | JavaScript | adammartona/My-Portfolio-Website-v0.1 | /js/main.js | UTF-8 | 4,470 | 2.609375 | 3 | [
"CC0-1.0"
] | permissive | $(window).load(function(){
$('#preloader').fadeOut('slow',function(){$(this).remove();});
});
/******************************************************************************************************************************
Learn More Page Scroll
************************************************************************... | true |
7bc1bf5ad76c3bd0c319e2841a56b252e732a787 | JavaScript | JsKingBoo/SableyeBot | /sableye.js | UTF-8 | 2,384 | 2.65625 | 3 | [
"MIT"
] | permissive | 'use strict';
//Dependencies
var Discord = require('discord.js');
var fs = require('fs');
//Files
var config = require("./config.json");
var CommandManager = require('./utils/CommandManager.js');
var Logger = require("./utils/Logger.js");
//Important objects
var bot = new Discord.Client();
//"Local" variables
var e... | true |
60f1e8f158e409f623cd34778f0b376a70095069 | JavaScript | nkoptsov/zfort-js-course | /15/09.rendering_optimization/app.js | UTF-8 | 516 | 2.84375 | 3 | [] | no_license | class App extends Component {
constructor() {
super();
this.state = {
message: 'Hello, world!'
}
}
render() {
return (
<div>
<h1>{this.state.message}</h1>
<ChildComponent
label={this.props.label}
onUpdate={(message) => this.setState({ message })} />... | true |
201a6114758c5418131907bd849e4ec4ffcdadbb | JavaScript | carogullon/Kinesiologia-y-fisiatria | /js/carrito.js | UTF-8 | 3,208 | 3.359375 | 3 | [] | no_license | window.onload = function () {
cargarProductos(productosKine);
}
function cargarProductos (productosKine) {
const productos = document.getElementById("contenedor-productos");
let html = '';
for (let i =0; i<productosKine.length;i++) {
html +=
`<div class="cada-producto">
<article ... | true |
01bbf1e0739a21fea032dc430d1a0c19e029096b | JavaScript | DTV96Calibre/breathing-circles | /sketch.js | UTF-8 | 803 | 3.171875 | 3 | [
"MIT"
] | permissive | var targetSizes = [50, 100, 150, 200, 250, 300]
var time = 0
var RATE_MULTIPLIER = 1/75
var TIME_OFFSET
function setup() {
// put setup code here
createCanvas(400, 400);
TIME_OFFSET = HALF_PI
}
function draw() {
// put drawing code here
scale = (sin(frameCount*RATE_MULTIPLIER - TIME_OFFSET)+1)/2;
backgrou... | true |
ceb713141b876f991f65558780ae583d9d48e114 | JavaScript | konfirm/node-iso15924 | /test/source/factory/Inds.js | UTF-8 | 2,165 | 2.890625 | 3 | [
"MIT"
] | permissive | /* global source, describe, it, each, expect */
const factory = source('main');
const ISO15924 = source('ValueObject/ISO15924');
describe('ISO 15924', () => {
describe('Inds - Indus (Harappan)', () => {
const inds = factory('Inds');
it('instances are singletons', (next) => {
const singleton = factory('Inds')... | true |
6047f9a47cfa03beccf1ce9ad16a692ab04e91ee | JavaScript | summerwang0915/gi | /gitak/samples/gi36/sample-addRemoveCDFRecords/js/logic.js | UTF-8 | 3,614 | 2.59375 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /**
* Defines package eg.addRemoveCDFRecords.
*/
jsx3.lang.Package.definePackage(
"eg.addRemoveCDF", // full package name
function(addRemoveCDF) { // argument in function is a short package, good to use in this file only.
/* Application Server object which is by default the projec... | true |
f28d8168e4127a97636a7f7238fc5807adf6ff6d | JavaScript | PFVNK/Code-Katas | /Lottery-machine.js | UTF-8 | 614 | 3.71875 | 4 | [] | no_license | //Lottery-machine https://www.codewars.com/kata/5832db03d5bafb7d96000107/train/javascript
//description: Your code inside lottery() must filter out all letters and return unique integers as a string
function lottery(str) {
if (/\d/.test(str)) {
let number = str.replace(/[^0-9]/g, '').toString().split('')
... | true |
81e462a091134fa67371e3d515981f5a5e3da19c | JavaScript | kaustav1810/JumboGPS | /asset-tracking-frontend/scripts/notifications.js | UTF-8 | 2,019 | 2.6875 | 3 | [] | no_license | const resourceUrl =
"https://jumbogps-main.anugrahsinghal.repl.co/api/assets/subscribe";
// const resourceUrl = "http://localhost:8080/api/assets/subscribe";
function getNotificationHeader(eventType) {
let header = "";
console.log(eventType);
if (eventType === "route-deviation") {
header = "Route Deviatio... | true |
8f699dbdbb151a9b42d064e4fb2202ef6d4de09b | JavaScript | IrenaKowalewska/english-for-kids | /src/js/renderStatistic.js | UTF-8 | 670 | 2.875 | 3 | [] | no_license | export const RenderStatistic = (array) => {
const table = document.createElement('table');
table.innerHTML += `
<tr>
<th>Word
<button class="btn-statistic sort-a-z">A-Z</button>
<button class="btn-statistic sort-z-a">Z-A</button>
</th>
<th>Translation</th>
... | true |
17eef3ea7c7f7ccbbec3bf1e424c34f4aa981637 | JavaScript | kohski/js_fundamental | /second/6_6_1_inline_style.js | UTF-8 | 447 | 3.28125 | 3 | [] | no_license | document.addEventListener('DOMContentLoaded',function(){
let elem = document.getElementById('elem');
elem.addEventListener('mouseover',function(){
// このthisはイベントの発生元のこと!
// JSでは-を扱えないので、background-color => backgroundColorにする!
this.style.backgroundColor="Yellow";
},false)
elem.addEventListener('mou... | true |
c8532e85bc88a9072785c2a4d4f3ce075d337f28 | JavaScript | gaiverrr/contact-list-app | /src/components/Contacts.js | UTF-8 | 2,050 | 2.53125 | 3 | [] | no_license | import React, {PureComponent} from 'react';
import Card from '../components/ContactCard';
import Grid from '@material-ui/core/es/Grid/Grid';
import Search from '../components/Search';
import CreateContact from '../components/CreateContact';
class Contacts extends PureComponent {
constructor(props) {
super(props... | true |
06115f460e237138802eed6546234d2dabb15515 | JavaScript | corientdev/Anguar-Text-Input-Date | /date_input.js | UTF-8 | 19,857 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | var demoApp = angular.module('App', []);
demoApp.controller('DateInputCtrl', function($scope) {
$scope.keypress;
$scope.keydown;
$scope.log;
$scope.date = "04/07/2016";
});
demoApp.directive('dateInput', ['cursor', function (cursor) {
return {
require: 'ngModel',
scope: {
modelFor... | true |
3edafc3e9c29d84c3d53b63c84e8ce898eef3a37 | JavaScript | Victory18/advanced-zeros | /src/index.js | UTF-8 | 584 | 3.046875 | 3 | [
"MIT"
] | permissive | module.exports = function getZerosCount(number, base) {
function callPrime(a, b) {
var result = 0;
while (a > 0) {
a = Math.floor(a / b);
result += a;
}
return result;
}
var primeNumbers = [];
for (var i = 2; i*i <= base; i++) {
if (base % i != 0) continue;
var p = 0;
... | true |
de8341023d5c921e364199af0501cdf6bdb48240 | JavaScript | d-belleza/employee-tracker | /index.js | UTF-8 | 9,471 | 3.21875 | 3 | [] | no_license | // require dependencies and modules
const inquirer = require('inquirer');
const logo = require('asciiart-logo');
const database = require('./db/database')
require('console.table');
// display title
console.log(
logo({name: "Employee Manager", font: "Slant"}).render());
promptUser();
function promptUser() {
i... | true |
8d2e43f467759c022ccdb702bf6e4aa26f0a6f85 | JavaScript | Ixilthrin/Elements2 | /apps/webgl/ImageUtil.js | UTF-8 | 2,462 | 3.046875 | 3 | [] | no_license | var ImageUtil = function(graphics, textUtil) {
let that = {
Graphics: graphics,
TextUtil: textUtil,
Backbuffer: null,
InitBackbuffer: function() {
if (that.Backbuffer == null) {
let backCanvas = document.createElement('canvas');
//alert("backCanv... | true |
4fcf110f635cad4f1125fe5200f8e8c5122b3cf0 | JavaScript | jhun0601/mecca | /src/components/form/PostForm.js | UTF-8 | 1,282 | 2.515625 | 3 | [] | no_license | import React from "react";
class PostForm extends React.Component {
constructor(props) {
super(props);
this.state = {
broadcastText: "",
error: "",
};
}
onChangeBroadcast = (e) => {
// e.preventDefault();
const broadcastText = e.target.value;
... | true |
2eac9759f8605f9e20720487c40145dd687d2d74 | JavaScript | gburghardt/module.demos | /js/app/task_module.js | UTF-8 | 1,787 | 2.75 | 3 | [] | no_license | var TaskModule = Module.extend({
prototype: {
actions: {
click: [
"remove",
"toggleSelection"
],
submit: [
"add"
]
},
callbacks: {
"afterAddTask": [
"onAfterAddTask"
],
"afterReady": [
"onReady"
],
"beforeAddTask": [
"onBeforeAddTask"
]
},
options: {
... | true |
bea17fa4731fd58c38146d7d01de42fa8fc1b9b9 | JavaScript | philrmass/style-explorer | /src/reducers/sources.js | UTF-8 | 618 | 2.53125 | 3 | [] | no_license | import { ADD_SOURCE, SET_SOURCE_COLORS } from '../constants/actionTypes';
export const defaultState = {};
function sources(state = defaultState, action) {
let source;
switch(action.type) {
case ADD_SOURCE:
return {
...state,
[action.url]: {
name: action.name,
url: act... | true |
b7c11b1604a84efc3d96611a38140c4638ce361b | JavaScript | weslleyg/ErrosNode | /callback.js | UTF-8 | 350 | 2.734375 | 3 | [] | no_license | function erroCallback(callback) {
setTimeout(() => {
callback(Error("Deu ruim!"));
},240);
};
setInterval( () => {
console.log("ping");
}
,1000);
setTimeout(() => {
erroCallback((err, test) => {
if (err) {
return console.error(Error('Error in erroAsync: ' + err.messag... | true |
ba81f96f031feab6576a1eedcae295fc5caf75a8 | JavaScript | sideral/react-node-test | /client/src/Products.js | UTF-8 | 1,359 | 2.6875 | 3 | [] | no_license | import React from 'react';
import Product from './Product';
class Products extends React.Component{
constructor(props){
super(props);
this.state = {
products: [],
hasError: false
};
}
componentDidMount() {
this.fetchProducts().then((products) => {
this.setState({
produc... | true |
8ec2b37545a18aad91ee4441803152ccfb7620c4 | JavaScript | namedai01/EasyAccomd_FrontEnd | /src/reducers/authReducer.js | UTF-8 | 1,075 | 2.59375 | 3 | [] | no_license | import {
REGISTER_SUCCESS,
REGISTER_FAIL,
LOGIN_SUCCESS,
LOGIN_FAIL,
LOGOUT,
} from "../constants/actionTypes.js";
// const user = localStorage.getItem("user");
const userState = { isLoggedIn: false, user: null };
export default (state = userState, action) => {
switch (action.type) {
... | true |
86106881b8ac621534e29a50d04739f0f3d96c40 | JavaScript | txiong000/Toua-s-backend-server-project | /route/notesEndpoint.js | UTF-8 | 1,798 | 2.734375 | 3 | [] | no_license | const express = require('express');
const db = require('../data/dbConfig');
const route = express.Router();
route.get('/', (req, res) => {
db('notes')
.then(note => {
console.log(note)
res.status(200).json(note)
})
.catch(err => {
res.status(401).json({message: 'Erro... | true |
12dcfe72db1e9205afe5b18122566a41afea5a1b | JavaScript | CorinaStoian/travel-weather | /src/Input.js | UTF-8 | 1,691 | 2.515625 | 3 | [] | no_license | import React from 'react';
import './Input.css'
//import * as Seq from './server.js'
export default class Input extends React.Component
{
state = {
text : "",
date : null
};
constructor(props)
{
super(props);
this.UpdateText = this.UpdateText.bind(this);
this.SubmitCity = this.Submi... | true |
6b38ed26b67f2936d943ac0a34ee783ed612cdae | JavaScript | danieldanielecki/ES6-Weather-App | /http.js | UTF-8 | 876 | 3.375 | 3 | [] | no_license | export class Http {
// "static" methods aren't called on instances of the class, instead they're called on the class itself. In essence, there's no instantiate of a class. Useful for utils.
static fetchData(url) {
return new Promise((resolve, reject) => {
const HTTP = new XMLHttpRequest();
HTTP.open... | true |
007ee4866c0314cabe0a45d2f79b5b9e085bafce | JavaScript | bdberm/surface-to-air | /lib/board.js | UTF-8 | 5,992 | 2.703125 | 3 | [] | no_license | import CrossHair from './crosshair';
import Cannon from './cannon';
import Laser from './laser';
import Bomb from './bomb';
import Explosion from './explosion';
import City from './city';
import {calcUnitVector, RandomStartPos, RandomEndPos} from './util';
import {checkBombLaserCollision, checkCityBombCollision} from '... | true |
10b54055efaea0beab2356757148d9521d7524a7 | JavaScript | sokudon/imas-event-timerEX-uri | /コード.gs | UTF-8 | 6,941 | 2.515625 | 3 | [] | no_license | /**
* Return a list of sheet names in the Spreadsheet with the given ID.
* @param {String} a Spreadsheet ID.
* @return {Array} A list of sheet names.
*/
var sid="1CpwNLrurUVVLX2dmMgZHU-uQC7WQfyfWqLlaiooRaN8";
var sname="EXたいま";
function doGet() {
var ss = SpreadsheetApp.openById(sid);
var sheets = ss.getShe... | true |
8cba8c20dd5a216994280c5ca5915f7decab2573 | JavaScript | pkallas/Reimplement-Lodash | /src/string/_capitalize.js | UTF-8 | 1,158 | 4.03125 | 4 | [
"MIT"
] | permissive | /*
Define a function to convert the first character to upper case and all other
characters to lower case in a specified string.
Preconditions:
0. There is exactly 1 argument.
1. The argument is a string.
Limitations: This function relies on ES6 to perform correct case conversion.
*/
var _capitalize = ... | true |
89473135c8146a280fb4c6a25b360490089b25c1 | JavaScript | jaideng1/a_star-pathfinding | /public/script.js | UTF-8 | 2,162 | 3.265625 | 3 | [] | no_license |
//3 = start
//2 = end
//1 = wall
//0 = nothing
var boardShape = [
[3, 0, 0, 0, 1, 0],
[0, 1, 1, 0, 0, 1],
[0, 0, 0, 0, 1, 0],
[0, 0, 1, 1, 0, 1],
[1, 0, 1, 0, 2, 1],
[0, 0, 0, 0, 0, 1]
];
var board = [];
var BOARD_LENGTH = boardShape.length;
var BOARD_WIDTH = boardShape[0].length;
function formalizeBoa... | true |
7c224d080bb232d80b067adf1d57832f46237c2a | JavaScript | centralMOcode/CAEBO-Angular | /controllers/users/deleteuser.js | UTF-8 | 802 | 2.640625 | 3 | [] | no_license | /*
deleteuser.js -> deleteuser.js delete a user from the database
for the unique person that decided they wanted to check the box and delete
their user account.
Kyle Graber, March 2020
*/
var express = require('express');
var router = express.Router();
router.delete('/', function(req, res) {
var connectDB = r... | true |
a560e7e2278de3dc139b5f0c749c67ac503b0f8b | JavaScript | bpcampeau/indie_rallye | /src/components/draw/index.js | UTF-8 | 621 | 2.875 | 3 | [] | no_license | import React, { Component } from 'react';
import axios from 'axios';
import './style.css';
const Draw = (props) => {
const pige = () => {
axios.get(props.route).then((value)=>{
let winner = value.data[Math.ceil(Math.random(value.length-1))];
document.getElementById('winnerName... | true |
1efc1704a94a64af7ecbe13eaa8be9ac37fb2153 | JavaScript | Chtanicala/Readme-Generator | /Generator.js | UTF-8 | 2,445 | 2.984375 | 3 | [
"MIT"
] | permissive | let inquirer = require('inquirer');
let fs = require('fs');
inquirer
.prompt([
{
type: "input",
message: "Enter a title for this project.",
name: "Project Title",
},
{
type: "input",
message: "Enter a brief description for this project.",
name: "Project De... | true |
589f059068c401671fe0d7c651f849f10838e3a6 | JavaScript | Tlwaller/web-week2-skillscheck | /javascript-1/practice.js | UTF-8 | 6,956 | 4.78125 | 5 | [] | no_license | //////////////////PROBLEM 1////////////////////
// Create a variable called 'myName' that's value is your name
// Code here
var myName = 'Trey';
//////////////////PROBLEM 2////////////////////
// Create a variable called 'faveNum' that's value is your favorite number
//Code here
var faveNum = 24;
////////////////... | true |
847597af2fb2e1fbba5af0351a2eb6aa0305cc48 | JavaScript | ritwik15416/LetsUpgrade-JavaScript | /Day-2/Q2.js | UTF-8 | 116 | 3.484375 | 3 | [] | no_license | // Input space
let minutes = 60;
// Main program
console.log('Seconds are: ',minutes*60); // 1 minute = 60 seconds
| true |
b5f1fe29fcc509df71cad41d079396b3dba173ea | JavaScript | ShawnWM/WebAPI_Final | /Server/app.js | UTF-8 | 959 | 2.796875 | 3 | [] | no_license | var io = require('socket.io')(process.envPort||3000);
var shortid = require('shortid');
console.log("Server Started");
//console.log(shortid.generate());
var players = [];
io.on('connection', function(socket){
var thisPlayerId = shortid.generate();
players.push(thisPlayerId);
console.log('client connected spa... | true |
7dd0a398e595f6dfaf0512cc4ee3313e04537951 | JavaScript | ritammarques/DAT_DesignArtAndTechnology | /siteDAT/sobre.js | UTF-8 | 797 | 3.265625 | 3 | [] | no_license | valores();
var alturalinha15= document.querySelector(".linha15").clientHeight;
var alturalinha16=document.querySelector(".linha16").clientHeight;
var value1= 150;
var value2= value1 + alturalinha15 + alturalinha16;
var value3= value1+ alturalinha15;
console.log(value1);
console.log(value3);
console.log(value2);... | true |
215402a4b65157937ca76e725ec3b9822fa8c12f | JavaScript | kuvsh1noffpavel/typical-arrays-problems | /src/index.js | UTF-8 | 818 | 3.40625 | 3 | [
"MIT"
] | permissive |
exports.min = function min (array) {
if (array == null || array.length == 0){
return 0;
}
let resultMin = 0;
for (let i = 0; i < array.length; i++){
if (resultMin > array[i]){
resultMin = array[i];
}
}
return resultMin;
}
exports.max = function max (array) ... | true |
b8145697f578d1309934a4b1b7ca641ace7010c8 | JavaScript | karlerus/karlerus.github.io | /source/gameOverState.js | UTF-8 | 992 | 2.875 | 3 | [] | no_license | var gameOverState = {}
gameOverState.preload = function() {
console.log("Pre-loading the GameOverScreen");
this.game.load.image("bg", "assets/images/bg.png");
this.game.load.image("dead", "assets/images/dead.png");
}
gameOverState.create = function() {
// add background
game.add.sprite(0,0, "bg");... | true |
59a8f776992e285d585f1f7f0b972f736f41252a | JavaScript | ssp013/MasterJavascript | /curso-javascript/hola-mundo/js/29-bom.js | UTF-8 | 740 | 3.015625 | 3 | [] | no_license | 'use strict'
/*BOM- Browser Object Model
- como puedo yo trabajar con los elementos que me da el navegador WEB.
ex: tamaño de la ventana del navegador, reedirigir de una URL a otra.
- diversos metodos para trabajar con el BOM.
*/
/* -Propiedades-
1. Windows.
*/
function getBom(){
console.log("Window Height: "+window.... | true |
693f59874a28fe36ba8bb68bffc0afb97db7efb4 | JavaScript | prabhjot3/burger-builder | /src/containers/BurgerBuilder/BurgerBuilder.js | UTF-8 | 1,305 | 2.515625 | 3 | [] | no_license | import React, {Component} from 'react';
import Aux from '../../hoc/Aux';
import Burger from '../../components/Burger/Burger';
import BuildControls from '../../components/Burger/BuildControls/BuildControls';
const INGREDIENT_PRICES = {
salad: 0.4,
meat: 1.3,
bacon: 0.8,
cheese: 0.5
}
class BurgerBuilder... | true |
a879866fb5bfb97040387b51617ea7b10028fe01 | JavaScript | TameraLaurinda/app_lista_de_tarefas | /App_ListadeTarefas - versão 1/script_pentende.js | UTF-8 | 5,463 | 2.890625 | 3 | [] | no_license | $(document).ready( () => {
$.ajax({
type: 'GET',
url: 'controller.php',
dataType: 'json',
data:'status=1',
success: dados => {
dados.forEach( function (tarefa) {
$('#tarefas_pendentes').append("<div class='row mb-3 d-flex align-items-center tarefa... | true |
0cf394b988a6ecb4f581655b538424ca40b9c0a6 | JavaScript | leordefreitas/JavaScriptBasics | /functions/somethingToKnow.js | UTF-8 | 624 | 4.53125 | 5 | [] | no_license | // function arguments follow the same rules as variables do for assignment by
// value vs. assignment by reference
/*
let x = 2;
let y = x;
x = 3;
console.log(x, y);
*/
/*
let name = 'mike';
function printSomething (thing) {
thing = 'skateboard';
console.log(thing);
}
printSomething(name);
console.log(name);
... | true |
9b038158483b7ab88e9c3b5df1b53391ccb906b1 | JavaScript | stevebraco/DragonSlayer_3wa | /js/dragon-slayer.js | UTF-8 | 11,949 | 3.484375 | 3 | [] | no_license | 'use strict'; // Mode strict du JavaScript
/*************************************************************************************************/
/* **************************************** DONNEES JEU **************************************** */
/*************************************************************************... | true |
b332e72dd64e52d1256bc3075b90caf00862ea33 | JavaScript | buendio/sorp | /src/blocks/block15/block15.js | UTF-8 | 686 | 2.546875 | 3 | [
"MIT"
] | permissive | let block15 = document.querySelectorAll('.block15');
if (block15.length) {
for (let index = 0; index < block15.length; index++) {
let block = block15[index];
let items = block15[index].querySelectorAll('.block15__item');
for (let i = 0; i < items.length; i++) {
let inner_style... | true |
5fc68d6ec8b0ffb2c677026c876d5faf0dde6213 | JavaScript | DKWProject2/Project2 | /js/script.js | UTF-8 | 519 | 3.0625 | 3 | [] | no_license | /* for side nav that pops out */
function openNav() {
document.getElementById("sidenav").style.width = "340px";
}
function closeNav() {
document.getElementById("sidenav").style.width = "0";
}
// Get the elements with class="column"
var elements = document.getElementsByClassName("column");
function validateForm(... | true |
2e490be21336339a9fa594c5f57e7c6dd6665470 | JavaScript | FacundoBettella/PI-Videogames | /api/src/controllers/index.js | UTF-8 | 1,039 | 2.609375 | 3 | [] | no_license | const { v4: uuidv4 } = require('uuid')
//CRUD From Database
class ModelCrud {
constructor(model) {
this.model = model;
};
getAll = (req, res, next) => {
return this.model.findAll()
.then(results => res.send(results))
.catch(err => next(err));
};
getById... | true |
b898e03eddafe52a1960be4ffe8ff7ef7ead0386 | JavaScript | ChristiancChavez/BodyHealthReact | /src/components/Carousel/Carousel.js | UTF-8 | 1,956 | 2.8125 | 3 | [] | no_license | import React, { Component } from 'react';
class Carousel extends Component {
constructor() {
super();
this.state = {
position: 0,
};
this.renderImage = this.renderImage.bind(this);
this.clickButtonLeft = this.clickButtonLeft.bind(this);
this.clickButt... | true |
a3055fa3f36ece2b2a3e088ba3931ddcb03b30f5 | JavaScript | dakirkwood/nilla-js | /src/modules/Linklist.js | UTF-8 | 1,982 | 3.046875 | 3 | [
"MIT"
] | permissive | /**
* Defines the Linklist object
*
* Output HTML
* <_tag class=" _type ">
* <Link />
* </_tag>
*
* @params
* _tag (string) ul or ol
* _class (string)
* _listItems (array) List of title text in same order as _urls.
* _urls (array) Comma separated list of URLs
* _targets (array) Comma separated lis... | true |
d9188b77795b76717c55da0f0a3ab84386e4c714 | JavaScript | ArthurSilvaN/Bot-Twitter | /bot.js | UTF-8 | 2,343 | 2.640625 | 3 | [] | no_license | let twit = require('twit');
let config = require('./config.js');
let randomItem = require('random-item');
let Twitter = new twit(config);
let nome = [
'Arthur',
'Nicolas',
'Caio',
'Elissandro',
'João',
'Jeziel',
'Samuel',
'Pedro',
'Sarah',
'Lizim',
'Thales',
'Charles',
... | true |
134248eb7c334a2b01ab660dc7fe7da69f049cdc | JavaScript | Tomfox91/SimSCD | /public/client/messages/events/pedestrian/busStop.js | UTF-8 | 675 | 2.71875 | 3 | [] | no_license | "use strict";
/**
* @brief Receives the message that a pedestrian is entering a bus stop;
* moves the pedestrian from the road to the bus stop and sets to update the client
* @param [in] msg thing entered structure message
* @param [in] pedId pedestrian's identifier
* @param [in] placeId place's identifier
... | true |
949b62961d51b983a9b33322779649f1031e0e05 | JavaScript | vcejaeli/n320summ2021 | /notes/classes-in-p5/app.js | UTF-8 | 756 | 3.734375 | 4 | [] | no_license |
class Circle {
constructor(cx, cy, radius, color) {
this.x = cx;
this.y = cy;
this.radius = radius;
this.color = color;
this.speed = 1 + Math.random() * 20; //or 2
}
update() {
this.y = this.y + this.speed;
//added acceleration
this.speed = t... | true |
ddb6b0bb4de37306ab38448311a7d0d47d34ef9b | JavaScript | gaelenb/webgaelen | /js/jquery.scripts.js | UTF-8 | 8,189 | 2.953125 | 3 | [] | no_license | (function($) {
var $event = $.event,
$special,
resizeTimeout;
$special = $event.special.debouncedresize = {
setup: function() {
$( this ).on( "resize", $special.handler );
},
teardown: function() {
$( this ).off( "resize", $special.handler );
},
handler: function( event, execAsap ) {
// Save the contex... | true |
9ac95bab9e82f93182111adffa6ba48f766f11f1 | JavaScript | kandksoftware/eval-app | /js/src/result-collector.js | UTF-8 | 608 | 2.953125 | 3 | [] | no_license | 'use strict'
class ResultManager extends Observer{
constructor(array = [],limit = ResultManager.STANDARD_LIMIT()){
super()
this._limit = limit
this._array = array
}
static STANDARD_LIMIT(){
return 5
}
add(o){
if(!this._array.includes(o)){
if(this._array.length <= this._limit){
... | true |
7d12cc13dfcfa6d3f650b584443094bb77b0e6a7 | JavaScript | JoshuaManto/Recipe-Generator | /main.js | UTF-8 | 7,672 | 3.234375 | 3 | [] | no_license | // console.log('connected')
// const frame = document.getElementById('forbidden-frame').contentWindow.document;
// frame.open();
// frame.write('lalalala');
console.log('clicked')
// const modalDiv = document.createElement("DIV");
// modalDiv.className = "modal";
// document.body.appendChild(modalDiv);
// const mo... | true |
ce306be9315089ca6f5d7dbaf1137d606b20a146 | JavaScript | burhan-arifm/ngabandung | /app/assets/javascripts/geolocation.js | UTF-8 | 1,005 | 3.15625 | 3 | [] | no_license | var x = document.getElementById("start");
function getLocation() {
if (navigator.geolocation) {
posisi = navigator.geolocation.getCurrentPosition(showPosition);
x.value = posisi;
} else {
alert("Peramban ini tidak mendukung fitur GeoLocation. Silakan masukan posisi asal anda secara manua... | true |
cf5165a766d3a59422b022c348e34337031015ac | JavaScript | TIY-CHS-LAST/express-demo | /public/main.js | UTF-8 | 804 | 2.9375 | 3 | [] | no_license | function deleteUser (personId) {
return fetch(`/people/${personId}`, { method: 'DELETE' }).then(function (
response
) {
return response.json()
})
}
const mainParent = document.querySelector('main')
mainParent.addEventListener('click', function (event) {
console.log(event.target)
if (event.target.getA... | true |
db082290a220f2f4cadd5449dfe4c0e787f29ab5 | JavaScript | icarodemorais/password-validator | /src/services/passwordService.js | UTF-8 | 1,140 | 3.171875 | 3 | [] | no_license | const passwordValidator = require('../util/passwordValidator');
const service = {};
// Definição do metodo do service responsável por receber a senha,
// instânciar o password validator passando todas as validações necesárias e retornar o resultado da validação
service.validatePasswordItiRequirements = (password) => ... | true |
1bd06eda378c755d57076aa404bac574a7761156 | JavaScript | jeroenpardon/sui | /assets/js/script.js | UTF-8 | 871 | 3.4375 | 3 | [
"Unlicense"
] | permissive | function date() {
let currentDate = new Date();
let dateOptions = {
weekday: "long",
year: "numeric",
month: "long",
day: "numeric"
};
let date = currentDate.toLocaleDateString("en-GB", dateOptions);
document.getElementById("header_date").innerHTML = date;
}
function greet() {
let currentTi... | true |
f2f91aeadc08f31e1c40fe88b919ffd1e0bab597 | JavaScript | Kelly-James/HTTP-Requests | /callbacks/print_reverse.js | UTF-8 | 286 | 2.59375 | 3 | [] | no_license | const getHTML = require('../http_functions').getHTML;
const requestOptions = {
host: 'sytantris.github.io',
path: '/http-examples/step6/uppercase.html'
};
function printInReverse(html) {
console.log(html.split('').reverse().join(''));
}
getHTML(requestOptions, printInReverse);
| true |
de2a24db3e500c8b4e207af1308840bd2103cb08 | JavaScript | knod/iconocode | /js2/mode-types.js | UTF-8 | 5,503 | 2.84375 | 3 | [] | no_license | /* mode-types.js
*
* Creates everything to do with the types mode?
*
* Affects:
* adder.modes.types - { tab: null, section: null, choices: {} }
* Makes use of:
* // Can't move on until a type is selected
* adder.typeSelected = false;
* adder.sections = { tabs: null, viewer: null, pickers: null };
*
* TODO:
* - Ad... | true |