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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
94e06209edb53bc8323a91ebfe5f1d7c162e48bf | JavaScript | StatuspageNZ/statuspage | /src/AlertFeed.js | UTF-8 | 5,655 | 2.828125 | 3 | [
"Beerware"
] | permissive | import React, { useState, useEffect, useRef } from "react";
function Sentiment({ sentiment }) {
const color = {
POSITIVE: "green",
NEGATIVE: "red",
NEUTRAL: "grey",
MIXED: "yellow",
};
return <span className={`sentiment sentiment--${color[sentiment]}`}></span>;
}
const AlertFeed = ({ category }) ... | true |
97e1dc6c5d65643db3a71d57a105846589597fd3 | JavaScript | LielZ/ChatApp | /public/client.js | UTF-8 | 24,302 | 2.609375 | 3 | [] | no_license | //gonna use date next
var date = new Date();
//setting var to check if the user already chosed name and color
var set = false;
//array of random names if user don't pick a name
var randomNames = ["ืืื ืงืืคืฆืื","ืคืจืขื","ืขืฅ ืื ืื ืืืืื","ืชืคืื ืืขืฆืื","ืื ืืืืืืก","ืืืคื","ืืฉื","ืฉืืฉืื","ืืืง","ืืจืืืื","ืชืคืื","ืืืก","ืื ื ื","ืืืืืก",... | true |
6261b515f444fb2a5ea7d3bf5a3434839e4f736f | JavaScript | IDrumsey/Lists-API-NodeJS | /Controllers/listController.js | UTF-8 | 10,017 | 2.796875 | 3 | [] | no_license | // Controller for list component
// Importing the model to define the operations on
let List = require('../Models/listModel');
let User = require('../Models/userModel');
// Operations
//create new list (POST: /api/lists)
exports.new = function (req, res) {
// create the list and set the data
... | true |
1a6ac265ce22b6ace777fb261456c70622f26bd9 | JavaScript | wangyl96/visualization | /visualization-web/src/utils/util.js | UTF-8 | 3,989 | 3.265625 | 3 | [
"MIT"
] | permissive | export function timeFix () {
const time = new Date()
const hour = time.getHours()
return hour < 9 ? 'ๆฉไธๅฅฝ' : hour <= 11 ? 'ไธๅๅฅฝ' : hour <= 13 ? 'ไธญๅๅฅฝ' : hour < 20 ? 'ไธๅๅฅฝ' : 'ๆไธๅฅฝ'
}
export function welcome () {
const arr = ['ไผๆฏไธไผๅฟๅง', 'ๅๅคๅไปไนๅข?', '่ฆไธ่ฆๆไธๆ DOTA', 'ๆ็ไฝ ๅฏ่ฝ็ดฏไบ']
const index = Math.floor(Math.random() * a... | true |
fe8ee2ad42e2d48c9cc4555b78577bf23759c461 | JavaScript | rajatkanthaliya12/Movie-App | /src/App.js | UTF-8 | 5,827 | 2.515625 | 3 | [] | no_license | import React, { Component } from "react";
import axios from "axios";
import "./App.css";
import Pagination from "./component/pagination";
import MovieListView from "./component/movieListView";
import MovieResultModal from "./component/movieResultModal";
import ReactAutocomplete from "react-autocomplete";
class App ext... | true |
cced36a5d1ad03737fb09a84c79075c47ed024d9 | JavaScript | nghiatv/nghiatv.github.io | /quizz/lib/FlipClock/src/flipclock/js/lang/vi-vn.js | UTF-8 | 641 | 2.609375 | 3 | [
"MIT"
] | permissive | /**
* Created by nghia on 3/19/16.
*/
(function ($) {
/**
* FlipClock Vietnamese Language Pack
*
* This class will used to translate tokens into the English language.
*
*/
FlipClock.Lang.English = {
'years': 'Nฤm',
'months': 'Thรกng',
'days': 'Ngร y',
... | true |
0608a705edf2e06e61a2d5017d0ba037e68cf395 | JavaScript | Kaemyong/individual_web_page | /javascript/osds.js | UTF-8 | 1,580 | 2.578125 | 3 | [] | no_license | const sectionleft = document.querySelector("#section_left");
const navleft = document.querySelector("#nav_left");
function getOSInfoStr() {
var strOS = '';
var ua = navigator.userAgent;
if(ua.indexOf("NT 6.0") != -1) strOs = "Windows Vista/Server 2008";
else if(ua.indexOf("NT 6.1") != -1) strO... | true |
4eb624683a437cc65cf8049392c17ce29ce2a1cd | JavaScript | yangsha/Leetcode | /backtracking/5-combine.js | UTF-8 | 963 | 3.46875 | 3 | [] | no_license | // Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.
// Example:
// Input: n = 4, k = 2
// Output:
// [
// [2,4],
// [3,4],
// [2,3],
// [1,2],
// [1,3],
// [1,4],
// ]
/**
* @param {number} n
* @param {number} k
* @r... | true |
591349311db9d6583383c32e8a061fac2d6365ee | JavaScript | dryven/cookie-byte | /resources/js/ie11-polyfills.js | UTF-8 | 1,934 | 3.234375 | 3 | [] | no_license | /**
* IE11-POLYFILLS.JS
*
* These JavaScript polyfills are only needed if you support IE11 or other
* mischievous browsers of that kind.
*/
/**
* Object.assign() polyfill for IE11
* @see <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign>
*/
if (typeof Object.assign... | true |
bc88ce0fd6014efef2babcc76482a9eb2db82cd5 | JavaScript | JesseETI/ETI-Designs-Website | /JS/scrolling.js | UTF-8 | 851 | 2.609375 | 3 | [] | no_license | $(document).ready(function() {
var slide1 = $(".main");
var slide2 = $(".services");
var slide3 = $(".about");
var slide4 = $(".portfolio");
var slide5 = $(".form");
slide1.addClass("latched"); //adds class to fix slide
slide2.css("margin-top", slide1.height() + "px"); //make top margin the height of slide 1
... | true |
e4b366818f811b9a90de7659fecf1dc411dea777 | JavaScript | joshua-the-great-won/react-salesforce | /src/Containers/MyBlog/PostForm.jsx | UTF-8 | 2,161 | 2.609375 | 3 | [] | no_license | import React, { useState, useEffect } from 'react';
import axios from 'axios';
import CircularProgress from '@material-ui/core/CircularProgress';
import { toast } from 'react-toastify';
import './style.css';
export default function PostForm(props) {
const [title, setTitle] = useState('');
const [text, setText] = ... | true |
e32b9271443d84f696910fe58f9cc96d049485ff | JavaScript | MohamedIbrahim13/paper-rock-react-game | /src/App.js | UTF-8 | 2,817 | 3.015625 | 3 | [] | no_license | import { useState, useReducer, useEffect } from "react"
import Header from "./components/Header"
import Footer from "./components/Footer"
const initialState = {
isLoading: false,
}
const choices = [
{ choice: "paper", className: "paper_hand" },
{ choice: "rock", className: "rock_hand" },
{ choice: "scissors", ... | true |
ee8ae34c2d42603637861fcd3ef64ed1a462344b | JavaScript | webtoast/imager | /src/app.js | UTF-8 | 918 | 2.546875 | 3 | [] | permissive | // Here is the starting point for your application code.
// All stuff below is just to show you how it works. You can delete all of it.
// Use new ES6 modules syntax for everything.
import os from 'os'; // native node.js module
import { remote } from 'electron'; // native electron module
import jetpack from 'fs-jetpac... | true |
3239b14c6a1935066a879fd4c55792cce40ee5e6 | JavaScript | cazmitia/acme_products_sales | /src/CreateProduct.js | UTF-8 | 2,192 | 2.515625 | 3 | [] | no_license | import React, { Component } from 'react'
import { FormGroup } from 'reactstrap'
import Axios from 'axios';
export default class CreateProduct extends Component {
constructor() {
super()
this.state = {
name: '',
price: '',
sale: 0,
stock: 'instock'
... | true |
96d27f18d15118410d591c46dd0d7b061ec79269 | JavaScript | Cecility/TimWatch | /public/js/editGame.js | UTF-8 | 2,359 | 2.859375 | 3 | [] | no_license | /*jslint devel: true*/
/*eslint-env browser*/
/*global firebase:true*/
/*eslint no-undef: "error"*/
/*eslint no-unused-vars: ["error", { "vars": "local", "args": "none" }]*/
var id;
var teamName;
/*
Updates the firebase database with the information about a game schedule
entry. Game schedule entry is identified by... | true |
2472ba962fd72f857ee522c9ce08ff8561a76cd1 | JavaScript | kazu0461/Portfolio | /script.js | UTF-8 | 1,156 | 2.65625 | 3 | [] | no_license | $(function() {
// Menu Toggle
$('#MenuButton').on('click', function () {
$(this).toggleClass('open');
$('#MenuList').slideToggle();
});
$('#MenuList a').on('click', function () {
if( window.innerWidth <= 768){
$('#MenuButton').removeClass('open');
$('#MenuList').slideToggle();
}
... | true |
522e48e3b7014033239916e45c43c84096b42bb6 | JavaScript | myku0814/crawlerForTemperature | /index.js | UTF-8 | 7,206 | 2.671875 | 3 | [] | no_license | /* import module*/
const request = require('request');
const cheerio = require('cheerio');
const urlencode = require('urlencode');
const ObjectsToCsv = require('objects-to-csv');
const fs = require('fs');
const readline = require('readline');
const rl = readline.createInterface({
input: process.stdin,
output: ... | true |
437bb6dfb42e4482e8c435a1c41b8cc3cb37962b | JavaScript | jmirmina/alexa-baby-rocker | /alexa-app.js | UTF-8 | 2,836 | 3.046875 | 3 | [
"MIT"
] | permissive | /**
* This is the main app code which takes requests from Alexa, checkes the state of each baby,
* determines whether to start/stop the motor, and generates the proper Alexa response.
**/
'use strict';
var _ = require('underscore'),
Rocker = require('./rocker').rocker,
alexa = require('alexa-app'),
app = new al... | true |
e4e5588b9a0142a8517e800a8540076859dfa50a | JavaScript | dbalkin77/Bamazon | /bamazonmanager.js | UTF-8 | 3,447 | 3.09375 | 3 | [] | no_license | const mysql = require('mysql');
const inquirer = require('inquirer');
const connection = mysql.createConnection({
host: 'localhost',
port: 3306,
user: 'root',
password: '',
database: 'bamazondb'
});
connection.connect(function(err){
if (err) throw err;
console.log(connection.threadId);
introduction... | true |
6004573ac5967b7ea830ccc2ccb1a7f64404e326 | JavaScript | sreevenkat/food_recommendation | /helper.js | UTF-8 | 1,178 | 2.734375 | 3 | [] | no_license | var bcrypt = require('bcryptjs');
var User = require('./models').User
var HotelUser = require('./models').HotelUser
var Hotel = require('./models').Hotel
function createUser(firstName, lastName, email, password){
var hashedPassword = bcrypt.hashSync(password, 8);
User.create({
firstName : firstNa... | true |
70bbb29ac28007e2758ff111926b26737fde9f10 | JavaScript | ve00ryca/test | /06_flex_gallery/javascript/gallery.js | UTF-8 | 1,177 | 3.4375 | 3 | [] | no_license |
// Adding white border and changing the color to black on mouseover
var innerDiv = document.getElementsByClassName("inner-div");
function mouseOver(d){
var i;
for(i=0; i<innerDiv.length; i++) {
if(innerDiv[i] == d){ //kogato v masiva e nameren konkretniq div this
innerDiv[i].style.borderColor = "white";
... | true |
9feeb42a50525f266c0ab8bbb5f7d885c3ca5cca | JavaScript | MuhabCodes/Flickr-Photos | /NewDocs/people/updateInfo.js | UTF-8 | 1,967 | 2.78125 | 3 | [] | no_license | /**
*
* @api {POST} /person/:userId/info updateInfo
* @apiDescription update Info for a given user
* @apiGroup person
* @apiVersion 0.1.0
*
*
* @apiParam (body) {String} city city of the user
* @apiParam (body) {String} homeTown homeTown of the user
* @apiParam (body) {String} occupation occupation of the... | true |
ff128b1e3ee7c4e24a5160714d0ae0d754bad4e0 | JavaScript | sanketitnal/DevsNest_FrontEnd | /p28_29/src/components/CityInput.jsx | UTF-8 | 977 | 2.734375 | 3 | [] | no_license | import React, { useEffect } from "react";
import { useDispatch } from "react-redux";
import { getAndUpdateWeather } from '../redux/actions';
export default function CityInput() {
const [city, setCity] = React.useState('');
const dispatch = useDispatch();
useEffect(() => dispatch(getAndUpdateWeather("Delh... | true |
35af1b09e7f5a8e45cdaea10866cf6718269a317 | JavaScript | ajfriedman19/cmsc-239-project-2 | /src/utils.js | UTF-8 | 6,091 | 2.8125 | 3 | [] | no_license | // you can put util functions here if you want
import {tTestTwoSample} from 'simple-statistics';
import {tscore, ttest} from 'jstat';
export function create_pairs(data) {
const rowObject = {};
console.log("testing")
data.forEach((curr, idxRow) => {
const keys = Object.keys(curr)
keys.forEach((currOut, idxOut) ... | true |
c27e22cfd2ea78da4bb3b50f41c9fc421661504d | JavaScript | elenastagg/kata-api | /src/controllers/booleans.js | UTF-8 | 809 | 3.203125 | 3 | [] | no_license | const booleans = require('../lib/booleans.js');
exports.negate = (req, res) => {
res.status(200).json({ result: booleans.negate(req.body.value) });
};
exports.truthiness = (req, res) => {
res.status(200).json({ result: booleans.truthiness(req.body.value) });
};
exports.isOdd = (req, res) => {
const a = parseIn... | true |
4a09500bea2a5ee61136e71f31322a76feb39580 | JavaScript | Sestri4kina/JS-practice-makes-perfect | /test/reduce-by-rules-test.js | UTF-8 | 500 | 2.671875 | 3 | [] | no_license | /**
* Created by Sestri4kina on 01.01.2017.
*/
var assert = require('assert');
var reduceByRules = require('../src/js/codewars-reduce-by-rules');
describe('reduceByRules', function(){
it('returns ', function(){
assert.equal(reduceByRules([2.0, 2.0, 2.0, 2.0, 2.0], [(a, b) => a + b, (a, b) => a - b, (a, b... | true |
d9daf654202a794b654c7336aa2fa5357c744a6b | JavaScript | chad-orwig/AoC | /2021/11/index.js | UTF-8 | 2,097 | 3.15625 | 3 | [] | no_license | import { input } from "./input.js";
const neighborRange = [-1, 0, 1]
const neighborOffsets = neighborRange.flatMap(rO =>
neighborRange.map(cO => [ rO, cO ]))
.filter(([rO, cO]) => rO !== 0 || cO !== 0);
function findNeighbors(row, col, numRows = 10, numCols = 10) {
return neighborOffsets
.map((... | true |
23f4259bf7b058c35792c41690df4cae617c9d75 | JavaScript | mariocsantos/curso-de-ferias-manha | /tipos/tipos.js | UTF-8 | 503 | 3.171875 | 3 | [] | no_license | var nome = 'SMN';
var isTrue = true;
var lista = ['a', 'b'];
var numero = 100;
numero = 'Silvio Santos';
function hello() {
console.log('Hello');
return;
}
hello();
var EstadoCivil;
(function (EstadoCivil) {
EstadoCivil[EstadoCivil["Solteiro"] = 0] = "Solteiro";
EstadoCivil[EstadoCivil["Casado"] = 1] = ... | true |
7a319d8909cd7594430cf437e5141a148d1565e0 | JavaScript | rnavarych/flights_allocation | /rubiq_frontend/src/components/allocationResults/index.js | UTF-8 | 1,069 | 2.625 | 3 | [] | no_license | import React from 'react';
import PropTypes from 'prop-types';
import './styles.scss';
const renderPassengers = (passenger) => (
<ul className='passengers' key={passenger.id}>
<li>id: {passenger.id}</li>
<li>origin: {passenger.origin}</li>
<li>destination: {passenger.dest... | true |
3dd8c51e4eed4e72e9e27eff1ee79846dc2bf9e4 | JavaScript | NickGatti/PHAR-Front-End | /src/redux/reducers.js | UTF-8 | 953 | 2.65625 | 3 | [] | no_license | import {
LOGIN_SUCCESSFUL,
LOGIN_FAILED,
FETCH_ADOPTIONS_SUCCESS,
FETCH_ADOPTIONS_FAILURE
} from './actions'
let initialState = {
user: {},
isLoggedIn: false,
error: null,
adoptions: []
}
export default (state = initialState, { type, payload }) => {
let newState
let newAdop... | true |
7c0aa9eced3d2be0de069f59141e8612d5486717 | JavaScript | ThamTran04/nodejs-restful-api | /search.js | UTF-8 | 959 | 3.578125 | 4 | [] | no_license | async function getJson1() {
const response = await fetch("http://localhost/nodejs-restful-api/test.php");
return await response.json();
}
//promise: https://openplanning.net/12395/javascript-fetch-api
function getJson2() {
return fetch("http://localhost/nodejs-restful-api/test.php")
.then((r) => r.json());
}... | true |
a954de9013e82436597f899498a4072e463d3ed1 | JavaScript | maheshsunny777/E-commerce-backend | /controllers/ordersController.js | UTF-8 | 1,382 | 2.59375 | 3 | [] | no_license | const OrderModel = require('../models/orders');
const CustomerModel = require('../models/customer');
//require persistance layer
const persistance = require('../persistance/order');
//get all orders
exports.getAllOrders= async (req,res)=>{
try{
let result = await persistance.getAllOrders(OrderModel);
res.status(20... | true |
8da1617d3dae0fe40a3effebb7fe2c9511c9862f | JavaScript | FelipeBeleno/WorkShopApp-FrontEnd | /src/redux/usuariosDuck.js | UTF-8 | 4,903 | 2.71875 | 3 | [] | no_license | import { rutasConToken } from "../helpers/rutas";
import Swal from 'sweetalert2'
//initial State
const initialState = {
data: false,
usuarios: []
}
//types
const types = {
obtenerUsuarios: '[Usuarios] obtener todos los usuarios',
eliminarUsuarios: '[Usuarios] Eliminar usuario',
crearUsuario: '[U... | true |
8368a0cea1001a27b83a406ab873deb8d1818ca4 | JavaScript | soluteli/npm-version-update | /command/pick-version.js | UTF-8 | 1,694 | 3.125 | 3 | [] | no_license | const inquirer = require("inquirer");
const semver = require("semver");
let v = "1.1.1";
const semverIncModes = [
"patch",
"minor",
"major",
"prepatch",
"preminor",
"premajor"
];
function getVersionChoices(version) {
return semverIncModes.map(item => {
let ret = semver.inc(version, item);
return ... | true |
647928a4b9daeed3ad0096564203bb85724c7b53 | JavaScript | uttamstha123/RiverRaftingAssignment | /script.js | UTF-8 | 1,789 | 2.921875 | 3 | [] | no_license | // Gallery Section
const selectImage = document.querySelectorAll(".next-preview img");
const previewImg = document.querySelector(".preview-area img");
selectImage.forEach((image) => {
let currentImage;
image.addEventListener("click", () => {
image.setAttribute("id", "selected");
currentImageSrc = ima... | true |
75cf73e7050f680bcfbf02a1fdacae4ba3ee317d | JavaScript | learn-co-students/dc-web-102819 | /33-Task-Lister-Review/src/index.js | UTF-8 | 2,501 | 3.703125 | 4 | [
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-public-domain"
] | permissive | // Similar to a Ruby binary file, in that it starts the execution stack.
document.addEventListener("DOMContentLoaded", () => {
addInputListener()
});
// Find the input field and add an event listener
function addInputListener() {
const taskForm = document.querySelector("#create-task-form")
taskForm.addEventList... | true |
cdb11dd7f49d5d93410733ca4da66b77e4e0402f | JavaScript | DaltonDayton/javascript | /colorchange/script.js | UTF-8 | 424 | 3.71875 | 4 | [] | no_license | // Uses a separate function if change needs to be used in multiple places
// var button = document.querySelector("button");
// function changeBG() {
// document.body.classList.toggle("bg-change");
// }
// button.addEventListener("click", changeBG);
// Single use event
var button = document.querySelector("button... | true |
86279318ffd20dfeeccf3cb1767ae3e9664044e9 | JavaScript | pabloppp/JSONML | /app.js | UTF-8 | 12,458 | 2.6875 | 3 | [] | no_license |
window.addEventListener("load", function(){
console.log("Hello!");
var container = document.getElementById("container")
var textarea = document.getElementById("json-textarea");
var lessTextarea = document.getElementById("less-textarea");
var title = document.getElementById("title");
var result = document.getEl... | true |
196f705afa3a52db6cf885bd5f11fa82e149b4e0 | JavaScript | abhishek-geek/FullStackOpen_2021 | /part7/bloglist-frontend/src/reducers/usersReducer.js | UTF-8 | 446 | 2.546875 | 3 | [] | no_license | import userServices from "../services/users";
const reducer = (state = [], action) => {
switch (action.type) {
case "SET_USERS": {
console.log(action.data);
return action.data;
}
default:
return state;
}
};
export const setUsers = () => {
return async (dispatch) => {
const dat... | true |
261398323a2ebacfc4905d692e69832140201274 | JavaScript | mbhartley/better-yeoman-test-setup | /app/scripts/main.js | UTF-8 | 748 | 2.75 | 3 | [] | no_license | function Collection (models) {
this.models = models || [];
this.find = function(students) {
var result;
if (typeof(id) != 'string') {
throw new Error("Sorry, this is not a string!");
};
if (this.models)_.contains(models) != true;
return (undefined);
};
this.add = function(addObject){
var student... | true |
0e1416ea2fc529f49b403158a51c9cec3a4ee2d8 | JavaScript | gajjuCoderBoi/capstone-project | /front-end/js/postfeed.js | UTF-8 | 1,873 | 3.3125 | 3 | [
"MIT"
] | permissive | const POSTS_PER_PAGE = 25;
// returns a div element of the post
function postSetUp(post){
const user = cookieParser(document.cookie).username;
let postDisplay = document.createElement('div');
let link = document.createElement('a');
const closeBtn = document.createElement("button");
closeBtn.className = "clos... | true |
122bc583dad43e957076f97a82daf06963758dc8 | JavaScript | BrandonCarlos/LayoutRiotGame | /assets/js/scripts.js | UTF-8 | 823 | 2.578125 | 3 | [] | no_license | let cards = document.querySelectorAll('.card');
let h1 = document.querySelector('.personagens h1');
let btnRedesSociais = document.querySelectorAll('.social');
btnRedesSociais.forEach(icone => {
icone.addEventListener('mouseover', function() {
icone.style.transform = 'scale(0.8)';
icone.style.transition = 't... | true |
fa7389bd290560a18c446a6ca3cd5dcd23359668 | JavaScript | rothberry/onlsengft040521-lessons | /phase-2-react/wk3/00-podact03/00-podAct03.js | UTF-8 | 913 | 2.984375 | 3 | [] | no_license | // ? Questions
/**
* What is the difference between Props and State?
*
* What are some React LifeCycle Methods?
*
* Where should fetches be called?
*
* What are some ways to handle form data?
*
* What's the difference between Presentational vs Container Components?
*
* How do we get access to React Rou... | true |
b2e28c672310976b5eb67f23ba6e2e18489c6454 | JavaScript | NouranFakhrEldeen/club-booking-system | /booking-front-end/src/helpers/url-query-maker.helper.js | UTF-8 | 276 | 2.703125 | 3 | [] | no_license | export const UrlQueryMaker = function (url, data) {
const ret = [];
for (let d in data)
ret.push(`${encodeURIComponent(d)}=${encodeURIComponent(data[d])}`);
if (!ret.length)
return url;
return `${url.includes('?') ? `${url}&` : `${url}?`}${ret.join('&')}`;
};
| true |
45cf76b112772e1e73e36ae5d63688e2e7e5da68 | JavaScript | Maurice333/personal-website | /src/components/IndividualProject.js | UTF-8 | 676 | 2.578125 | 3 | [] | no_license |
import React, {Component} from "react";
import {hot} from "react-hot-loader"
import "../css/main.css";
function listKeywords(array){
var str = array.slice(0,-1).join(", ")+', '+array.slice(-1);
return str
}
class IndividualProject extends Component{
render(){
var obj = this.props.obj
return(
... | true |
4cc449501af3f5d2cf27b9141a1b3097b6fb3e66 | JavaScript | nmiguelmoura/memo-game-api | /www/static/src/nmm/engine/AudioManager.js | UTF-8 | 2,220 | 2.796875 | 3 | [] | no_license | nmm.engine.AudioManager=(function(){
'use strict';
var self;
function AudioManager(audioSpriteData){
self=this;
// var to store background sound.
this._soundBg=null;
// var to store fx sound.
this._soundFX=null;
// store sound object.
this._sound=n... | true |
e9542f27a4bbf7fe143deca11042bf2636c543a0 | JavaScript | steinfletcher/lodash-mix | /test/compactObject.spec.js | UTF-8 | 1,267 | 2.515625 | 3 | [
"ISC"
] | permissive | var _ = require('../index.js'),
test = require('tape');
test('compactObject: should remove falsy properties (shallow)', function (t) {
t.plan(2);
var obj = {
a: null,
b: {
c: 9,
d: null
},
e: {
f: [null, undefined]
},
g: '... | true |
2efc8ca0dccc1b219daf29ba794fe2daacbff76a | JavaScript | 1uiscalderon/AirBnB_clone_v4 | /web_dynamic/static/scripts/2-hbnb.js | UTF-8 | 662 | 2.578125 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | $(document).ready(function () {
const dictResults = {};
$('div.amenities .popover INPUT').change(function () {
if ($(this).is(':checked')) {
dictResults[$(this).attr('data-name')] = $(this).attr('data-id');
} else if (!$(this).is(':checked')) {
delete dictResults[$(this).attr('data-name')];
... | true |
36b889b9cd9359b2033970e77e91dc9cc766a607 | JavaScript | robotomatic/smf | /backup/2016/01-jan/backup.2016.1.21-little_pink_dummys/js/engine/controller/menu_main.js | UTF-8 | 5,418 | 2.546875 | 3 | [] | no_license | function MenuMain(gamecontroller) {
this.gamecontroller = gamecontroller;
this.input = this.gamecontroller.input;
this.input.setMenu(this);
this.devtools = this.gamecontroller.devtools;
var settings = this.gamecontroller.gamesettings.getSettings(this.gamecontroller.currentview)
... | true |
fd0074dcfd2928348bfc4d070908dcb7b83aed4a | JavaScript | Aevmanya/Project-81 | /Project81.js | UTF-8 | 786 | 2.90625 | 3 | [] | no_license | canvas= document.getElementById("myCanvas");
ctx= canvas.getContext("2d");
ctx.beginPath()
ctx.strokeStyle= "black";
ctx.lineWidth= 3;
ctx.rect(150, 143, 430, 200);
ctx.stroke();
ctx.beginPath()
ctx.strokeStyle= "blue";
ctx.lineWidth= 3;
ctx.arc(250, 220, 40, 0, 2 * Math.PI);
ctx.stroke();
ctx.begin... | true |
ca33b82d34a08bbb5ff4703e97cc852c8b0d88e6 | JavaScript | Fabrice-Beya/collab | /server/controllers/auth.js | UTF-8 | 2,018 | 2.75 | 3 | [] | no_license | const db = require('../models'),
jwt = require('jsonwebtoken');
exports.register = async function(req, res, next){
try {
// create a new user from the request body
let user = await db.User.create(req.body);
// destructure user model for ease of use
let {id, username, ema... | true |
8bd50b7ecc8c5bc6b288250b860e66d0a3233867 | JavaScript | KonstantinKliukach/hj-29-homeworks | /dom-from-zero/store/js/dom.js | UTF-8 | 483 | 3.140625 | 3 | [] | no_license | 'use strict'
function createElement (node) {
const element = document.createElement(node.name)
if (node.props) {
Object.keys(node.props).forEach(key => {
element.setAttribute(key, node.props[key])
})
}
if (node.childs) {
node.childs.forEach((child) => {
console.log(child)
if (typeo... | true |
2c292d5d3b79c1f3bba18418dbbcea8f74259f33 | JavaScript | chisel/fluorite | /docs/src/assets/contents/utilities/comment-parser.js | UTF-8 | 1,625 | 2.765625 | 3 | [] | no_license | CommentParser = function() {
this._registry = {};
this.register = function(name, type, action) {
this._registry[name] = { type: type, action: action };
};
this.parse = function(container) {
if ( ! Node ) Node = {};
if ( ! Node.COMMENT_NODE ) Node.COMMENT_NODE = 8;
var selection = [];
... | true |
5e71c7bbd640c4890630d004e0e99da700ef21f2 | JavaScript | justdecodeme/css | /references/selectors/js/script.js | UTF-8 | 6,947 | 3.09375 | 3 | [] | no_license | const remote = require('electron').remote;
const {
ipcRenderer
} = require('electron')
console.log("Node Version: ", process.versions.node)
console.log("Chrome Version: ", process.versions.chrome)
console.log("Electron Version:", process.versions.electron)
var inner = '',
header = document.getElementById('hea... | true |
ce981005775f06b36cbee3d1b89a4c2c412c6b0d | JavaScript | bobmwangih/code-wars-challenges | /replaceLetters.js | UTF-8 | 483 | 3.421875 | 3 | [] | no_license | function pigIt(str) {
//Code here
let splitted = str.split(" ");
let result = [];
let reg=/[ !@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/
splitted.map(word => {
if (word.length >= 1 && !(reg.test(word))) {
letters = word.split("");
letters.push(letters.shift(), "ay");
result.push(letters.join("... | true |
b8fe9e06e16e2fba17f6c3f830867d33a016e8cc | JavaScript | andTheowind/toDo-Vue | /jsScripts.js | UTF-8 | 1,918 | 2.53125 | 3 | [] | no_license | let headerTheme = document.querySelector('.header');
let logo = document.querySelector('.logo');
let switchThemeBtn = document.querySelector('.slider');
let wrapper = document.querySelector('#wrapper');
let h1 = document.querySelector('h1');
let formInput = document.querySelector('.form > input');
let footer = do... | true |
e714a4c254cb746befef17a6acc036dee51803f7 | JavaScript | suhailaleryani/React-js-with-mobx-the-right-way | /src/Cars/services/CarsService.js | UTF-8 | 434 | 2.78125 | 3 | [] | no_license |
class CarsService {
api = "https://randomapi.com/api/umiqtf2n?key=FGW4-XWFD-W0M9-E01O&results=25"; // this can be changed , or put in .env file or attached to window object
payloadName = "results";
async getCars() {
return fetch(this.api)
.then((res) => {
return res.json();
})
.t... | true |
09439650fa54f3492bda55330de71d92968b18e2 | JavaScript | thundree/regexquest | /game/js/entities/puzzlegui.js | UTF-8 | 4,050 | 2.9375 | 3 | [
"MIT"
] | permissive | /**
* Dialog to show and handle the zombie puzzles.
*/
game.PuzzleGUI = Object.extend({
puzzleBoxElem: null,
puzzleBoxAnsweredElem: null,
patternElem: null,
modifiersElem: null,
resultElem: null,
playerEntity: null,
zombieEntity: null,
puzzle: null,
locked: false,
init: f... | true |
06aba6697dbd0b0d0aba7cd2935e261538c9f73d | JavaScript | Claudio-Lins/joanitafestacomarte | /components/Depoimentos/FileUpload.jsx | UTF-8 | 2,251 | 2.53125 | 3 | [] | no_license | import React from "react";
import axios from "axios";
const calculatePercetn = (value, total) => {
Math.round((value / total) * 100);
};
export default class FileUpload extends React.Component {
state = {
files: null,
percetn: 0,
loading: false,
submitted: false,
};
handleChange = (event) => ... | true |
82e4f87dc809fb66c54f7e2e76857832543ef474 | JavaScript | JuanManBo/EntregaPrueba | /alquilercams/src/components/ListadoItems.js | UTF-8 | 2,032 | 2.671875 | 3 | [] | no_license | import React from 'react';
const ListadoItems = ({item, items, setUpdateItem}) => {
const handleDelete = iditem => {
console.log(iditem);
const requestInit = {
method: 'DELETE',
}
fetch('http://localhost:4002/item/'+ iditem, requestInit)
.then(res =... | true |
d78c5a08d3040b782a634db26561e3a45157543b | JavaScript | Sidodus/phonetic_word_replicator | /app.js | UTF-8 | 44,493 | 2.5625 | 3 | [
"BSD-3-Clause"
] | permissive | let appUISelectors = function(){
const appSelectors = {
// Left Side
phoneticStandardsTitle: document.getElementById('phonetic-standards-title'),
// ipaBtn: document.getElementById('ipa-btn'),
// xSampaBtn: document.getElementById('x-sampa-btn'),
hintsBtn: document.getEle... | true |
c261a0fb080df287df0abac8addb5126d40a9186 | JavaScript | Eliabek07/calculadora-html | /js/script.js | UTF-8 | 857 | 3.90625 | 4 | [] | no_license | function calcular() {
var number1 = document.getElementById("number1").value
var number2 = document.getElementById("number2").value
alert(Number(number1) + Number(number2))
}
function Subtrair() {
var number1 = document.getElementById("number1").value
var number2 = document.getElementById("numb... | true |
42f1373f8c5653fe10c4b15bd856919fc434f5e6 | JavaScript | crossbario/crossbar-examples | /iotcookbook/device/edison/blinky/blinky.js | UTF-8 | 235 | 2.734375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | var mraa = require('mraa');
var led = new mraa.Gpio(13);
led.dir(mraa.DIR_OUT);
var led_state = true;
function toggle_led () {
led.write(led_state ? 1 : 0);
led_state = !led_state;
setTimeout(toggle_led, 200);
}
toggle_led();
| true |
459b704a36ad815a93d7904893d8ca899880c207 | JavaScript | Xekin97/leetcode-js-Roxz | /easy/204.count-primes/count-primes.js | UTF-8 | 476 | 3.453125 | 3 | [] | no_license | /*
* @lc app=leetcode id=204 lang=javascript
*
* [204] Count Primes
*/
/**
* @param {number} n
* @return {number}
*/
var countPrimes = function(n) {
// counting primes: sieve of eratosthenes
var count = 0;
var mark = new Array(n + 1).fill(false);
for(let i = 2; i < n; i++) {
if(!mark... | true |
45cdbbe30090ede9105f0826b6639849f8759b05 | JavaScript | Fatima-FlM/blog_dwwm | /view/js/createCommentsBlock.js | UTF-8 | 845 | 3.203125 | 3 | [] | no_license | Display.prototype.createCommentsBlock = function(comments) {
var commentsList = document.createElement("div");
for (let i = 0; i < comments.length; i++) {
var pseudoVisitor = document.createElement("h2");
var mailVisitor = document.createElement("h2");
var textNewComment = document.creat... | true |
5f578e3b1c5778dcc69bffe45b92e97ec78f68d3 | JavaScript | guidumasperes/Web-Development | /GardenShop/carts/template_cart_script.js | UTF-8 | 1,647 | 2.78125 | 3 | [] | no_license | function openProperPage(page) {
window.location.href = page;
}
//Function to make HTTP requests
function httpGetAsync(url, info, callback) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.onreadystatechange = function() {
if (xmlHttp.readyState == 4 && xmlHttp.status == 200)
callback(xmlHttp... | true |
1f9e0196ba69c6855e891bfda3a78302534b5280 | JavaScript | DominykasDriu/cars-filter | /controllers/controller.js | UTF-8 | 2,748 | 2.984375 | 3 | [] | no_license | // Import schema /w model
const Car = require('../modules/model.js')
// Add new car
addCar = async (req, res) => {
let newCar = new Car({
brand: req.body.brand,
model: req.body.model,
year: req.body.year,
rida: req.body.rida,
shift: req.body.shift
})
try {
let savedCar = await newCar.save(... | true |
53c4f0e0a3193fbdf9043a30609358b13912f109 | JavaScript | khamwas/unit-testing-mini | /functions.test.js | UTF-8 | 1,105 | 3.40625 | 3 | [
"ISC"
] | permissive | const functions = require('./functions');
test('returnTwo() should return 2', () => {
expect(functions.returnTwo()).toEqual(2);
});
test('expect greeting(James) to return hello, James and greeting(Jill) to return hello Jill', () => {
expect(functions.greeting('James')).toEqual('Hello, James.');
expect(functions.gr... | true |
591c8b4ee0a3215a9cd7ff4f010f66360ef1652e | JavaScript | brandon6475/react-afibclub-dynamic-frontend | /src/redux/reducers/doctor.js | UTF-8 | 527 | 2.65625 | 3 | [] | no_license | import {
GET_DOCTOR_LIST,
GET_DOCTOR_LIST_SUCCESS,
GET_DOCTOR_LIST_FAIL
} from '../type';
const INITIAL = {
doctors: [],
loading: false,
}
export default (state = INITIAL, action) => {
switch (action.type) {
case GET_DOCTOR_LIST: {
return {
...state,
loading: true
};
}
case GET_DOCTOR_LIST... | true |
03ba61914d62bce76ce006869d7e0912c7f13179 | JavaScript | alaperto/cmsTrackerMaps | /javascript/TimelinePlayer.js | UTF-8 | 2,386 | 2.953125 | 3 | [] | no_license | function play(context) {
var playbutton = $(context).find('#timelineControls').find('.playbutton');
playbutton.attr('isplaying', 'true');
playbutton.find("span").removeClass("glyphicon-play").addClass("glyphicon-pause");
var fps = $(context).find('#timelineControls').find('#fpssetting').val();
cons... | true |
2f9e2e9f9655d646df155e48dbf560ed421d8cd7 | JavaScript | borjajoana/2020-BSCS-JS-CRASH-COURSE-BORJA-JOANAROSE | /to list all the students inside an array.js | UTF-8 | 196 | 3.046875 | 3 | [] | no_license | let myArray = ['student 1', 'student 2', 'student 3', 'student 4', 'student 5', 'student 6', 'student 7', 'student 8', 'student 9', 'student 10'];
myArray.forEach(student => console.log(student)) | true |
9661809012ebedd4dea2ec293d94669c7171e6ca | JavaScript | iokky/WMM_v0.01 | /assets/scripts/index.js | UTF-8 | 765 | 2.515625 | 3 | [] | no_license | $('.toggle').click(function(e) {
e.preventDefault();
var $this = $(this);
if ($this.next().hasClass('show')) {
$this.next().removeClass('show');
$this.next().slideUp(350);
} else {
$this.parent().parent().find('li .inner').removeClass('show');
$this.parent().parent().fi... | true |
fc886a5c909a5a9d16f68e2d5a4d29daab720b56 | JavaScript | listenzcc/HTML_project_ht | /script.js | UTF-8 | 1,624 | 2.546875 | 3 | [] | no_license | //iframe่ช้ๅบ้ซๅบฆ็ๅฝๆฐ
var oTime = null;
function resize()
{
reset();
//if (oTime)
//{
// clearTimeout(oTime);
//}
//oTime = setTimeout(reset, 20);
}
//iframe่ช้ๅบ้ซๅบฆ็ๅฝๆฐ
function reset()
{
console.log('resetting');
var frames = document.getElementsByName("iframe");
for(var j=0;j<frames.length;j+... | true |
14706f6788aa6867bbb6cb0a4b24c656d0a3bc32 | JavaScript | Padonrapan/jQuery | /jQuery_1.10.1/12/demo.js | UTF-8 | 975 | 2.75 | 3 | [] | no_license |
$(function(){
//ๅฎฝๅบฆ่ฎพ็ฝฎ
//alert($('div').css('width'));//500px;
//alert($('div').width());//500;
//alert(typeof($('div').css('width')));//string;
//alert(typeof($('div').width()));//number
//$('div').width(600);
//$('div').width('600px');
//$('div').width('600pt');
/*
$('div').width(func... | true |
f2a0ead8a8e1f455d11876538888eff60d38e7bb | JavaScript | quant-shiva/DSA_practice | /LinkedList/SinglyLinkedList.js | UTF-8 | 574 | 3.484375 | 3 | [] | no_license | class LinkedListNode{
constructor(data,next=null){
this.data = data;
this.next = next;
}
}
class LinkedList{
constructor(){
this.head = null;
}
Insert(data){
if(this.head===null){
this.head = new LinkedListNode(data);
}
else{
let curr = new LinkedListNode(data);
curr.next = this.head;
thi... | true |
34e1297517464b0e801153c9820bc2bb3d183a9b | JavaScript | yangyaochang/practicing-leetcode | /339 Nested List Weight Sum.js | UTF-8 | 604 | 3.90625 | 4 | [] | no_license | /*
ๅฆๆ array ๆฌ่บซๆฒๆ nested๏ผ้ฃ้บผ for loop ๅท่กๅฎไธๆๅ call ไธไธๅ recursion ๆไปฅไธ็จ้กๅค่จญ base case
*/
var depthSum = function(nestedList) {
let sum = 0
const decompose = (arr, weight) => {
for (let i = 0; i < arr.length; i++) {
if (typeof arr[i] === 'number') {
sum += arr[i] * weight
... | true |
16ce4a35946b6a7de3a9ec9b2d21363c440978e0 | JavaScript | atreyi2411/newton-cradle | /sketch.js | UTF-8 | 1,309 | 2.75 | 3 | [] | no_license |
const Engine = Matter.Engine;
const World = Matter.World;
const Bodies = Matter.Bodies;
const Body = Matter.Body;
const Constraint = Matter.Constraint;
var engine, world;
var pendulumRoof;
//function preload()
//{
//}
function setup() {
createCanvas(1100, 600);
engine = Engine.create();
world = engine.world;
... | true |
2769ff7539ed77c71d6f6e2704ac0ada1b1f3f61 | JavaScript | pravz71/js-concepts | /async-example/async-parallel.js | UTF-8 | 1,446 | 3.65625 | 4 | [] | no_license | const async = require('async');
const arrayStack = [];
const functionFirst = (callback) => {
// Do Some Actions
callback(undefined, "First Function Result");
};
const functionSecond = (callback) => {
// Do Some Actions
// callback({err: "some error occured again"}, undefined);
// return;
callback(undefined, "Se... | true |
1c487088e55901810a373b5d44fe442fde5c5ef3 | JavaScript | ngoctham251099/NewsPage | /controllers/categories-controller.js | UTF-8 | 3,194 | 2.921875 | 3 | [] | no_license | const Categories = require('../data/models/Categories');
const News = require('../data/models/News')
//show list categories
module.exports.showsCategories = (req, res, next) => {
Categories.find()
.then(categories => {
res.send({categories: categories});
})
.catch(err => console.log(err))
}
//... | true |
93b3a71a741bbcecfcc77f7e9af95abc9502e9c3 | JavaScript | david-mcgrath/advent-of-code-2020 | /25/p1.js | UTF-8 | 659 | 3.015625 | 3 | [] | no_license | (function () {
var card_public_key = 11239946;
var door_public_key = 10464955;
var subject = 7;
// card_public_key = 5764801;
// door_public_key = 17807724;
// subject = 7; // Expected result: 14897079
function step(n, subject) {
return (n * subject) % 20201227;
}
function crack(num, sub... | true |
75db3c4a3007bb80a54df3cef9d2145cd1541d74 | JavaScript | vy-github/E_Shopping_with_backend | /src/context/ItemState.js | UTF-8 | 4,025 | 2.671875 | 3 | [] | no_license | import { useState } from "react";
import ItemContext from "./ItemContext";
import { useHistory } from "react-router-dom";
import React from "react";
const ItemState = (props) => {
const host = "http://localhost:5000";
const [items, setItems] = useState([]);
const [cartItems, setCartItems] = useState([]);
co... | true |
e1a10d03f026a0e59bcd20fc58a3f75955a61770 | JavaScript | Quoteme/webglcs | /js/Backup/main-bu.js | UTF-8 | 2,771 | 2.546875 | 3 | [] | no_license | loadLevel("levels/level1.txt", 0);
var keyboard = new THREEx.KeyboardState();
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth/window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.s... | true |
d085764d3c662de5af65f6ddf31676a9a46c611e | JavaScript | Renalton/back-integral-variaveis | /classe-05/hipotenusa.js | UTF-8 | 235 | 3.34375 | 3 | [] | no_license | //Calcule a distรขncia entre dois pontos
// Programaรงรฃo do Zero Cubos Academy e Ifood
let distancia = 0, x1 = 1, x2 = 1, y1 = 1, y2 = 4;
distancia = Math.sqrt(Math.pow((x2-x1), 2) + Math.pow((y2 - y1), 2));
console.log(distancia);
| true |
508e8f9444c43cd76f88f215ac66dc7e0a316684 | JavaScript | creaticjs/Luis-Enrique-Sanjuan-Melo | /Ej API google/googleMaps.js | UTF-8 | 6,518 | 2.65625 | 3 | [] | no_license |
/* GEOCODER
function geocode(platform) {
var geocoder = platform.getGeocodingService(),
geocodingParameters = {
searchText: '200 S Mathilda Sunnyvale CA',
jsonattributes : 1
};
geocoder.geocode(
geocodingParameters,
si,
no
);
function si(result) {
var locations = result.r... | true |
8054dafdd1cf8be479e5cab43559b87035f73ef6 | JavaScript | Blakeehhler/Albuy-Marketplace | /public/js/sell.js | UTF-8 | 1,767 | 3.015625 | 3 | [] | no_license | $(document).ready(() => {
// This file just does a GET request to figure out which user is logged in
// and updates the HTML on the page
$("#searchBtn").on("click", function(event) {
event.preventDefault();
const albumInfo = document.querySelector("#album-container");
albumInfo.style... | true |
ffd3dfaf320aeb3c51c5178ffdb1dac613d002b5 | JavaScript | Yue-design/data-structure-and-alogorithms | /DynamicProgramming/318_MaximumProductofWordLengths.js | UTF-8 | 1,877 | 4.3125 | 4 | [] | no_license | /*
318 Maximum Product of Word Lengths
Given a string array words, find the maximum value of length(word[i]) * length(word[j])
where the two words do not share common letters.
If no such two word exist, return 0.
Assuming:
Each word will comtain lower case letters.
* @param {string[]} wods
* @return {number}
Time... | true |
d1333165119a842c27f14049cd42af6e66871a54 | JavaScript | bachtsui/express_setup_drills | /node_project/index.js | UTF-8 | 762 | 2.734375 | 3 | [] | no_license | var express = require('express');
var app = express();
var fastFood = [
{name: "McDonalds"},
{name: "Taco Bell"},
{name: "Panda Express"},
];
var bartStations = [
{name: "Market"},
{name: "Powell"},
{name: "Montgomery"},
{name: "Daly City"},
{name: "Millbrae"}
];
app.use(express.static('publi... | true |
b3d57cf6b6b5067818bb700400c64dd5f7ff653b | JavaScript | wagasky/my-places | /src/components/Form.js | UTF-8 | 2,122 | 3.015625 | 3 | [] | no_license | import React, { Component } from 'react';
class Form extends Component {
constructor(props) {
super(props)
this.state = {
lat: '',
lng: '',
enabled: true
}
}
submitForm(e, data) {
e.preventDefault();
this.props.postLocation(data)
this.props.fetchAllLocations()
}
se... | true |
4bbed1d61c0460207f6b098f70b1fe488c71b5af | JavaScript | ValentinGratz/Exercice_Pierre_Giraud | /boucle while/cours1.js | UTF-8 | 852 | 4.09375 | 4 | [] | no_license | // on initialise uyne variable let x
let x = 0, a = 0;
let y = 10, b= 10;
//Tant que ...
while(x < 10){
//...execute ce code
document.getElementById('p1').innerHTML +=
'x stocke la valeur ' + x + ' lors du passage nยฐ'
+(x + 1) + ' dans la boucle <br>';
x++;
}
//Faire ... tant que
d... | true |
24fa8fb871ff20d069de3303e9453fdc1807b5f2 | JavaScript | afnikitina/literary-mutilator | /public_html/scripts/literary-mutilator.js | UTF-8 | 1,023 | 3 | 3 | [
"Apache-2.0"
] | permissive | // change font color of all three paragraphs
function changeToRed() {
paragraphs = document.querySelectorAll("p");
paragraphs.forEach(el => el.style.color = "#C70039");
}
function changeToBlue() {
paragraphs = document.querySelectorAll("p");
paragraphs.forEach(el => el.style.color = "#231798");
}
function changeT... | true |
ad2db831944ecedd90e968004cd1a715a06dfb3d | JavaScript | cs2b01/code-on-demand-macarenaoyague | /web/templates/chat.js | UTF-8 | 4,623 | 2.5625 | 3 | [] | no_license | var currentUserId = 0;
function whoami(){
$.ajax({
url:'/current',
type:'GET',
contentType: 'application/json',
dataType:'json',
success: function(response){
//alert(JSON.stringify(response));
var name = response['name']... | true |
f4605b7e4af66e70654dfbd58cdd241b415e0926 | JavaScript | Monette5/simple-node-server | /helpers.js | UTF-8 | 399 | 2.515625 | 3 | [
"MIT"
] | permissive | 'use strict';
function successResponse(res, result) {
return res.status(200).json(result);
}
function errorResponse(res, error) {
return res.status(400).json({
error: error.message
});
}
function sendResponse(res, promise) {
return promise
.then(successResponse.bind(null, res))
.catch(errorRes... | true |
4406eaea45820d1c318f97135fb068fc84c3cec5 | JavaScript | bokewangyu/JavaScript-snippets | /JavaScript_CodeBase/JavaScript-snippets/37.ๅญ็ฌฆ่ฝฌ็ .js | UTF-8 | 284 | 3.640625 | 4 | [] | no_license | //ๅญ็ฌฆไธฒ่ฝฌๆขไธบ16่ฟๅถ
function stringToHex(str) {
var val = "";
for (var i = 0; i < str.length; i++) {
if (val == "")
val = str.charCodeAt(i).toString(16);
else
val += "," + str.charCodeAt(i).toString(16);
}
return val;
} | true |
9a22071a8342574b2b88e303e055b2927d1cfbe5 | JavaScript | acpierc3/AdventOfCode | /Day9/Day9_P2.js | UTF-8 | 886 | 3.640625 | 4 | [] | no_license | "use strict";
//PROBLEM 2. implemented using linked list isntead of array (much faster)
const numElfs = 9; //modify these two params based on puzzle input
const lastMarble = 25;
const addNext = (val, node) => {
const toAdd = {
val,
prev: node,
next: node.next,
};
node.next.... | true |
569c7ba62612c27b0c020cc47688de111028f86a | JavaScript | wnghdcjfe/MEVN | /4์ฅ/simple_pm2.js | UTF-8 | 467 | 2.75 | 3 | [] | no_license | const http = require('http')
const PORT = 12010
const server = http.createServer((req, res) => {
res.setHeader('Content-Type', 'application/json charset=utf-8')
const obj = {
"์ด๋ฆ" : "ํฐ๋"
}
res.end(JSON.stringify(obj))
})
setTimeout(()=>{
//์ ๋ฌ๋ฅผ ๋ฐ์์์ผ์ 1์ด๋ง๋ค ์๋ฒ๊ฐ ์ค์ง๋๊ฒ ๋ง๋ญ๋๋ค.
JSON.parse("{Z")
}, 10... | true |
9f9b17cbf640a3125041bd20018d3f260ee429fd | JavaScript | zengsn/showledge | /src/showledge/src/main/webapp/js/alert.js | UTF-8 | 3,905 | 2.546875 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
/*$("#signin-btn").click(function(event) {
var password = $("#inputPassword1").val(); //็จๆท่พๅ
ฅ็ๅฏ็
var checkNum = $("#inputCheckNum").val(); //็จๆท่พๅ
ฅ็้ช่ฏ็
if (password!=123) {
$('.alert').removeClass('alert-success');
$('.alert').addClass('alert-danger');
$('.alert').text('ๅฏ็ ้่ฏฏ'... | true |
ec3ee0c60079515094c74547a5014d4cf6f8d598 | JavaScript | Anmia/2Park | /treePrice.js | UTF-8 | 2,241 | 3.828125 | 4 | [] | no_license | /*
I am asuming here that only the pricing module is asked for. I am also asuming that a UI is not required.
I asume that the rental period is every started day or hour from the initial starting time.
The format of the start time and end time is assumed to be milliseconds.
It is also heavily assumed that the end d... | true |
5de5579e7f48ebc58b82399baf5a9bb7bbf1eccd | JavaScript | laravel-crypto/pipay | /resources/assets/js/reserved/dataTable.js | UTF-8 | 7,817 | 2.5625 | 3 | [] | no_license | /****************************************************************************************************
*
* Architekt.module.dataTable: DataTable component module
* - options
* bool pagenate: show the cursor and trigger paginating events on click. default is false.
* bool readOnly: set the cursor to pointe... | true |
3f8c70fa43b2ce25be613cc74a048c6296f2b069 | JavaScript | williesmithchen/exercism-javascript | /javascript/pangram/pangram.js | UTF-8 | 213 | 2.828125 | 3 | [] | no_license | export default class Pangram {
static isPangram (string) {
return (string.toLowerCase().match(/([a-z])(?!.*\1)/g) || []).length === 26;
}
}
export const isPangram = (string) => Pangram.isPangram(string);
| true |
9ddd08a296e14a9580c69e192bf8a2ed5348e9b8 | JavaScript | JaimeRC/skylab-bootcamp-201802 | /staff/robert/task-app-api/src/logic/taskLogic.js | UTF-8 | 910 | 2.78125 | 3 | [] | no_license | const taskData = require('../data/taskData')
function validate(text) {
if (!text) throw Error('Invalid task body, you must enter a text.')
}
const taskLogic = {
create(text) {
validate(text)
taskData.create(text, false)
},
markDone(id) {
const task = taskData.retrieve(id) ... | true |