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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4bf9ade9e3667fe53679d5c58800d0236b40596a | JavaScript | wirapratamaa/dipro-train | /src/DataArr.js | UTF-8 | 1,049 | 2.765625 | 3 | [] | no_license | import React, { Component } from "react";
import { mappingString } from "./utils";
export class DataArr extends Component {
constructor(props) {
super(props);
this.state = {
data: [],
color: "black",
arrDats: [],
};
}
handleClick = () => {
let { data } = this.state;
let arrD... | true |
020147f21763c7bf7100a7942ad11c7f9d23ccc8 | JavaScript | MarcoCondinanzo/generadorNotas | /leerTareas.js | UTF-8 | 799 | 3.09375 | 3 | [] | no_license | let fs = require('fs');
const validFilename = require('valid-filename');
const [arg1, arg2, comando, nombreArchivo, ...rest] = process.argv;
const filename = validFilename(nombreArchivo) ? `${nombreArchivo}.json` : 'tareas.json';
let fileContent;
try {
fileContent = fs.readFileSync(filename, 'utf8');
} catch(err... | true |
3465bcec54014989aff67c9b213a206ae3898090 | JavaScript | Abascal-jorge/Proyecto-cliente | /src/components/auth/NuevaCuenta.js | UTF-8 | 4,924 | 2.515625 | 3 | [] | no_license | import React, {useContext, useState, useEffect} from 'react';
import AlertaContext from "../../context/alertas/alertaContext";
import authContext from "../../context/autentificacion/authContext";
import {Link} from "react-router-dom";
const NuevaCuenta = (props) => {
//Creamos una variable para utilizar el conte... | true |
5932a3fb8bdbc70514a3d2fe5de2e08246a86d68 | JavaScript | hamzah-sajid-code/Ultra-Image-Identifier | /main.js | UTF-8 | 1,216 | 2.796875 | 3 | [] | no_license | Webcam.set({
width:310,
height: 300,
image_format: 'png',
png_quality: 90,
constraints:{
facingMode: 'environment'
}
});
Webcam.attach(camera)
function take_image(){
Webcam.snap(function(data_uri){
document.getElementById('result').innerHTML = "<img id='captured_... | true |
05ddc22014b85d9fe382c398486d21bcc1029c19 | JavaScript | ajturner/geodata-workshop | /dashboard/js/application/toolbox.js | UTF-8 | 6,477 | 2.671875 | 3 | [
"MIT"
] | permissive | // clip text to desired length
function truncate(text, length, ellipsis) {
if (!ellipsis) {
ellipsis = '…';
}
if (!length || length <= 0 || text.length < length) {
return text;
} else {
return text.substr(0, length) + ellipsis;
}
}
// Canvas detection
fun... | true |
3503773a6be7afdf4bce802da6fd3f34bad8c705 | JavaScript | florcf/paises-y-ciudades | /src/js/index.js | UTF-8 | 7,662 | 2.9375 | 3 | [] | no_license | import { gameData } from './questions.js';
import { map, moveMap } from './map.js';
import { drawChart, updatePieChart, updateLineChart } from './charts.js';
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
window.addEventListener('load', () => {... | true |
28ae611b1f1cda8dcd5354d9bd551df5d9a4a973 | JavaScript | Myra-R/CouplesQuest | /project1.js | UTF-8 | 965 | 2.984375 | 3 | [] | no_license |
// document.getElementById("searchbtn").onclick=
$("#searchbtn").on("click", function () {
let city = $(".inputValue").val();
var weatherURL = "https://api.openweathermap.org/data/2.5/weather?q=" + city + "&appid=a46d7ace8fe9b30fe73ee26488f40d18";
// get current conditions from openweather
$.ajax({
ur... | true |
b1df8b81f05dbf6d30b69277fe803fa02face8b3 | JavaScript | NoelDevs17/Curso-JavaScript-udemy | /04-Funciones/app.js | UTF-8 | 1,004 | 4.3125 | 4 | [] | no_license |
/*
var nombre;
var prueba = function (n){
return "Hola " + n
}
nombre = "Pablo";
console.log(prueba(nombre));
// argumentos nulos
var a;
a = null;
var valorNulo = function(a){
return a;
}
console.log(valorNulo(a));
//Argumentos por defectos
var sumar = function(a,b, c = 2){
return (a + b) * c;
}
c... | true |
c377ab55f11931dc7c055d6017c78d3b77d4ba85 | JavaScript | oldtsaie299/fall2016-tsaie299.github.io | /catalog/js/main.js | UTF-8 | 1,680 | 2.703125 | 3 | [
"MIT"
] | permissive | var baseFontSize = 20;
var maxFontSize = 45;
$(document).ready(function () {
$('#album1').mouseover(function () {
$(this).css('font-size', maxFontSize + 'px');
$(this).text("1. SWITCH");
}).mouseout(function () {
$(this).css('font-size', baseFontSize + 'px');
$(this).text("Tra... | true |
3e95fefbb7cb51eb0b194481c1c94e4a1008c258 | JavaScript | Ali1213/docx2markdown | /lib/rels.js | UTF-8 | 591 | 2.71875 | 3 | [] | no_license | /*
* relsObj :{
* idValue:{ //idValue :id值
* "type":str,//文件类型
* "target":str//文件路径
* }
* }
**/
const rels = function(xmlStr){
var rtnObj = {};
xmlStr.match(/<Relationship\s+?([\s\S]+?\/>)/ig).forEach((item) => {
var iRe = /id\=\"([\s\S]+?)\"[\s\S]+?type\... | true |
2ddb8372477a2fd7d015108b7b280c74056c5db9 | JavaScript | Nastmi/Bricks | /js/collisionListener.js | UTF-8 | 4,511 | 3.171875 | 3 | [] | no_license | /*In the classic game the ball bounces as follows:
Whenever the ball hits a brick, wall, or the sides of the player the speed is simply reversed:
-if(rightLeftCollision) speedX = -speedX
-else if(topBottomCollsion) speedY = -speedY
HOWEVER if the ball hits the TOP of the paddle, then it's speed ... | true |
7228165fd15514e7595317bede5ac20b84fb9096 | JavaScript | ThabisoMagwaza/hashcode-solutions | /2021/practice/solution.js | UTF-8 | 958 | 3.09375 | 3 | [] | no_license | const fs = require('fs')
const {createChoseDeliveries} = require('./helpers')
const lines = fs.readFileSync(`${__dirname}/input/a_example`).toString().split('\n')
const [NUM_PIZZAS, num2Pteam, num3Pteam, num4Pteam] = lines[0].split(' ').map(val => parseInt(val))
// initialize pizzas
const pizzas = []
for(let i = 1 ;... | true |
c8e256488780867cadf09045fe9f789f91e03d68 | JavaScript | gnavvy/JellyFish | /static/js/views/compass.js | UTF-8 | 2,784 | 2.796875 | 3 | [
"MIT"
] | permissive | App.View.Compass = React.createClass({
getInitialState: function() {
return {
axes: undefined,
points: undefined,
width: 0,
height: 0
};
},
componentDidMount: function() {
this.updateDimensions();
window.addEventListener("resize", this.updateDimensions);
App.socket.e... | true |
f853ac5091824f41eb386da54013c1f87a1953d4 | JavaScript | safekhawaja/js_art | /sketches/working/circle pattern test/roll.js | UTF-8 | 368 | 3.03125 | 3 | [] | no_license | var n = 20;
var X = 0;
var Y = 200;
var D = 400;
function setup() {
createCanvas(640, 400);
background(0);
}
function draw() {
strokeWeight(4);
stroke(255);
for (let n = 0; n < 640; n +=20) {
stroke (255);
line(n, 0, n, height);
if (n > 400) {
noStroke();
fill(0);
... | true |
1ccdb20f09f44df129b0edaf88999ac802e3f66d | JavaScript | xzfd1010/js-leetcode | /code/recursion/findSubstring.js | UTF-8 | 3,123 | 3.796875 | 4 | [] | no_license | // 给定一个字符串 s 和一些长度相同的单词 words。找出 s 中恰好可以由 words 中所有单词串联形成的子串的起始位置。
//
// 注意子串要与 words 中的单词完全匹配,中间不能有其他字符,但不需要考虑 words 中单词串联的顺序。
//
// 示例 1:
//
// 输入:
// s = "barfoothefoobarman",
// words = ["foo","bar"]
// 输出:[0,9]
// 解释:
// 从索引 0 和 9 开始的子串分别是 "barfoor" 和 "foobar" 。
// 输出的顺序不重要, [9,0] 也是有效答案。
//
//
// 示例 2:
//
// 输入... | true |
f329863f6d8b50171867a2099d2e8973f986ce56 | JavaScript | davidlecras/mes-personnages-react | /src/containers/ListOfAllCaracters/SingleCaracter/singleCaracter.js | UTF-8 | 1,362 | 2.78125 | 3 | [] | no_license | import React from "react";
import ImageCaracter1 from "../../../Asset/images/persos/player1.png";
import ImageCaracter2 from "../../../Asset/images/persos/player2.png";
import ImageCaracter3 from "../../../Asset/images/persos/player3.png";
import ImgBow from "../../../Asset/images/armes/arc.png";
import ImgFlail from "... | true |
c186485190b162b15a8da70738f3dba04d466a60 | JavaScript | fchsu/1-todolist | /src/component/InputValue.js | UTF-8 | 948 | 2.53125 | 3 | [] | no_license | import React from 'react';
import './InputValue.css';
class InputValue extends React.Component {
constructor(props) {
/**
* props.propsType: <input /> type
* props.propsPlaceholder: <input /> placeholder
* props.propsClass: <input /> class
* props.propsValu... | true |
cf23a33624b9705577c0f5f9da10bc21312b5eac | JavaScript | bbleds/react-todos | /app/src/js/components/pages/Main.js | UTF-8 | 3,453 | 2.828125 | 3 | [
"MIT"
] | permissive | import React from "react";
import _ from "lodash";
import $ from "jquery";
const Main = React.createClass({
getInitialState: function(){
return {
tasks: []
}
},
componentDidMount: function() {
this.serverRequest = $.get("/tasks", function(result) {
this.setState({
tasks: result
... | true |
84ef48fdba5a4c18881d2c8334a45f71ccc6d748 | JavaScript | Litzenz/WebDev | /cs732-examples/lecture-03-redux/example-03-react-redux/src/App.js | UTF-8 | 2,451 | 2.546875 | 3 | [] | no_license | import React from 'react';
import { BrowserRouter as Router, Switch, Route, Redirect } from 'react-router-dom';
import PageHeader from './layout-components/page-header';
import styles from './app.module.css';
import NavBar from './layout-components/nav-bar';
import ToDoPage from './to-do-page';
import CalendarPage from... | true |
1e7a1f31f46d34c92343ba414feb77207a693a00 | JavaScript | meridukaan/prathamubs | /js/templates/dice_template/rollingDice.js | UTF-8 | 1,436 | 3.03125 | 3 | [] | no_license | var rollingDiceConfig = {};
rollingDiceConfig.currentRandomDiceOne=5; //intial value of the dice
function pointRoll() {
var elDiceOne = document.getElementById('dice1');
var diceValueOne = Math.floor((Math.random() * 6) + 1);
var audioElement = document.getElementById('rollIt');
ubsApp.raiseAudioEvent... | true |
b3c6389f60481c9acd9bdd0366010d723ee8f998 | JavaScript | bomazani/todos2 | /src/App.js | UTF-8 | 2,465 | 2.90625 | 3 | [] | no_license | import React, { Component } from 'react';
import todosList from './todos.json';
import TodoLists from './todoLists/TodoLists';
import './index.css';
class App extends Component {
constructor(props) {
super(props);
this.state = {
todos: todosList,
input: "",
}
}
todoToggleClick = (id) =... | true |
6c7cdd2f72b3ecf44c84a669d053605cff82d6bb | JavaScript | vyacheslav-yu/rc-compiler | /example/simple.js | UTF-8 | 861 | 2.984375 | 3 | [] | no_license | function generateDigits() {
var digits = [], count = getRandomInt(34, 89), i;
for (i = 0; i < count; ++i) {
digits[i] = getRandomInt(0, 512);
}
return digits;
}
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
// compile template
var fs = requir... | true |
eb1e9075b2a21976077fb286c4076866c33edbfb | JavaScript | gomesuit/learning-iot | /temp/app.gs | UTF-8 | 1,116 | 2.765625 | 3 | [] | no_license | function insertData(temperature) {
var datetime = new Date();
var sheet = SpreadsheetApp.getActiveSheet();
sheet.appendRow([datetime, temperature]);
}
function postTemp(temp){
var date = new Date() ;
var payload = [
{
"name" : "Sensor.temp",
"time" : Math.floor( date.getTime() / 1000 ),
... | true |
3f336be6b8e60335d3a97086602b497a56f8efeb | JavaScript | tderonde/finance_calendar | /static/plots.js | UTF-8 | 18,465 | 2.671875 | 3 | [] | no_license | var svg = d3.select("#d3calendar")
.append("svg")
var lineCanvas = d3.select("#chartjsline")
.append("canvas")
.attr("id", "linePlot")
var scatterCanvas = d3.select("#chartjsscatter")
.append("canvas")
.attr("id", "scatterPlot")
// create group for filter labels
var yearSelectorGroup = d3.selec... | true |
3cc78cb50390ff270b720bc00e10d28e04862d19 | JavaScript | handroissuazo/tensorflow | /static/js/search.js | UTF-8 | 632 | 2.796875 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | var requesting = false;
var submitForm = function() {
var species = $("#species").val();
var entries = 36;
var page = 1;
var url = encodeURI("/images/search?entries=" + entries + "&species=" + species + "&page=" + page);
window.location.href = url;
//var url = "/images/search";
/*if (!requesting) {
... | true |
8eac7c100ca97ed20612f85101447b5851ab4360 | JavaScript | reprograma/On8-javascript-iii | /exercicios-para-casa/hellen-barreto/script.js | UTF-8 | 2,850 | 4.3125 | 4 | [] | no_license |
// 1. Liste os números de 0 a 10 no console;
const number = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
console.log(number)
// 2. Some somente os valores ímpares de uma lista de números;
let soma = 0
const numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
for(let i = 0; i , numbers.length; i++){
if(n... | true |
9e068761b88cc791fc9b9a98c72633c88fb8b237 | JavaScript | ayodeji334/ubereatschallengeapp | /redux/reducers/authReducer.js | UTF-8 | 912 | 2.671875 | 3 | [] | no_license | import { LOGIN_ERROR, LOGIN_SUCCESS, LOGOUT_SUCCESS, LOGOUT_ERROR } from "../actionsType";
const initialState = {
isAuthenticated: false,
currentUser: {},
isLoadingAuthStatus: true
};
const authReducer = (state = initialState, action) => {
switch (action.type) {
case LOGIN_SUCCESS:
return {
... | true |
19d46749a3fe384791f79c196fa73b3996bb44d6 | JavaScript | zhangtuoparis13/promise-shop | /shortcut.js | UTF-8 | 2,761 | 3.859375 | 4 | [] | no_license | /**
* Created by TBtuo on 12/08/16.
*/
/*
// The way you have learned: create promise through the constructor.
var promise = new Promise(function (fulfill, reject) {
fulfill('SECRET VALUE');
});
// Introducing: Promise.resolve
// It does the exact same thing as above:
var promise = Promise.resolve... | true |
537b56637e2c7ec3938345ec0eb8d5147d0e6153 | JavaScript | OciCekov/DevAcademy | /Html_CSS_JS/JavaScriptApps/UnderscoreHomework/scripts/firstNameBeforeLast.js | UTF-8 | 572 | 2.84375 | 3 | [] | no_license | define(["collections", "underscore"], function (collections, _) {
var students = collections.students;
var collectionToReturn = new String();
var result = _.filter(students, function (student) {
return student.fname > student.lname
})
_.sortBy(students, function (stu... | true |
f04899c5506492d289bb0e4939208734ad3f4ef4 | JavaScript | ricecreamdude/minesweeper-js | /v2/js/cell.js | UTF-8 | 3,030 | 3.203125 | 3 | [] | no_license | function Cell (col,row){
this.bee = true;
this.revealed = false;
this.w = w;
this.col = col; //x
this.row = row; //y
this.neighborCount = -1;
this.x = col * w;
this.y = row * w;
//Randomly generate bees
if (random(1) < setup_mineProb) {
this.bee = true;
} else {
this.bee = false... | true |
7e90fa27a5b4baba494a96713438cb638cebcb4b | JavaScript | hiroshiuk1991/React-Stocks-london-web-102819 | /src/containers/MainContainer.js | UTF-8 | 1,584 | 2.703125 | 3 | [] | no_license | import React, { Component } from 'react';
import StockContainer from './StockContainer'
import PortfolioContainer from './PortfolioContainer'
import SearchBar from '../components/SearchBar'
const API = 'http://localhost:3000/stocks'
class MainContainer extends Component {
state = {
stocks: [],
portfolio: [... | true |
43fc1fbeff212639bcc59e1f874c158dd7c60f1d | JavaScript | djbotha/ProjectEuler | /problem-2-even-fibonacci-numbers.js | UTF-8 | 275 | 3.3125 | 3 | [] | no_license | function fiboEvenSum(n) {
let one = 1, two = 2, fib, sum = 2;
if (n <= 2) {
return sum;
}
for (let i = 3; i <= n; i++) {
fib = one + two;
one = two;
two = fib;
if (fib % 2 === 0) {
sum += fib;
}
}
return sum;
}
fiboEvenSum(10);
| true |
1d3c550cd1adfd45eb721134117b67d115260e8b | JavaScript | joaosass/mditor | /index.js | UTF-8 | 8,354 | 2.53125 | 3 | [] | no_license | import {useState, useEffect, forwardRef, useRef} from 'react';
import style from './style.css';
const Editor = forwardRef(({defaultData, placeholderText, uploadImage}, ref) => {
const [data, setData] = useState(Array.from({length: 8}).map(() => {
return ({
tag: 'p',
content: ''
});
}));
const... | true |
aa839c58a0fddc05785fd22d867a26ffbc26beef | JavaScript | the4dpatrick/react-native-boilerplate | /app/screens/Intro.js | UTF-8 | 579 | 2.53125 | 3 | [
"MIT"
] | permissive | let React = require('react-native');
let {
StyleSheet,
Text,
View,
} = React;
class Intro extends React.Component{
constructor(props) {
super(props);
}
render() {
return (
<View style={styles.container}>
<Text style={styles.text}>
React Native Boilerplate
</Text>
... | true |
fd3a3c8a2bf5059cbcf21405ffb59e4ae3a369bd | JavaScript | maiconfunke/todo-list-api | /src/routes/lists/lists-routes.js | UTF-8 | 1,219 | 2.65625 | 3 | [] | no_license | 'use strict';
const express = require('express');
const router = express.Router();
// Carrega o controller
const controller = require('./lists-routes-controller');
// Retorna todas as listas
router.get('/api/v1/lists', controller.getLists(true));
// Retorna todas as tarefas de uma lista
router.get('/api/v1/lists/:i... | true |
2eedec1ef24bc63dacfd39c1102764a1bbd91823 | JavaScript | colineckert/aa-classwork | /leetcode/160.intersection-of-two-linked-lists.js | UTF-8 | 987 | 3.53125 | 4 | [] | no_license | /*
* @lc app=leetcode id=160 lang=javascript
*
* [160] Intersection of Two Linked Lists
*/
// @lc code=start
/**
* Definition for singly-linked list.
* function ListNode(val) {
* this.val = val;
* this.next = null;
* }
*/
/**
* @param {ListNode} headA
* @param {ListNode} headB
* @return {ListNode... | true |
6ac7d3954a35cac46b36ded12c3be0161c9cfffb | JavaScript | IngridCBarbosa/Modules-Node | /temporizador.js | UTF-8 | 520 | 2.828125 | 3 | [] | no_license | const schedule = require('node-schedule')
const tarefa1 = schedule.scheduleJob('*/5 * 13 * * 2',function (){
console.log('Executando tarefa 1', new Date().getSeconds())
})
setTimeout(function (){
tarefa1.cancel()
console.log('Cancelando tareda 1')
},2000)
const regra = new schedule.RecurrenceRule()
reg... | true |
ca29e98b6460d9a0f5a0344aaf9ba49706804460 | JavaScript | RuslanKalyniak/test_task_todo_list | /src/component/main/Main.jsx | UTF-8 | 3,566 | 2.546875 | 3 | [] | no_license | import React from 'react';
import { TodoForm } from '../todoForm';
import { Route, Link } from 'react-router-dom';
import { EditTodo } from '../editTodo';
import { Modal } from '../modal/Modal';
import DeleteIcon from '@material-ui/icons/Delete';
import IconButton from '@material-ui/core/IconButton';
import EditIcon fr... | true |
7fdf9256c8e8729909f147dc7a73b67e7d38fcf8 | JavaScript | Arguiwu/data-structure | /list.js | UTF-8 | 2,574 | 3.796875 | 4 | [
"MIT"
] | permissive | function List() {
this.listSize = 0; // (属性)列表的元素个数
this.pos = 0; // (属性)列表的当前位置
this.dataStore = []; // (属性)初始化的一个空数组来保存列表元素
// (方法)清空列表中的所有元素
this.clear = function() {
delete this.dataStore;
this.dataStore = [];
this.listSize = this.pos = 0;
};
// (方法)从列表中查找元素
this.find = function(elemen... | true |
c95c7899e3df1cc9617999cf614b92195a49e03b | JavaScript | SofyaPim/yammy-landing-page | /script.js | UTF-8 | 415 | 2.875 | 3 | [] | no_license | function showImg(path) {
document.querySelector('.bigImg').src = path;
}
function changeCircleColor(color) {
const circle = document.querySelector('.circle');
circle.style.background = color;
}
function toggleMenu() {
var menuBurger = document.querySelector('.toggle');
var nav = document.querySele... | true |
761be95f1912da73ccc3dbab574a4dc9b6fa9dec | JavaScript | amribrahimshaker/MWA-Labs | /Lab04/longOperation.js | UTF-8 | 341 | 2.53125 | 3 | [] | no_license | const fs = require("fs");
var path = require('path');
process.on('message', (msg) => {
console.log(`message received in longOperation.js : ${msg}`);
fs.readFile(path.join(__dirname, "/" +msg), 'utf8', (err, data) => {
if (err) throw err;
console.log(data);
process.send(data);... | true |
b90a660036122637f5746e1cdbf57d19a4cc8a3a | JavaScript | NikGolitsyn/live-sessions | /js/promises/task1/index.js | UTF-8 | 940 | 3.125 | 3 | [] | no_license | //input obj
//output undefined
function saveUser(userData) {
// input url, other params method, header, body, type
// output promise with respond
const res = fetch('https://5e5cf5eb97d2ea0014796f01.mockapi.io/api/v1/users', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8... | true |
df31317102d3503484dcb707a31ae4ac8322fe42 | JavaScript | Nitiquita/hardy_brooklyn | /app/components/Events.jsx | UTF-8 | 2,364 | 2.671875 | 3 | [] | no_license | "use strict";
import React, { Component } from "react";
import { database } from "../../firebase";
export default class Events extends Component {
constructor(props) {
super(props);
this.state = {
HTML: ``,
link: ""
};
}
componentDidMount() {
let promise1 = new Promise((resolve, reje... | true |
3d6dff8c7f35b0594e8b6d13330ab2ef74b50f69 | JavaScript | vidya1783/Home-Work1 | /module-3/10_Review/review-student/js/app.js | UTF-8 | 348 | 2.84375 | 3 | [] | no_license | const DEFAULT_QUESTION_COUNT = 10;
let questionCount = DEFAULT_QUESTION_COUNT;
let problem = {
number: 0,
left: 0,
right: 0,
correctAnswer: 0
}
document.addEventListener('DOMContentLoaded', contentLoaded);
function contentLoaded(){
// SETUP THE TEST
// ASSIGN VALUES TO TEST SET ( array of type probl... | true |
fcf0f4e1fb9f2dff143208cd690f52cdc981141e | JavaScript | abbesdjilali/guidap_marketplace_api | /app/src/services/user.services.js | UTF-8 | 1,030 | 2.515625 | 3 | [] | no_license | const bcrypt = require('bcrypt');
const saltRounds = 10;
const cnx = require("../config/db.config");
exports.saveUser = user => new Promise((resolve, reject) => {
cnx.query("INSERT INTO users SET ? ;",[user],(error, results) => {
if (error)
return reject(error);
resolve(results.affe... | true |
a83b845ef525da69981b69f15cf5dba59e69742f | JavaScript | tanishkulshrestha/express-server | /extra/patterns/diamond.js | UTF-8 | 588 | 3.484375 | 3 | [] | no_license | export default function diamond(n) {
console.log("This is Diamond");
let k, i, j;
let pattern = "";
for (i = 1; i <= n; i++) {
for (j = 1; j <= n - i; j++) {
pattern += " ";
}
for (k = 1; k <= i; k++) {
pattern += "* ";
}
console.log(pattern);
pattern = "";
console.log(""... | true |
4db498abaf98848e55e85a4822e6dcd9ccd2fb40 | JavaScript | Gato18/questBack | /routes/index.js | UTF-8 | 14,275 | 2.546875 | 3 | [] | no_license | var mongoose = require("mongoose");
var express = require("express");
const axios = require("axios");
var uniqid = require("uniqid");
var fs = require("fs");
var router = express.Router();
var UserModel = require("../models/users");
const { ObjectId } = require("mongodb");
const { response } = require("express");
ro... | true |
3c7d29963ae0184c8f85101705ffff75451a2d85 | JavaScript | ThibCL/HyperMedia | /public/assets/js/allEventsByMonth.js | UTF-8 | 1,815 | 2.6875 | 3 | [] | no_license | $(document).ready(function () {
var id = "1"
var paramsString = window.location.search.toString()
var searchParams = new URLSearchParams(paramsString)
id = searchParams.get("event-id")
$.get(
"https://agirpourlenvironnement.herokuapp.com/v1/event/by-month",
function (response) {
response.forEach... | true |
4fd941eab94d1ce1f2f8f3fd0a95f6fc9f1c2189 | JavaScript | OmarSaed/vschool | /excercises/Day 33/script.js | UTF-8 | 309 | 2.78125 | 3 | [] | no_license | function deleteItem(item){
$(item).remove();
}
$("#submit").click(function(){
var item = $("#text").val();
console.log(item);
$(".output").append ( "<li id = '" + item + "'> <button onclick =deleteItem(" + item + ")>x</button>" + item + "</li>" );
$("#text").val("");
});
| true |
c60aad36dca0bf2dae81a2f9d6744415fffa3932 | JavaScript | oslego/oak | /test/oak.test.js | UTF-8 | 921 | 2.765625 | 3 | [] | no_license | $(document).ready(function(){
module("Oak - Dictionaries");
test("Dictionary", function(){
var oak = new Oak();
var dictionary = {
label:{
key1: "value1",
key2: "value2"
}
};
var locale = "en_US";
ok(true, oak.setDictionary(locale, dictionary), "oak.setDictionary() success... | true |
2e2fe91b9d3c5a5fcda8eaf26251e2ae5e6613ae | JavaScript | DawidGaleziewski/udemy_node_backend | /5_asynchronous_node/8_refining_code_with_destructuring_objects/playground.js | UTF-8 | 1,132 | 3.921875 | 4 | [] | no_license | // Object property shorthand
const name = 'Andrew';
const userAge = 27;
// # 1 shorthand
const user = {
name: name,
userAge: userAge,
location: 'Philadelphia'
};
// Better shoorthand settings values
const userBetter = {
name,
userAge,
location: 'Philadelphia'
};
// # 2 destructuring
const pro... | true |
7ca08661fb77319060998474b66dba032d690ca4 | JavaScript | chaasPUI/h6B | /js/cart.js | UTF-8 | 3,919 | 3.59375 | 4 | [] | no_license | // Check if anything is in the cart when page loads
window.onload = checkCart;
// Check if anything is in the cart
function checkCart() {
if (sessionStorage.getItem('totalQty') && parseInt(sessionStorage.getItem('totalQty'))>= 1){
// Something in cart
visibility(true);
updateCartCount( ses... | true |
83dc32f6891c9a6f655c9e887c65e4aca0c0fd52 | JavaScript | yangyin/react-project | /front-a/src/utils/localStorage.js | UTF-8 | 591 | 2.671875 | 3 | [] | no_license | var Global = (typeof window !== 'undefined' ? window : global);
function localStorage() {
return Global.localStorage
}
export function read(key) {
return JSON.parse( localStorage().getItem(key) );
}
export function write(key, data) {
return localStorage().setItem(key, JSON.stringify(data));
}
// function each(fn... | true |
003d2a03e49ecdec6217f80e04c320f5e5186e70 | JavaScript | TJRoger/popularconvention | /test/parser/php-parser.spec.js | UTF-8 | 52,690 | 2.734375 | 3 | [
"MIT"
] | permissive | const expect = require('chai').expect;
const parser = require('../../src/parser/php-parser');
describe('PHP-parser >', () => {
describe('indent >', () => {
it('check space indent #1', () => {
const convention = parser.indent(`function bar($baz) {`);
expect(convention.space).equal(0);
});
it(... | true |
4013ef0dea7152d172785f211969ce669c8434df | JavaScript | Nielene/constructor_assignment | /constructor.js | UTF-8 | 2,274 | 4.65625 | 5 | [] | no_license | //1.
// * Create a Human constructor function that takes in a name and age.
function Human(name, age, hobby) {
this.name = name;
this.age = age;
this.hobby = hobby;
};
//* Add a prototype function ageOneYear that ages the humans age.
Human.prototype.ageOneYear = function(){
this.age++
};
//* Add a prototype ... | true |
24797bf0db5273da5fa89addfccad9d40c0ebdb7 | JavaScript | lovesly/algorithm | /leetcode/233.countDigitOne/solutionV1.js | UTF-8 | 762 | 3.765625 | 4 | [] | no_license | /**
* @param {number} n
* @return {number}
*/
var countDigitOne = function(n) {
if (typeof n !== 'number' || n <= 0) return 0;
// get length
let str = n.toString();
let len = str.length;
let res = 0, pre = 0, base;
for (let i = 0; i < len; i++) {
base = powerBase10(len - i);
i... | true |
d1a87ecb3f431389ace41b3f22fd560cdeaf687f | JavaScript | rainbee2214/WikiTrax | /js/graphs.js | UTF-8 | 14,833 | 2.5625 | 3 | [
"MIT"
] | permissive | window.onload = OnWindowLoad;
var currentChart = 0;
var allCharts = ["Force","Category", "Bar"];
function OnWindowLoad()
{
chrome.storage.local.get("dataSets", function(val)
{
chrome.storage.local.get("currentChart", function(val)
//Check the local storage to pull which chart and set current chart ... | true |
3c571e29fef3c6a0fbc4614eac2d696d90d41691 | JavaScript | Stephan311/Steph-s-Awesome-HTML-Generator | /__tests__/Employee.test.js | UTF-8 | 673 | 2.765625 | 3 | [] | no_license | const Employee = require('../lib/Employee');
describe('Employee', () => {
describe('Initialization', () => {
it("returns the correct name", () => {
const employee = new Employee("steph", 1, "awesome@awesome.com")
expect(employee.getName()).toEqual("steph");
})
it(... | true |
69d7c8e8182bf680d60a22ac18523e11f9a4f8e0 | JavaScript | artrugh/JSBasic-learning-exercising | /conditional-exercising/exer-conditionals-strNum-4-solution.js | UTF-8 | 2,232 | 3.40625 | 3 | [] | no_license | //Find the common rule for each exercise.
//after looking the code, write the statement of the task. They can be more than one rule.
let a = 'DCI';
let b = 'fantastic15!';
let c = 'greenbalcony';
let d = 'climbingMt.Everest.';
let e = 'what are you drinking?';
if (a.includes("!") || a.includes(".") || a.includes("?"... | true |
09fef81800f801f30110283dc753ac3ac77f90e3 | JavaScript | ariel-weiss/recipe-app | /client/src/redux/Recipe/recipeReducer.js | UTF-8 | 603 | 2.59375 | 3 | [] | no_license | import * as types from './recipeTypes';
const initState = {
loading: false,
recipes: [],
errorMsg: ''
};
export const recipeReducer = (state = initState, action) => {
switch (action.type) {
case types.FETCH_RECIPES_REQUEST:
return { loading: true, recipes: [], errorMsg: '' };
... | true |
e465a66e60fbc36a3c39c598cba677d92fcddc25 | JavaScript | RanNahmijas/Monsoon | /includes/javaScript/jsFile.js | UTF-8 | 17,250 | 2.96875 | 3 | [] | no_license | /*
* -----------------------------------------------
* Purpose: Main JS file - MONSOON
* Version: 0.1
* Author: Dror Afargan & Ran Nahmijas
* Date: 1/6/2013
* --------------------------------------------
*/
/*---------------------------
Parallax navigation settings
----------------------------*/
$(document).ready(f... | true |
2377d97ace1b597b7bc537d57fbbaad80187d308 | JavaScript | Elevationacademy/week-2-droryair | /day-4(jQuery, Data flow)/Data-Flow/apply/main.js | UTF-8 | 958 | 2.9375 | 3 | [] | no_license |
// RECAP EXERCISE
// link :https://kernel.elevation.ac/cohorts/53/lessons/53/apply/activity/3
let posts = [
{
name: "Name1",
text: "Text1"
},{
name: "Name2",
text: "Text2"
},{
name: "Name3",
text: "Text3"
}
]
const render = function (){
$('#posts').... | true |
7091559bf0ddc9585da9739456f1813bc2f11249 | JavaScript | martinbryant/beer_engineer | /src/middleware/local-storage-middleware.js | UTF-8 | 1,393 | 2.53125 | 3 | [] | no_license | import {
SAVE_TO_LOCAL_STORAGE,
saveToLocalStorageError,
saveToLocalStorageSuccess,
LOAD_FROM_LOCAL_STORAGE,
loadFromLocalStorageSuccess,
loadFromLocalStorageError
} from '../actions/data-actions'
export const localStorageMiddleware = ({ getState }) => next => action => {
next(action)
i... | true |
093dabab7d05550716b9b0049f07dbad6d0aec57 | JavaScript | Doenet/RendersInViewer | /src/DoenetViewer.js | UTF-8 | 3,414 | 2.5625 | 3 | [] | no_license | import React, { Component } from 'react';
import Core from './Core';
class DoenetViewer extends Component {
constructor(props) {
super(props);
this.update = this.update.bind(this);
this.coreReady = this.coreReady.bind(this);
this.buildTree = this.buildTree.bind(this);
this.rendererUpdateObjects... | true |
daf84af69eecbd78b5c8a86cf6a9e69d73a8d20e | JavaScript | uumoss-bb/generative_art | /AsMuchAsPossible/sketch.js | UTF-8 | 1,599 | 3.375 | 3 | [] | no_license | let AllParticals = []
// COLORs # "#7D7D7D" "#2B2B2B" "#303030" "#383838"
function setup () {
// //find appropriate canvas width
// canvas_size = windowWidth < windowHeight ? windowWidth : windowHeight
// canvas_size -= 80
createCanvas( windowWidth, windowHeight )
// //set canvas in center
// let margin_left ... | true |
1ffaad62c0dfaeeee038513e8ddd7c9dec531bfd | JavaScript | alexsilvar/pbiembed-javascript | /dist/pbiembed.js | UTF-8 | 5,601 | 2.90625 | 3 | [
"MIT"
] | permissive | /********************************************/
/*Desenvolvido por Alexsander Ramos da Silva*/
/* V1.0 DATA:02/02/2018 */
/* */
/* Nome: Power BI Easy Embed */
/* */
/********************************************/
//Declaracoes de variaveis
//Objeto que cuida do loguin e requests... | true |
862d03e2699c96fb4332566dba8d3bfe4374733a | JavaScript | jwilber/got_charts | /arc/arc.js | UTF-8 | 5,801 | 3.140625 | 3 | [] | no_license | // set the dimensions and margins of the graph
let margin = {top: 0, right: 30, bottom: 50, left: 60},
width = 1200 - margin.left - margin.right,
height = 600 - margin.top - margin.bottom;
// append the svg object to the body of the page
const svg = d3.select("#my_dataviz")
.append("svg")
.attr("width", wid... | true |
005df4186dd0e625b9c9b9e73b416de7a23490fb | JavaScript | miriam-lau/Algorithms-JavaScript | /elements_of_programming_interviews/heaps.js | UTF-8 | 6,377 | 3.96875 | 4 | [] | no_license | /** Min Heap
* Heap property: the key at each node >= keys stored in its children.
* Formula to find the children: 2i + 1, 2i + 2
* Formula to find parent: childIndex - 1 / 2 (if childIndex is odd),
* childIndex - 2 / 2 (if childIndex is even)
*/
class MinHeap extends Array {
constructor() {
super();
th... | true |
eecf30a5b51ba87d56a5c1625384993532068c0d | JavaScript | alexsmaroco/dcc138-alexsmaroco | /aulas/semana04/Scene.js | UTF-8 | 1,232 | 3.28125 | 3 | [] | no_license | function Scene(params) {
var exm = {
sprites: [],
ctx: null,
w: 400,
h: 400,
}
Object.assign(this, exm, params);
}
Scene.prototype = new Scene();
Scene.prototype.constructor = Scene;
Scene.prototype.desenhar = function() {
for(var i = 0; i < this.sprites.length; i++) {
... | true |
7ba294e6f7eb490c126109f7ee667bd0cde29557 | JavaScript | mjmayor/sequelize | /src/repository/AlumnoRepository.js | UTF-8 | 2,388 | 2.546875 | 3 | [] | no_license | var properties = require('node-properties')('node-module-sequelize'),
common = require('node-common')('node-module-sequelize'),
mySqlDriver = require('../lib/MySqlDriver'),
connection = mySqlDriver.getConnection(),
Alumno = require('../models/Alumno.js').getModel(),
Asignatura = require('../models/A... | true |
3ff63c8c737b8cc8d4b889bb61641f2f184864b1 | JavaScript | richajain14/todo-server | /app/routes.js | UTF-8 | 4,532 | 2.65625 | 3 | [] | no_license | var _ = require('lodash');
var Todo = require('./models/todo_model');
var User = require('./models/user_model');
function getTodos(res, user) {
Todo.find({
$or: [{ username: user }, { isPublic: true }]
}, function (err, todos) {
console.log(`HERE 4 ${todos}`);
if (err) {
ret... | true |
834eb4b90eaf7b41360e893a556a5dee31947dad | JavaScript | hitode909/appspot | /htdocs/js/wav.js | UTF-8 | 4,289 | 2.546875 | 3 | [
"MIT"
] | permissive |
$.deferred.define();
$.extend({
// see http://github.com/yanagia/jsaudio
wavUtil: {
playSaw: function(duration, f, factor) {
var data = this.createSignal(duration, f, factor);
return this.playUrl(this.convertToURL(data));
},
createSignal: function(t, sinF, facto... | true |
bc593398c7966b06daf0c7db1378e6a583f7a8b7 | JavaScript | ranxiaoli/study-by-write | /nodejs/mongoose01/demo_update_delete.js | UTF-8 | 1,712 | 3.03125 | 3 | [] | no_license | // 1、引入
const mongoose = require('mongoose');
// 2、建立连接
mongoose.connect('mongodb://127.0.0.1:27017/rxl');
// 3、操作users集合, 定义一个shecma
// shecma中的对象,需要跟表里面的字段一一对应
const UserShecma = mongoose.Schema({
name: String,
username: String,
age: Number
});
// 4、定义数据库模型,操作数据库
// model中里面的第一个参数, 注意:首字母大写,要和数据库表(集合名称)对应
//... | true |
c473f3cee36e635e1acde495d5ac9c37e3c7547b | JavaScript | trainings-juanmaguitar/training-leadtech-spring2019 | /staff/lbaella/JavaScript/random_arrow_functions.js | UTF-8 | 8,549 | 4.25 | 4 | [] | no_license | /*
randomLargest()
Randomizes three numbers in range (0.. 100) and prints the largest one.
*/
var randomLargest = () => new Array (3)
.fill(0)
.map(() => Math.round(Math.random()*100))
.reduce ((largest, number, index, array) => {
... | true |
cba586ff930ce1a17c87248fe13b3c3fd6f8409b | JavaScript | shijiandatou/redux | /src/history/redux+react.js | UTF-8 | 1,447 | 2.890625 | 3 | [] | no_license | import { createStore } from "./redux";
import React,{ Component } from "react";
import ReactDOM from 'react-dom';
// import $ from'jquery';
const INCREASE='INCREASE';
const DECREASE='DECREASE';
// console.log($);
//state 是状态树,可以是任意结构
//action是一个纯对象 里面需要事件的类型{type:'INCREASE',amount:2},{type:"DECREASE",amount:1}
let redu... | true |
fc1d379cf253f682e1044406d53162ccc7ebba86 | JavaScript | jmzagorski/allforms | /test/unit/api/element-api.spec.js | UTF-8 | 2,247 | 2.515625 | 3 | [] | no_license | import using from 'jasmine-data-provider';
import { HttpStub } from '../stubs';
import { ElementApi } from '../../../src/api/index';
describe('the element api', () => {
let sut;
let httpStub;
beforeEach(() => {
httpStub = new HttpStub();
sut = new ElementApi(httpStub);
});
it('fetches the elements ... | true |
551bf0e0003c97b9848a93aebc99a2cec4a23464 | JavaScript | ripssr/Code-Combat | /8_Cloudrip_Mountain/475-Slumbering_Sample/slumberingSample.js | UTF-8 | 532 | 3.375 | 3 | [
"MIT"
] | permissive | // One last stop before the plan can be set into motion!
// It's up to you to help Senick get the average size of these yetis.
// Find all the Yetis using 'findByType':
var yetis = hero.findByType("yeti");
// Implement the averageSize function from scratch:
function avgSize(units) {
if (units.length === 0)
... | true |
a4093bcab2179a2f304d777b60f4cee37e1f400f | JavaScript | epoch/fullslack | /01-javascript/ex/ex2.js | UTF-8 | 545 | 4.5 | 4 | [] | no_license | // # Your top choices
// Create an array to hold your top choices (colors, presidents, whatever).
// For each choice, log to the screen a string like: "My #1 choice is blue."
// Bonus: Change it to log "My 1st choice, "My 2nd choice", "My 3rd choice", picking the right suffix for the number based on what it is.
var... | true |
da432e8ccfbd860b51471b258115d1bd72f4b2aa | JavaScript | cosaid2/myfirstproject | /statement.js | UTF-8 | 162 | 3.28125 | 3 | [] | no_license | let music = (" classical ");
if (musical = "classical") {
console.log("Oh no it's that classical again");
}
else if (music == noMusic) {
console.log()
} | true |
53349a29612895e20a1b99220084a2122015287c | JavaScript | Samsung/TAU | /src/js/profile/mobile/widget/TextInput.js | UTF-8 | 33,917 | 2.78125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference",
"LicenseRef-scancode-warranty-disclaimer",
"LicenseRef-scancode-flora-1.1"
] | permissive | /*global window, define, ns, HTMLTextAreaElement, HTMLInputElement */
/*
* Copyright (c) 2015 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http:/... | true |
b9b7e9ac229a6ca97ecea6cbc3ebaa2800def20a | JavaScript | ZacharyWeiner/ETH-CrowdFunding-Dapp | /pages/campaigns/new.js | UTF-8 | 1,902 | 2.71875 | 3 | [] | no_license | import React, {Component} from 'react';
import {Form, Button, Input, Message} from 'semantic-ui-react';
import Layout from '../../components/layout';
import factory from '../../ethereum/factory';
import web3 from '../../ethereum/web3';
class CampaignNew extends Component{
state = {
minimumContribution: '100',
... | true |
57a98ff2dfb52769a547e9e2e4569960f41807ec | JavaScript | DorZevron/GamesMVCWebAPI | /FinalProjectDotNetDorZevronWebApi/Scripts/ReactiveExtension/RxJs.js | UTF-8 | 755 | 2.734375 | 3 | [] | no_license | const Button1 = document.getElementById('btnRx')
const url = 'http://localhost:60594/api/Games';
let game = {
next: (value) => {
console.log(value)
const list = value.response
for (var i = 0; i < list.length; i++) {
let item = list[i];
f... | true |
aa085729e2b6cce93012ad4f21eaab5630efc6ec | JavaScript | MigrantCaravan/Wicked-Wearables | /server/index.js | UTF-8 | 1,315 | 2.65625 | 3 | [] | no_license | "use strict";
const express = require("express");
const morgan = require("morgan");
// Import handler functions
const {
getItems,
getItemById,
addToCart,
getCompanyById,
addToWishList,
getCompanies,
} = require("./handlers");
const PORT = 4000;
express()
.use(function (req, res, next) {
res.h... | true |
4cd30b2528a2593e0a5a8be9ea5b190f1f0639b0 | JavaScript | wguanwei/mysjm | /app9.js | UTF-8 | 9,177 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | /**
* Created by wgw on 2015/3/16.
*/
/*完全自己的想法实现*/
//相对于app8.js 实现了能点击猫的逻辑,以前只能点击空白
var stage =new createjs.Stage("gameView");
createjs.Ticker.setFPS(30);
createjs.Ticker.addEventListener("tick",stage);
var gameView=new createjs.Container();
stage.addChild(gameView);
gameView.x=30;
gameView.y=30;
/*数组定... | true |
dfd70de48a5ac86d23861a6835321ef007bd478b | JavaScript | kenoflee/vue-stock-trader | /src/util/util.js | UTF-8 | 342 | 3.3125 | 3 | [] | no_license | export const getNewStockPrice = (value) => {
//randomly decide the percentage between 0 to 5%
const percentage = Math.random() * 0.05;
//randomly decide to increase or decrease
const sign = Math.random() >= 0.5 ? 1 : -1;
const movement = 1 + (sign * percentage);
return parseFloat((value * mo... | true |
e8584831a7726e1a7baba37fdbe70cd2ae43e40c | JavaScript | Xcraft-Inc/shellcraft.js | /examples/myShellExtension.js | UTF-8 | 2,776 | 2.96875 | 3 | [
"MIT"
] | permissive | /* The author disclaims copyright to this source code. In place of
* a legal notice, here is a blessing:
*
* May you do good and not evil.
* May you find forgiveness for yourself and forgive others.
* May you share freely, never taking more than you give.
*/
'use strict';
var zog = 'zog';
var cmd = {... | true |
3da1f73cef2c354749f8044a457d32762d6d8419 | JavaScript | kotaokubo/make_user_api | /mongo.js | UTF-8 | 631 | 2.765625 | 3 | [] | no_license | // 必要なモジュールをインポート
const MongoClient = require("mongodb").MongoClient;
const assert = require("assert");
// dbをurl変数に格納
const url = "mongodb://localhost:27917/";
let db;
// connectメソッドを用いてdbに接続
MongoClient.connect(url, function(err, mongodb) {
assert.equal(null, err);
console.log("初めてのAPIサーバーが起動しました!おめでとう!");
/... | true |
ccaab3655e99c02fbfc669d0b220f8cf24d564d1 | JavaScript | davidgape89/technical-task | /src/test/components/CurrencyInput.test.js | UTF-8 | 2,155 | 2.53125 | 3 | [] | no_license | import React from 'react';
import {shallow} from 'enzyme';
import Input from '@material-ui/core/Input';
import CurrencyInput from '../../components/CurrencyInput';
describe('CurrencyInput -', () => {
let wrapper, onChange, defaultProps;
beforeEach(() => {
onChange = jest.fn();
defaultProps = {
labe... | true |
d756008a22ff6299ce7c07d872501f1f806dc162 | JavaScript | fuerinal/lab-ajax-crud-characters | /starter_code/public/javascript/index.js | UTF-8 | 2,122 | 2.859375 | 3 | [] | no_license | const charactersAPI = new APIHandler("http://ih-api.herokuapp.com");
$(document).ready(() => {
$('#fetch-all').on('click', (e) => {
charactersAPI.getFullList().then((heroes) => {
console.log(heroes);
heroes.forEach(heroe => {
const $container = $('.characters-container');
const $heroe... | true |
ef8228e7ee0c783bb42900a851049c955d7643c1 | JavaScript | just-a-n00b/Gif-It | /src/components/Video.js | UTF-8 | 3,880 | 2.5625 | 3 | [] | no_license | import React, { useEffect, useState } from "react";
import "../styles/Video.css";
import VideoActions from "./VideoActions";
import YouTube from "react-youtube"; // https://www.npmjs.com/package/react-youtube
const Video = ({
videoDetails,
setVideoDetails,
showEditControls,
setShowEditControls,
}) => {... | true |
d334224234d8a66ba52dbcc356bfd2a2327a9f66 | JavaScript | DanielUche/react-native-contantlist | /src/store/reducers/auth.reducer.js | UTF-8 | 565 | 2.53125 | 3 | [] | no_license | import * as actionTypes from '../action-types';
const initialState = {
loading: false,
detail: {},
error: '',
};
/**
* @description poi reducer handles all poi action types
* @param {obj} state initial object
* @param action
* @returns {obj}
*/
export default (state = initialState, action) => {
switch (a... | true |
e111de4dd7e873f9be21c29ca1aa1cd5ac4284f9 | JavaScript | Tal1414/SuperSimpleGradientBackgroundGenerator | /script.js | UTF-8 | 470 | 3.328125 | 3 | [] | no_license | var color1 = document.getElementById('color1');
var color2 = document.getElementById('color2');
var body = document.getElementsByTagName('body');
var h3 = document.querySelector('h3');
function backgroundColor() {
body[0].style.background = "linear-gradient(to right, "
+ color1.value +", " + color2.value +")";
h... | true |
3b1ca29ee5de78fbd850f5dbff6c97c139b17e6a | JavaScript | pankajpriyansh/YITS-IssueTracker | /yashissuetrackersystem-web/src/main/webapp/scripts/attachment.js | UTF-8 | 1,418 | 2.796875 | 3 | [
"MIT"
] | permissive | $(document).ready(function() {
$("#chooseFile1").click(function() {
alert("chooseFile1");
$("#two").show();
$("#chooseFile1").hide();
});
$("#chooseFile2").click(function() {
alert("chooseFile2");
$("#three").show();
$("#chooseFile2").hide();
});
var text_max = 100;
... | true |
c81cc12ffbd0e18307f2345a2de624f2c057c2d3 | JavaScript | basil-kawak/bootcamp-istanbul-2020mar | /class9/lilas-dara/index.js | UTF-8 | 338 | 3.203125 | 3 | [] | no_license |
let calculateBtn = document.getElementById('square-button');
calculateBtn.addEventListener("click", function(e) {
let inputSquare = document.getElementById('square-input').value;
let bTag = document.getElementById("firstResult");
let calculation = parseInt(inputSquare*inputSquare);
btag.appendChild(calcul... | true |
0fbfc9c1535934b0b3a6f23b4f8198f4007cd7e0 | JavaScript | admoexperience/generator-admo | /templates/scripts/core-components/tracker.js | UTF-8 | 1,753 | 2.90625 | 3 | [
"MIT"
] | permissive | //*****************************************************************
// Fairly generic functionality to have an object track the user's head or hand.
//
// The following properties should be set:
// - id: the element id (in html)
// - width: the width of the element
// - height: the height of the element
// - border: th... | true |
02c42c63a064b39435647580e457542c06164a15 | JavaScript | kingco4/funSayings | /main.js | UTF-8 | 248 | 2.90625 | 3 | [] | no_license | getQuote();
setInterval(getQuote, 10000);
function getQuote() {
fetch('https://api.kanye.rest')
.then((resp) => resp.json())
.then(function (data) {
document.getElementById("quote").innerHTML = data.quote;
});
}
| true |
ca4a6db5dde5a3dc0989ceb33487e3558c4a974f | JavaScript | daviskoh/codechallenges | /javascript/dash_insert/spec/dash_insert.spec.js | UTF-8 | 868 | 2.609375 | 3 | [] | no_license | var dashInsert = require('../lib/dash_insert.js');
describe('dashInsert', function() {
it('is a function', function () {
expect(typeof dashInsert).toBe('function');
});
it('should not insert a dash for a number with no odd num digits', function () {
expect(dashInsert(842)).toBe('842');
... | true |
00b45dbd17a180da6615898f409be519d9b34ecb | JavaScript | JiandeLi1/React_Shopping_Web_App | /src/Shopping.js | UTF-8 | 3,896 | 2.734375 | 3 | [] | no_license | import React, { useState } from 'react'
import Grid from '@material-ui/core/Grid';
import Navigation from './components/Navigation/Navigation'
import Product from './components/Product/product'
import Filter from './components/Filter/Filter'
import Car from './components/Car/Car'
import './app.css'
function Shopping... | true |
6c7fc6d9df6056b65cd6a49a826abaf53036e779 | JavaScript | baszealot13/pbe | /app/views/default/js/JZZ.Midi.js | UTF-8 | 6,755 | 2.8125 | 3 | [] | no_license | /**
* JZZ.Midi.js
*
* This module defines the MIDI event class and helper functions.
*
* This script is free to use, modify and distribute.
*
* More information is available at http://jazz-soft.net
*
**/
var JZZ_;
if (!JZZ_) JZZ_ = {};
else if (typeof JZZ_ != 'object') throw new Error("JZZ_ namespace confl... | true |
2d149214ebe9873d8b958cf8859070194ffa3d1b | JavaScript | kt3k/example-testdouble.js | /index.js | UTF-8 | 286 | 2.6875 | 3 | [] | no_license | const axios = require('axios')
window = { alert () {} }
exports.getGithubProfile = function (name) {
return axios.get(`https://api.github.com/users/${name}`)
}
exports.checkMoney = function (money, price) {
if (money < price) {
window.alert('残金が足りません')
}
}
| true |