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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f31566d8b57ada305923edcbda522fd14aa3261f | JavaScript | xy113/LeiPHP | /static/js/dsxvalidate.js | UTF-8 | 7,579 | 2.984375 | 3 | [
"MIT"
] | permissive | //验证
var DSXValidate = {
IsURL : function(url){
return /^http:\/\/[A-Za-z0-9]+\.[A-Za-z0-9]+[\/=\?%\-&_~`@[\]\:+!]*([^<>])*$/.test(url);
},
IsChineseName:function(username){
return /^[\u4e00-\u9fa5]{2,12}$/.test(username);
},
IsUserName:function(username){
return /^[a-zA-Z0-9... | true |
7e2b8da24403d4ac750ff3afea89f72f5b5efc3e | JavaScript | koukyo1994/webapp-learning | /javascript/inteern-js/src/view.jsx | UTF-8 | 1,122 | 2.8125 | 3 | [] | no_license | import * as React from "react";
import PropTypes from "prop-types";
export function Hello() {
return (
<div>
<Counter />
</div>
);
}
class Clock extends React.Component {
constructor(props) {
super(props);
this.state = { date: new Date() };
}
componentDidMount() {
this.timerID = se... | true |
30c1632ca84ea1eaf007a8c9cb7a6bbfd2040c16 | JavaScript | mayank-phadke/search-bar | /src/components/spaceXList.jsx | UTF-8 | 1,833 | 2.53125 | 3 | [
"MIT"
] | permissive | import React from "react";
export default class SpaceXList extends React.Component {
render() {
let filteredData = this.props.data
.filter((item) => {
return item.name
.toLowerCase()
.includes(this.props.searchText.toLowerCase());
})
if (filteredData.length == 0) {
return (
... | true |
114fbaa9e92affec1e23940bff70be21b5bfdc77 | JavaScript | ULL-ESIT-GRADOII-PL/object-oriented-programming-in-js-edda | /assets/js/conversor.js | UTF-8 | 5,038 | 3.1875 | 3 | [] | no_license | (function(exports) {
"use strict";
function Medida(valor, tipo) { // Clase para almacenar medidas. Tipo es opcional, puede admitir new Medida("45.2 Km")
this.valor = valor;
this.tipo = tipo;
}
function Temperatura(valor, tipo) { // Clase para la creación de medidas de temperaturas. Herencia de Medida... | true |
278d1cab9936cf212562c4377360af08b4fe71e8 | JavaScript | danilags/react-password-manager | /src/components/ValidationPass.js | UTF-8 | 2,602 | 2.8125 | 3 | [] | no_license | import React from 'react';
import {
FontIcon,
List,
ListItem, } from 'material-ui'
const styles = {
validation: {
width: '500px',
margin: '0 auto',
backgroundColor: '#B3E5FC',
}
}
class ValidationPass extends React.Component {
constructor(props) {
super(props)
this.state = {
upp... | true |
ad65cff617e243f097acc5fb21a512af4c71fc78 | JavaScript | 100ideas/algorithms-in-js | /src/puzzles/connected-cells-in-grid.js | UTF-8 | 864 | 3.46875 | 3 | [] | no_license | function getRegionSize(matrix, row, col) {
// row col position is out of bounds
if (row < 0 || col < 0 || row >= matrix.length || col >= matrix[row].length) {
return 0;
}
if (matrix[row][col] === 0) {
return 0;
}
matrix[row][col] = 0; // set as visited
// recursively visit every neighbour
ret... | true |
e5b2752b7e1150d5f89db0431b8f6015efbace89 | JavaScript | john-d-pelingo/react-weather | /app/components/About.jsx | UTF-8 | 1,024 | 2.859375 | 3 | [] | no_license | let React = require('react');
// Presentational/Dumb component
// let About = React.createClass({
// render: function () {
// return (
// <h3>About Component</h3>
// );
// }
// });
// Stateless functional component
// Doesn't maintain any state
let About = (props) =>... | true |
4168c53c59aed77d2446a448bead1595a398ac7b | JavaScript | kevinaxu/kevinaxu.github.io | /projects/2019_07/MinimalList/todo.js | UTF-8 | 12,651 | 3.15625 | 3 | [] | no_license | /**
* Utilities
*/
function createElementFromHtml(html) {
var template = document.createElement('template');
var html = html.trim();
template.innerHTML = html;
return template.content.firstChild;
}
/**
* Class representing a ListItem
*/
class ListItem {
/**
* Create a ListItem
* @par... | true |
4ca017192331f9c7ac7196c932922bd8e5d2f4c0 | JavaScript | coderkarma/ALGORITHMS | /Narsissictic.js | UTF-8 | 678 | 3.953125 | 4 | [] | no_license | function narcissistic( value ) {
// declare the variable sum
// convert the value in to str and split into arr
// loop through the arr
// get the exponent of the each number
// check to see if the sum exponents equals to value
// if it equal return true else false
//let sum = 0... | true |
30eccf41a798e931911a8d01a22fb807092f7624 | JavaScript | syscover/pulsar | /public/plugins/phpjs/functions/strings/strnatcmp.js | UTF-8 | 2,955 | 3.1875 | 3 | [
"MIT"
] | permissive | function strnatcmp(f_string1, f_string2, f_version) {
// discuss at: http://phpjs.org/functions/strnatcmp/
// original by: Martijn Wieringa
// improved by: Michael White (http://getsprink.com)
// improved by: Jack
// bugfixed by: Onno Marsman
// depends on: strcmp
// note: Added f_version argumen... | true |
178355dd1ab598aad863e53affd9539fc54189d9 | JavaScript | PhucVu97/FullStackOpen | /part1/src/App.js | UTF-8 | 6,615 | 3.203125 | 3 | [] | no_license | import React, { useState } from 'react'
const Header = (props) => {
return (
<h1>{props.course}</h1>
)
}
const Content = (props) => {
return (
<>
<Part part={props.parts[0].name} exercises={props.parts[0].exercises}></Part>
<Part part={props.parts[1].name} exercises={props.parts[1].exercises... | true |
87695d1839166e56aea95d3bd61bcabffce321d0 | JavaScript | Alturos/project_fennel | /server/client.js | UTF-8 | 2,523 | 2.5625 | 3 | [] | no_license | module.exports = (function (){
// Not a shared object!
var client = {
credential: undefined,
key_state: undefined,
connected: false,
setup: function (socket, connection_data){
this.connected = true;
this.key_state = Object.create(require('./key_state.js'));
this.socket = socket;
this.credential = ... | true |
ba9bab1bf521a2bc979abb238dc6f51433bfee17 | JavaScript | Keongy/todo-list | /src/App.jsx | UTF-8 | 2,430 | 2.640625 | 3 | [] | no_license | import React from 'react'
import { useState } from 'react'
import { TodoForm } from './App/Input'
import { Todo } from './App/TodoRow'
import { Modal } from "./App/ui/Modal";
import './App/css/App.css'
export function App() {
const [todos, setTodos] = useState([])
const [edit, setEdit] = useState(false)
c... | true |
2bf8beeedbc8ba0e5c146848fccf339707a28cbe | JavaScript | guokaigdg/React-Peiqi | /src/TodiList/TodoItem.js | UTF-8 | 936 | 2.625 | 3 | [] | no_license | import React, {Component} from 'react';
import PropTypes from 'prop-types';
class TodoItem extends Component{
static propTypes = {
content: PropTypes.string,
deleteItem: PropTypes.func,
index: PropTypes.number,
}
static defaultProps = {
content: 123,
}
constructo... | true |
885b3d3d388422d1bf60a073af1f7a528a4359a3 | JavaScript | Alheimsins/chess-steg-cli | /src/helpers.js | UTF-8 | 1,621 | 2.84375 | 3 | [
"MIT"
] | permissive | const axios = require('axios')
const { stringify } = require('querystring')
const isUrl = id => id.startsWith('http')
const extractId = url => url.split('/').pop()
// Post PGN to lichess.org/import and return lichess url
const getPgnUrl = async (pgn, flags) => {
const options = {
method: 'POST',
data: string... | true |
f6b0e7df371b3140a52cecf053779cd672dec155 | JavaScript | adnan116/NodeJS-Demo | /src/modules/users/services/user.service.js | UTF-8 | 4,580 | 2.578125 | 3 | [] | no_license | const db = require('../../../../db');
const { hashPassword } = require('../utils/bcrypt.utils');
async function uniqueCheckCreate(colName, value) {
try {
await db.query('BEGIN');
const queryText = 'select count(username) as flag from users where ' + colName + ' = $1';
//console.log(queryTex... | true |
0802bd5087f9277eca95514d3ea9699635f4cab2 | JavaScript | nickadjacent/csharp_demos | /BeltPrep/dateOVerlapChecker.js | UTF-8 | 2,153 | 3.765625 | 4 | [] | no_license | /*
In this example, a meetup is an object that represents
an event, like a group hike, which has a start and
end datetime.
Make a function that takes an array of meetups that
a user is signed up for and a new meetup that the user
is trying to sign up for. If the new meetup time doesn't
conflict with any... | true |
c63dd07ea0c99a3a689edf579e2a87e6eaf58c06 | JavaScript | Debjyoti-1999/internship | /services/password/generate_Password_proNotes.js | UTF-8 | 781 | 3.4375 | 3 | [] | no_license | /**
*
* @param {String} fname first name
* @param {String} lname last name
* @returns {String} password of a member
*/
function generate_Password(fname, lname) {
const user = {};
user.fname = fname.toLowerCase();
user.lname = lname.toLowerCase();
return getPassword(user);
} //generates password
const symb... | true |
25cb8a0a47a919c46ec306a8ee06fbf9b52f46c1 | JavaScript | LucasMarcialis/DEV | /JS/intro-javascript/chapitre_4/js/multiplication.js | UTF-8 | 268 | 3.78125 | 4 | [] | no_license | var nombre = 0;
while (!((nombre >= 2) && (nombre <=9))){
nombre = Number(prompt("Entrez un nombre entre 2 et 9 : "));
}
console.log("Voici la table de multiplication de " + nombre);
for(i=1;i<=10;i++) {
console.log(nombre + " x " + i + " = " + nombre*i);
} | true |
f608c5cfa237a795660a815493baf4c08dbed1fd | JavaScript | christroutner/nodemailer-service | /app.js | UTF-8 | 3,030 | 2.515625 | 3 | [] | no_license | 'use strict';
/*
* Express Dependencies
*/
var express = require('express');
var querystring = require("querystring");
var nodemailer = require('nodemailer');
var app = express();
var port = 3000;
/*
* Nodemailer setup variables
*/
var gmail_from = 'no.reply.mymailer@gmail.com';
var gmail_username = 'no.reply.my... | true |
82df4163b2d30c0e7f57493183bb94f08067e4ab | JavaScript | soatok/faq-off | /public/static/manage-author.js | UTF-8 | 2,187 | 2.703125 | 3 | [
"ISC"
] | permissive |
function entryPreview()
{
$.post('/manage/ajax/preview', {
"markdown": $("#author-bio").val()
}, function (res) {
if (res['status'] !== 'SUCCESS') {
console.log(res);
return;
}
$("#contents-preview").html(res['preview']);
});
}
function addContributo... | true |
00914cf49884d173e664b3d06ee97beeaf8c354c | JavaScript | LeeByungeGeol/UI-UX-stuby-JS | /73-keyboard-move.js | UTF-8 | 2,043 | 3.375 | 3 | [] | no_license | window.addEventListener("load", function () {
//code를 보여줄 input
var code = this.document.querySelector("#code");
//아이콘
var icon = this.document.querySelector(".map");
// icon.style.left="10px";
// icon.style.top="10px";
var xPos = 10;
var yPos = 0;
//console.log(xPos, yPos);
//스타일의 값을 ... | true |
90719d5eb65ee9e8415d08471ef0dc0bd6561494 | JavaScript | pglombardo/PasswordPusher | /app/javascript/controllers/copy_controller.js | UTF-8 | 1,167 | 2.5625 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
static targets = [
"payloadDiv",
]
static values = {
langCopied: String,
}
miniCopyToClipboard(event) {
if (this.hasPayloadDivTarget) {
navigator.clipboard.writeText(thi... | true |
83a9aab11a46607001a90c696a7c5f7086135eaf | JavaScript | maheshwaghmare/gutenberg | /blocks/api/query.js | UTF-8 | 1,227 | 2.5625 | 3 | [] | no_license | /**
* External dependencies
*/
import { nodeListToReact } from 'dom-react';
import { flow } from 'lodash';
import {
attr as originalAttr,
prop as originalProp,
html as originalHtml,
text as originalText,
query as originalQuery,
} from 'hpq';
/**
* Given a matcher function creator, returns a new function which ... | true |
54aca8a7f03c9b58a17b8fcf88ce28ff2a4b2cf5 | JavaScript | monique-caroline/loading-greensock- | /assets/js/loading.js | UTF-8 | 728 | 2.828125 | 3 | [] | no_license | //Criando a variavel que será animada
const loadingBalls = document.querySelectorAll('.js-loadingBall')
//Criando a animação com o objeto TweenMax, com função stagger que vai receber
//como primeiro parametro as bolas que vão ser animadas
//segundo parametro o tempo de cada animação
//terceiro - de que ponto vai começ... | true |
e92a8c2cb17a6db85d794807ae59af210f250be4 | JavaScript | corvinfor84/burger | /server.js | UTF-8 | 805 | 2.5625 | 3 | [] | no_license | var express = require("express");
var bodyParser = require("body-parser");
// Sets up the Express App
// =============================================================
var app = express();
var PORT = process.env.PORT || 8080;
// Sets up the Express app to handle data parsing
// parse application/x-www-form-urlencoded... | true |
61a4699641bcd253768ca3a9d7f21658fb7136d3 | JavaScript | airicyu/exchange-rate | /exchange-rate-back-server/src/QueryLatestDataHandlerProcess.js | UTF-8 | 2,153 | 2.671875 | 3 | [
"MIT"
] | permissive | 'use strict';
/**
* Query latest exchange rate data process
*
* TODO checking subscription queue interval is minimum 1 second (hardcoded). Should make it configuable.
*
* @class QueryLatestDataHandlerProcess
*/
class QueryLatestDataHandlerProcess {
/**
*Creates an instance of QueryLatestDa... | true |
0dc564ac5004d25fd882e0ec91f6f80dcfe554fa | JavaScript | Magestak/avis-restaurants | /js/comments.js | UTF-8 | 2,199 | 3.390625 | 3 | [] | no_license | class Comment {
constructor(name, rating, comment, resultats) {
this.name = name;
this.rating = rating;
this.comment = comment;
this.resultats = resultats;
}
/**
* Insère le contenu du commentaire lors du chargement des fichiers Json
* @return { object } le contenu... | true |
06b5c21fa3c1f7eb19c1399a927171d4b3d87745 | JavaScript | lacolegiala/full-stack-course | /part2/countryinfo/src/App.js | UTF-8 | 4,035 | 2.890625 | 3 | [] | no_license | import React, {useState, useEffect} from 'react';
import './App.css';
import axios from 'axios';
const Filter = (props) => {
return (
<div>
find countries
<input
value={props.filteringString}
onChange={props.handleFilter}
/>
</div>
)
}
const CountryList = (props) => {
r... | true |
65b8244c624ea95c5c6fbc7ab6a8813eac08e8cb | JavaScript | YuArtian/demo | /设计模式/promise.js | UTF-8 | 2,942 | 3.390625 | 3 | [] | no_license |
const PENDING = 'pending'
const FULFILLED = 'fulfilled'
const REJECTED = 'rejected'
function Promise (executor) {
if(typeof executor !== 'function') return
let self = this
self.status = PENDING
self.onFullfilledList = []
self.onRejectedList = []
function reslove (value) {
if (self.status === PENDING) ... | true |
6bf6399eb5c9f5dde3a3c921d16fd9b09c101264 | JavaScript | eigenmethod/eigenmethod-website | /eigenmethod_website/js/sliders.js | UTF-8 | 1,985 | 2.625 | 3 | [] | no_license | $(document).ready(function() {
var productSlider = function() {
var slideTimer;
var hwTimeOut = 5000;
var index = 0;
var slide = function () {
index = index < 3 ? index + 1 : 0;
animSlide(index);
slideTimer = setTimeout(slide, hwTimeOut);
... | true |
6ddec552867a944149c771deed48a1f2ccdfffaa | JavaScript | pharazin/weiqi-game | /go.js | UTF-8 | 39,709 | 2.78125 | 3 | [] | no_license | var CONFIG = { nick: '#',
id: null};
var DOMBoard = function(size){
this.size = size;
var ROWS = COLUMNS = this.size;
var LM = 40; //LEFT_MARGIN
var TM = 20; //TEXT_MARGIN
var LS = 30; //LINE_SEPARATION
var BS = LS*(this.size-1) + LM*2; //BOARD_SIZE
this.DOMPositions =... | true |
84f0adc082631686088d71e0bb48e9e899b3e9a4 | JavaScript | marioscience/car-auction-project | /src/components/carAuction/carAuction.js | UTF-8 | 2,852 | 2.734375 | 3 | [] | no_license | import React from 'react';
import CarListing from './carlisting/carListing';
import './carAuction.css';
const serviceUrl = "http://s3-sa-east-1.amazonaws.com/config.instacarro.com/recruitment/auctions.json";
class CarAuction extends React.Component {
constructor(props) {
super(props);
this.state ... | true |
c55bf48e3b70ca6bcd06252cd17a3295988121b4 | JavaScript | ihororlovskyi/yehorpopov-admin | /src/store/features/index.js | UTF-8 | 3,358 | 2.625 | 3 | [] | permissive | import * as firebase from 'firebase'
export default {
state: {
loadedFeatures: []
},
mutations: {
setLoadedFeatures (state, payload) {
state.loadedFeatures = payload
},
createFeature (state, payload) {
state.loadedFeatures.push(payload)
},
updateFeature (state, payload) {
... | true |
7daf8729035c836d3279133771970af8cfc97cfd | JavaScript | akanekwon172/intro-curriculum-4018 | /test/test.js | UTF-8 | 2,527 | 2.515625 | 3 | [] | no_license | 'use strict';
const request = require('supertest');
const app = require('../app');
const passportStub = require('passport-stub');
const User = require('../models/user');
const Schedule = require('../models/schedule');
const Candidate = require('../models/candidate');
// テスト開始前
const setUp = () => {
passportStub.inst... | true |
b0866bab1e42a2cd6e36a6cde3ab0fefa839f161 | JavaScript | freddy38510/FreddyEscobar_7_25012021_backend | /src/services/post.service.js | UTF-8 | 3,233 | 2.53125 | 3 | [] | no_license | const { Post } = require('../models');
/**
* Create a post
* @param {Object} postBody
* @param {ObjectId} userId
* @returns {Promise<Post>}
*/
const createPost = async (user, postBody) => Post
.query()
.authorize(user)
.insert({
...postBody,
user_id: user.id,
});
/**
* Query for posts
* @returns... | true |
507ebd7661ba73f71f6b4d8f1f0d80c984923393 | JavaScript | Anur13/goit-js-hw-07 | /js/task2.js | UTF-8 | 521 | 3.3125 | 3 | [] | no_license | const ingredients = ["Картошка", "Грибы", "Чеснок", "Помидоры", "Зелень", "Приправы"]
const makeListItem = (arr) => {
const listItemArr = []
const ingredientsList = document.querySelector("#ingredients")
arr.forEach((item) => {
const listItem = document.createElement(`li`)
listItem.textCont... | true |
52df13a00bb23a1ad5405334acff906e8bdcd9f8 | JavaScript | brampauwelyn/webdesigner-courses | /17. Jquery exercises pt.7 (christmas word game)/js/app.js | UTF-8 | 1,130 | 3.640625 | 4 | [] | no_license | var wordList = ["rendier"];
var splittedWord = wordList[0].split('');
var score = 0;
var guessedCharacters = 0;
function startGame(){
$('.word-placeholder').empty();
for(var i = 0; i < splittedWord.length; i++){
$('.word-placeholder').append('<div id="character'+i+'" class="character"></div>');
$('.word-pl... | true |
fffa4b284ea800a80c681a3c03d808ad2003a1e2 | JavaScript | Josuehernandez96/SICMEFAM | /vistas/assets/js/consulta.js | UTF-8 | 4,380 | 2.53125 | 3 | [
"MIT"
] | permissive | var i = 0;
var arraymedicamentos = [];
var arrayes = [];
var dir = document.getElementsByName("dir").value;
function cerrarmodal(){
document.getElementById("formulario_consulta").reset();
$('#modal-table').modal('hide');
}
function soloNumeros(e)
{
var keynum = window.event ? window.event.keyCode : e.which;
if (... | true |
9317e7ec9d1f4e2dcff3a259ec093255ae14f53e | JavaScript | JamesWebDev/JamesWebDev | /Example-Node-Website/AngularGenerator.js | UTF-8 | 1,989 | 3.125 | 3 | [] | no_license |
const os = require("os");
const path = require('path');
const glob = require('glob'); //https://github.com/isaacs/node-glob
const fs = require('fs-extra'); //https://github.com/jprichardson/node-fs-extra
const readlineSync = require('readline-sync'); //https://github.com/anseki/readline-sync
const changeCase = require... | true |
3eea55ca0dab8218a1689161c41c94d5692d439f | JavaScript | mslansky/GBBSQuizApp | /app.js | UTF-8 | 7,634 | 3.203125 | 3 | [] | no_license | /* eslint-disable strict */
/**
* Example store structure
*/
const store = {
// 5 or more questions are required
questions: [{
question: 'What is the name of The Great British Baking Show in England?',
answers: ['The Great English Baking Show', 'The Great British Bake Off', 'Greatest British Bake Off Show... | true |
b7e06d4d36381629aa843c63da0908f1126c3578 | JavaScript | donniereese/LS8-16 | /parser/token.js | UTF-8 | 484 | 2.625 | 3 | [] | no_license | import Lexer from "./lexer";
class TokenData {
constructor() {
this.value;
this.id;
this.line;
this.column;
this.length;
}
}
class Token extends TokenData {
constructor(params = new TokenData(), ctx = new Lexer.Lexer()) {
this.lexer = ctx;
this.set(params, false);
}
se... | true |
93de54800eb236639700ce1969e5f0cde4b878a3 | JavaScript | egunn/Design-Concept-Map | /D3-Force-Layout/script/script.js | UTF-8 | 10,137 | 3.03125 | 3 | [] | no_license | //This example shows how nodes and links can be represented differently
var margin = {t:100,l:100,b:100,r:100},
width = document.getElementById('plot').clientWidth-margin.l-margin.r,
height = document.getElementById('plot').clientHeight-margin.t-margin.b;
var svg = d3.select('.canvas')
.append('svg')
... | true |
da9cd79c45cf3d01555d0b19404ec024677a023c | JavaScript | cupsadarius/classroom | /web/src/js/app/components/home/ClassroomsTable.jsx | UTF-8 | 1,996 | 2.578125 | 3 | [] | no_license | /* @flow */
import BaseComponent, {React} from '../BaseComponent.jsx';
import Classroom from '../../models/Classroom.js';
import dateFormatter from '../../helpers/DateFormatter.js';
type ClassroomsTableProps = {
classrooms: Classroom[]
};
export default class ClassroomsTable extends BaseComponent {
props: Classr... | true |
3d8516abbb417f70468c6cc227a404b9ac9f0173 | JavaScript | omarmjhd/project-marketplace | /web-pages/common/scripts/accordion_witharrows.js | UTF-8 | 2,103 | 2.546875 | 3 | [
"MIT"
] | permissive | /*
* jQuery Javascript for Lean+ accordian menus
*/
/* Modified EAG 09.09.11
Documentation of code created to let more than one accordion appear on the page at one time.
Change the id of your accordion DIV to the new name:
From => <div id="accordion">
To => <div id="accordion2">
Then add the example code... | true |
2a105dd0f4befb35d025d1baefb73df40d9f4633 | JavaScript | AguNnamdi/real-time-image-tracking | /src/appContext.js | UTF-8 | 719 | 2.5625 | 3 | [] | no_license | import React from "react"
const AppContext = React.createContext()
class ContextProviderComponent extends React.Component {
state = {
categories: ['Animal'],
}
updateCategories = categories => {
let categoryArray = categories.split(',')
categoryArray = categoryArray.map(c => c.trim())
this.setSt... | true |
7d15e13042fb113c04dd9fa7cdbb1a486c34880e | JavaScript | janpc/callbacks-intro-pill | /src/04-exercise.js | UTF-8 | 244 | 3.1875 | 3 | [] | no_license | /**
* Execute a setTimeout function after 1000ms that executes any code
*
* For example: console.log("hello");
*/
function exercise04() {
// Complete the code of the function
setTimeout(function(){},1000);
}
export default exercise04;
| true |
d9b7e467d06fc94553c525edfbaac05d9318f816 | JavaScript | dvsa/front-end | /src/assets/js/dvsa-mts/modules/check-all/check-all.js | UTF-8 | 2,821 | 3.125 | 3 | [
"MIT"
] | permissive | import { addEventListenerToEl } from '../../../shared/misc';
import { CHECK_ALL_CONFIG } from './index';
export class CheckAll {
constructor(wrapper) {
// If DOM Element does not exist, exit
if (!wrapper) return;
let checkboxNodes = wrapper.querySelectorAll('input');
let checkboxes = [...checkboxNod... | true |
95c33254c48b3497de49d15f096e4d592576d8d8 | JavaScript | MaJun001/-q | /src/view/home.js | UTF-8 | 2,046 | 2.5625 | 3 | [] | no_license |
import React, { Component } from 'react';
import axios from 'axios'
export class Home extends Component {
constructor(){
super()
this.state = {
navList:[
{'name':'综合'},
{'name':'销量'},
{'name':'品牌'},
{'name':'筛选'}
... | true |
fd6d1f027b07e639c8bf80e151dc7e692efc5b6a | JavaScript | Bensi5/Hand-gesture-app | /main.js | UTF-8 | 1,683 | 2.703125 | 3 | [] | no_license | Webcam.set({
width: 350,
height: 300,
image_format: 'png',
png_qulaity: 90
});
camera = document.getElementById("camera");
Webcam.attach('#camera');
Prediction1 = "";
function take_snapshot() {
Webcam.snap(function (data_uri) {
document.getElementById("result").innerHTML = "<img... | true |
e66346f566553ed2c2e53343152eb50f91653f35 | JavaScript | jonkim204/portfolio | /src/components/projects.js | UTF-8 | 4,447 | 2.578125 | 3 | [] | no_license | import React from 'react';
import './projects.css';
import EventProjectPage from './eventProjectPage';
import LearnProject from './learnproject';
import ShaveProject from './shaveproject';
const eventImg = require("../assets/img/event.png");
const learnImg = require("../assets/img/ilearnhome.png");
const shaveImg = re... | true |
1b7518f70bdd4aad779b758f6f641975f8a1ffd1 | JavaScript | cafort/exercises | /Assignment2/js/dateformatting.js | UTF-8 | 2,518 | 3.828125 | 4 | [] | no_license | var dateFormatter = {
//Arrays to call for English months and days of the week
months: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"
],... | true |
b4356141d2a711da681093098082da77285718ca | JavaScript | MedulHasan/tourism-website-client-side | /src/Pages/Admin/AllUserBooking/AllUserBooking.js | UTF-8 | 6,192 | 2.578125 | 3 | [] | no_license | import React, { useEffect, useState } from 'react';
import { Button, Spinner } from 'react-bootstrap';
import swal from 'sweetalert';
import useAuth from '../../../hooks/useAuth';
import './AllUserBooking.css';
const AllUserBooking = () => {
const { user } = useAuth();
const [myBooking, setMyBooking] = useStat... | true |
064d38abc2a66440d943267720ae83026ce66933 | JavaScript | houmingc/graphql-crash-course | /server.js | UTF-8 | 4,009 | 2.609375 | 3 | [] | no_license | const express = require("express");
const { graphqlHTTP } = require("express-graphql");
const app = express();
const {
GraphQLSchema,
GraphQLObjectType,
GraphQLString,
GraphQLInt,
GraphQLList,
GraphQLNonNull,
} = require("graphql");
const owners = [
{ id: 1, name: "John" },
{ id: 2, name:... | true |
17d8bd08e20791666bef1b94c30169de7c52a4bc | JavaScript | wmenge/droidquest | /src/public/js/game/demo-5.js | UTF-8 | 1,152 | 3 | 3 | [] | no_license | class DemoRoom5 extends Room {
init() {
super.init();
this.tower = new Prop()
.setPosition({ x: 230, y: 120 });
}
onEnter() {
super.onEnter();
this.text = new Text("Tech demo 5: Text and buttons that can be positioned on pixels")
.setPosition({ x: 10, y: 5 })
//.setDimensions({ width: 320, he... | true |
ff5baa26614b0e3ffc2d2bd2851894b968bae85d | JavaScript | Gonda92/node_data_base | /models/products.model.js | UTF-8 | 783 | 2.546875 | 3 | [] | no_license | //Sequelize en mayuscula va significa el modulo Sequilize
const Sequelize = require("sequelize");
//Sequelize en minuscula va significa la configuracion que hicimos para la conexion con el servicio que estamos trabajando Elephent SQL (con la tecnologia de Postgres)
const { sequelize } = require("../database/database");... | true |
f17c9301cb2c93632600f7981090e8d83261d4ac | JavaScript | AnarAgaev/Ekranica | /src/pug/comps/callback/callback.js | UTF-8 | 3,141 | 2.515625 | 3 | [
"MIT"
] | permissive | import $ from "jquery";
import IMask from 'imask';
$(document).ready(function () {
// It's the handler for the phone value at the callback form
const callbackPhone = document.getElementById('callbackPhone');
const callbackPhoneController = $('#callbackPhone').closest('.controller');
const call... | true |
9c21f142594c30f7994cae918c9af7d2d2cfc0c6 | JavaScript | yansyr/Curso-JS-Moderno | /03-Strings/js/05-app.js | UTF-8 | 224 | 3.109375 | 3 | [] | no_license | const producto = "Monitor de 24 pulgadas"
console.log(producto.replace('pulgadas','"'))
console.log(producto.slice(0, 10))
console.log(producto.substring(2,1))
const usuario = "Juan";
console.log(usuario.charAt(0)); | true |
4439a4f7cf7b5b06d4d01d61d7b41a348faf3e9b | JavaScript | Wekios/employee-scheduler | /src/lib/mock-data.js | UTF-8 | 1,677 | 2.546875 | 3 | [] | no_license | import faker from "faker";
export const positions = [
{
id: 1,
name: "cook",
color: "blue",
},
{
id: 2,
name: "host",
color: "red",
},
{
id: 3,
name: "waiter",
color: "yellow",
},
{
id: 4,
name: "bartender",
color: "orange",
},
];
export const employees ... | true |
b8e89bb108eb7ba7bedb421e6a613fbd15dac192 | JavaScript | Alexandr199837/Canvas | /canvas/js.js | UTF-8 | 2,571 | 3.46875 | 3 | [] | no_license | var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
var mas = [];
var count = 0;
var timer;
canvas.onclick = function(event) {
var x = event.offsetX; //координаты мыши, относительно canvas
var y = event.offsetY;
console.log(x);
console.log(y);
x=Math.floor(x/10); //300/10=3... | true |
51fdfa1ac76b558aef3bd35897d6887c0f48b001 | JavaScript | coderbyheart/aout3-samples | /ch5/calculate-with-log.js | UTF-8 | 141 | 2.5625 | 3 | [
"MIT"
] | permissive | const calculate = (x, y, logger) => {
const result = x+y;
logger(result);
return result;
};
module.exports = {
calculate
};
| true |
9212562e8ca0964526e6cc0220fcbb0f3b65d142 | JavaScript | Rey810/rey810.github.io | /lib/scripts/logo_contact_Control.js | UTF-8 | 285 | 2.578125 | 3 | [] | no_license | const contact = document.querySelector('.menuButton');
const footerContact = document.getElementsByName('footer');
function scrollToFooter() {
footerContact.scrollIntoView(true);
}
logo.addEventListener('click', scrollToIntro);
contact.addEventListener('click', scrollToFooter);
| true |
1f61f6424fd53701957eac1aadf1f2c4a8ce0b72 | JavaScript | murbar/code-challenges | /misc/operators.js | UTF-8 | 2,570 | 4.0625 | 4 | [] | no_license | /*
Implement four functions called multiply, divide, modulo, and negCheck. The first three functions should multiply, divide, or return the remainder of two arguments after invoking negCheck upon the two numbers.
Now for the tricky part: you can only use + and - to implement these functions.
Do not use the JavaScript... | true |
fce707b040deb4efc4e80cc88e1dd38fe4e44f0b | JavaScript | CallMeSaltyF1sh/jsCodingExercises | /leetcode/每日打卡/2020-03-10-二叉树的直径.js | UTF-8 | 763 | 3.515625 | 4 | [] | no_license | /**
* Problem desc:
* 给定一棵二叉树,你需要计算它的直径长度。一棵二叉树的直径长度是任意两个结点路径长度中的最大值。这条路径可能穿过根结点。
*/
/**
* Definition for a binary tree node.
* function TreeNode(val) {
* this.val = val;
* this.left = this.right = null;
* }
*/
/**
* @param {TreeNode} root
* @return {number}
*/
var diameterOfBinaryTree = function (... | true |
fcfb287819621119e2c2a8a2a7453c1a8df36984 | JavaScript | farahdian/dear-michael | /script.js | UTF-8 | 3,705 | 2.953125 | 3 | [] | no_license | const baseUrl = "https://poetrydb.org"
const poemDiv = document.getElementById('poem-holder')
let defaultMsg = 'For the times you find yourself feeling too much or not enough. I hope you find some solace and resonance in these poems.'
var msgArray =["You're up early, I hope that means you're looking forward to today.<i... | true |
51e3839d1bd165f123de5f2ab4399f3492d4c0a5 | JavaScript | NikosKourb/BootCamp-7th-Week | /WebContent/PropertyEnumerationExample.js | UTF-8 | 291 | 2.5625 | 3 | [] | no_license | /**
*
*/
function listAllProperties(o) {
var objectToInspect;
var result;
for(objectToInspect=o;objectToInspect!==nul;
objectToInspect=Object.getProtypeOf(objectToInspect)) {
result=result.concat(Pbject.getOwnPropertyNames(objectToInspect));
}
return result;
} | true |
6d6e98cbaf45c41655e5c2c4fa59ba1ff88f72ba | JavaScript | dimemp/fortuneplace | /js/custom.js | UTF-8 | 3,947 | 2.71875 | 3 | [] | no_license | $(function() {
var lat = "";
var lng = "";
var appendeddatahtml = "";
var arguments = "";
var str = "";
var newstr = "";
var phone = "";
var rating = "";
var icon = "";
var address = "";
var arraylength = "";
var randomnum = "";
var random = "";
$("#query-input").click(function(){
$(this).va... | true |
24685fb288f6a8d661eab7d329941c6f5c3adb48 | JavaScript | AHVARA/creatingVelocityAndObjects | /code.js | UTF-8 | 2,523 | 2.578125 | 3 | [] | no_license | var p5Inst = new p5(null, 'sketch');
window.preload = function () {
initMobileControls(p5Inst);
p5Inst._predefinedSpriteAnimations = {};
p5Inst._pauseSpriteAnimationsByDefault = false;
var animationListJSON = {"orderedKeys":[],"propsByKey":{}};
var orderedKeys = animationListJSON.orderedKeys;
var allAnima... | true |
37cdc1e06d5fe9832cb691090700b9fae6243054 | JavaScript | Teresa0312/Wechat-applet-jietiyuanyin | /pages/apply/apply.js | UTF-8 | 8,484 | 2.6875 | 3 | [] | no_license | var app = getApp()
var ansSet ={}
Page({
data: {
start:0,
userInfo:"",
num:1,
company:"",
end_time:"",
problemSet: {},
ansSet:{},
time:1,//0 答题时间结束 1未结束
countDownDay: 0,
countDownHour: 0,
countDownMinute: 0,
countDownSecond: 0,
showModal: true,
sdate:"请... | true |
42a6670f9c45f9b9cba0115ae92f77868846d54b | JavaScript | rachapathin/nodejs-program-tasks | /modules/dirwatcher.js | UTF-8 | 1,518 | 2.90625 | 3 | [] | no_license | import EventEmitter from 'events';
import fs from 'fs';
export default class DirWatcher extends EventEmitter {
constructor() {
super();
this.filesCurrentStatus = {};
this.filesmodifiedStatus = {};
}
watchPath(path, delay) {
this.timer = setInterval(() => {
this.... | true |
945ca451373b31aa98fbf9730c894eb632a7ed8d | JavaScript | iancugeorge/devconnect | /client/src/utils/Interval.js | UTF-8 | 209 | 3.015625 | 3 | [] | no_license | // Clasa Interval (calculaza valoarea random intre un min si un max)
class Interval {
static getValue(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
}
export default Interval; | true |
abfa6ab1858ee61ce7de4ea40b35d5f075983963 | JavaScript | nguyentruongsinh0311/ngminhtrung.github.io | /projects/learning/d3/vietnam/groupedbar/plot.js | UTF-8 | 7,371 | 2.765625 | 3 | [
"MIT"
] | permissive | var w = 900;
var h = 600;
margin = {top: 120, right: 100, bottom: 250, left: 100},
width = w - margin.left - margin.right,
height = h - margin.top - margin.bottom,
// set scale for (super) Groups
x0 = d3.scaleBand()
.rangeRound([0, width]) // tương tự như range, nhưng sẽ trả về nearest integer
.paddi... | true |
de15e66b423ef41fcb859d3ad3be6b995d67a1fe | JavaScript | MustafaZaidi23/AquaponicsIoT | /framework/console.js | UTF-8 | 2,103 | 2.703125 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | var _console = undefined;
define([
"util"
], function(util) {
'use strict';
var exports = _console = {};
var Console = exports.Console = class Console {
constructor(dom_id, pos, size, bufsize) {
this.dom_id = dom_id;
this.dom = undefined;
this.pos = pos !== undefined ? pos : [50, 50];
... | true |
923cb7ef0c41779eaf09bb0908548a6e09cfb14d | JavaScript | crowandrew/employee_tracker | /lib/viewAllEmployeesByDepartment.js | UTF-8 | 2,085 | 3.203125 | 3 | [
"MIT"
] | permissive | // Dependencies
// ===========================================================
const inquirer = require("inquirer");
require("console.table");
// Connection to MySql server
// ===========================================================
const connection = require("../data/connection");
// This creates a table view of ... | true |
0871d69eb2c2513a33ffb55771310661d64083ab | JavaScript | ericbq/iprog | /lab5/app/js/dinnerService.js | UTF-8 | 4,455 | 2.796875 | 3 | [] | no_license | // Here we create an Angular service that we will use for our
// model. In your controllers (or other services) you can include the
// dependency on any service you need. Angular will insure that the
// service is created first time it is needed and then just reuse it
// the next time.
dinnerPlannerApp.factory('Dinner'... | true |
9438a4f28e0a2c0ebc5dc0d0ccae39648a231a8a | JavaScript | BrunodePaula/doceria-freitas | /backend/src/app/controllers/StockController.js | UTF-8 | 820 | 2.5625 | 3 | [] | no_license | import Stock from '../models/Stock';
class StockController {
async store(req, res) {
const stockExists = await Stock.findOne({
where: { product_id: req.body.product_id },
});
if (stockExists) {
return res.status(400).json({ error: 'stock already exists' });
}
const { id, name } = aw... | true |
4bf6d07f5d6fe45579d323c4f30a68bbd1593a8c | JavaScript | sefiroed/ejemplos | /clase13/01-chatroom/public/js/main.js | UTF-8 | 2,012 | 3.421875 | 3 | [] | no_license | const chatForm = document.getElementById('chat-form');
const chatMessages = document.querySelector('.chat-messages');
const msg = document.getElementById('msg');
const roomName = document.getElementById('room-name');
const usersList = document.getElementById('users');
//GET Username & Room from url using qs CDN (https:... | true |
88cf80f82eeca5d431e82fb568ab44cd35dc4e88 | JavaScript | Siddhil-Rathod/js-Assignment | /Assignment21.js | UTF-8 | 194 | 3.796875 | 4 | [] | no_license | let num = prompt("Enter a positive number")
let arr=[];
for(let i=0;i<=num;i++)
arr[i]=i;
arr = arr.filter((ele)=>{return ele%2==1;}).map((ele)=>{return ele**3;})
console.log(arr) | true |
ea3a7e290c08f4304036841cbfb002285086cc7f | JavaScript | eHealth4everyone/ng2-assignment1 | /akunna/node_server/server.js | UTF-8 | 2,059 | 2.5625 | 3 | [] | no_license | var http = require('http');
var formidable = require("formidable");
var util = require('util');
var mysql = require('mysql');
var connection = mysql.createConnection(
{
host : 'localhost',
user : 'root',
password : '',
database : 'dorcas'
} );
connection.connect(function(er... | true |
35d78aa2738bb2d49e8e26b16fbb2e762d3a4637 | JavaScript | DebAmorim/js_funcional_reativo | /funções/promise_1.js | UTF-8 | 1,497 | 4.625 | 5 | [] | no_license | // declaração da promessa
// A promise recebe como parâmetro uma função que será chamada quando quisermos
// cumprir a promessa. Quando a promise é cumprida temos a criação de um novo objeto.
// Neste momento temos apenas o objeto e não o seu valor.
// let objeto = new Promise(funcaoArgumento(funcaoChamadaAoCumprirPro... | true |
2b79eb6a5a1e3ce7063e2b781d3f55638ad98b1b | JavaScript | PINKPHANTOMS/Black_Hole | /demo.js | UTF-8 | 265 | 3.546875 | 4 | [] | no_license |
function setup() {
createCanvas(800, 600)
let names = ["brian", "quinn", "jesse"]
let i = 0
while (i < names.length) {
print(names[i])
i = i + 1
}
for (let i=0; i < names.length; i++) {
print(names[i])
}
} | true |
3c46ecf2df6e965c3f932910b9645a35235deda8 | JavaScript | zlqGitHub/HTML-CSS-JS | /JS框架/utils.js | UTF-8 | 1,867 | 3.34375 | 3 | [] | no_license | // 整理之前封装的功能函数................................
function loading(Obj) {
//记录下载的个数
var n = 0;
//缓存所有图片
Obj.imgArray.forEach(function(value, index) {
//创建吐图片对象
var imgObj = new Image();
//指定地址开始缓存
imgObj.src = value;
//监听缓存过程
imgObj.onload = function() {
n++;
//下载进度
//progress.value = n / imgArray... | true |
b066d471926d4d4ec3f1ce9452dd82b8b5149d67 | JavaScript | guimarc/hackagui2 | /app.js | UTF-8 | 3,070 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive |
var https = require('https');
var express = require('express');
var fs = require('fs');
// cfenv provides access to your Cloud Foundry environment
// for more info, see: https://www.npmjs.com/package/cfenv
var cfenv = require('cfenv');
// create a new express server
var app = express();
// serve the files out of ./... | true |
860756f2873ceb68dc7709966d8498d1fdfca125 | JavaScript | austinStan/geomik-website | /wp-content/plugins/envira-gallery/assets/js/conditions.js | UTF-8 | 4,194 | 2.75 | 3 | [] | no_license | /**
* jQuery Conditions 1.0.0
*
* Copyright 2016 Envira Gallery Team
*
* @license Released under the MIT license.
* http://jquery.org/license
*/
(function($) {
'use strict';
$.fn.conditions = function(conditions) {
return this.each(function(index, element) {
var CJS = new ConditionsJS(
element,
c... | true |
daa9799b534fc1283aae2cd2eba1f397c5c35b7e | JavaScript | iamramkey/works | /jsAlgorithms/.history/diff-2-num-arrays_20180821213850.js | UTF-8 | 557 | 3.453125 | 3 | [] | no_license | function diffArraysBaisc(first, second) {
var diffArr = [];
pushDiffFromFirstArray(first, second, diffArr);
pushDiffFromFirstArray(second, first, diffArr);
return diffArr;
}
function diffArrays(first,second){
return first.concat(second).filter(i => !first.includes(i) || !second.includes(i));
}
function pu... | true |
dcba71dcd4f887f812602ccdb9c8452bbf25c7a8 | JavaScript | nilproject/NiL.JS | /TestSets/tests/sputnik/ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js | UTF-8 | 533 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | /// Copyright (c) 2012 Ecma International. All rights reserved.
/**
* @path ch15/15.4/15.4.4/15.4.4.22/15.4.4.22-9-c-ii-4-s.js
* @description Array.prototype.reduceRight - undefined passed as thisValue to strict callbackfn
* @onlyStrict
*/
function testcase() {
var innerThisCorrect = false;
function callba... | true |
a353933b340cfb2f00ba84f932d25260e5f75970 | JavaScript | beeceej/Word_Guess_Game | /assets/javascript/javascript.js | UTF-8 | 2,801 | 3.765625 | 4 | [] | no_license |
// create an array of word options (just strings no spaces)
const wordBank = [
"ronaldo", "pogba", "salah", "griezmann", "messi"
];
const images = [
"<img src= "
];
// Create global variables
var wordIndex = "";
var lettersInWordBank = [];
var numBlanks = 0;
var blanksAndSuccesses = [];
var wrongGuesses = []... | true |
64e4ccf3456621ef9d20bce05ff189ccc6ce166b | JavaScript | kephin/LeetCode | /264_Ugly_Number_II.js | UTF-8 | 2,051 | 4.28125 | 4 | [] | no_license | /*
264. Ugly Number II
Write a program to find the n-th ugly number.
Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.
For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the first 10 ugly numbers.
Note that 1 is typically treated as an ugly number, and n does not exceed 1690.
*/... | true |
6515287bdc2b10fd22fbb463e7f9391f198186c5 | JavaScript | monicajaimesc/holbertonschool-higher_level_programming | /0x12-javascript-warm_up/1-multi_languages.js | UTF-8 | 99 | 2.671875 | 3 | [] | no_license | #!/usr/bin/node
const text = 'C is fun\nPython is cool\nJavascript is amazing';
console.log(text);
| true |
172aefdaa04f3b2c385838ab91765e71108dbf00 | JavaScript | shafayet1372/Javascript-Array-Methods-Created-By-Myself | /push.js | UTF-8 | 185 | 3.03125 | 3 | [] | no_license | let fruits = ["Banana", "Orange", "Apple", "Mango"];
function myPush(arr,value){
arr[arr.length]=value
}
myPush(fruits,"sdsds")
myPush(fruits,"dfdf")
console.log(fruits)
| true |
bbd4ee76246d48462697c9a9bc95c4781b0aed34 | JavaScript | HemaPonraj05/react_training | /ReactJS_Training-Material/17_ReactJS/120_Events/Code/reactapp2/src/App.js | UTF-8 | 1,463 | 2.90625 | 3 | [] | no_license | import React from 'react';
class Parent extends React.Component {
concatName(e) {
alert(e);
}
render() {
return (
<div><Child clickhandler={this.concatName} /></div>
);
}
}
class Child extends React.Component {
constructor(props) {
super(props);
this.state = {
title: 'Hello... | true |
4fd1f391b00affadd41cc89e92546ed99ff15f36 | JavaScript | luizrjunior/ouvidoria-fipecq | /public/js/componentes.js | UTF-8 | 3,100 | 2.5625 | 3 | [] | no_license | var Componentes = {
globalElementId: null,
modalAlerta : function (mensagem, funcao) {
$('#modalAlerta').modal('show');
$('#conteudoModalAlerta').html(' ' + mensagem + '<br />');
$('#modalAlerta #btnOk').off('click');
$('#modalAlerta #btnOk').on('clic... | true |
660b48db2b73b24706f7bd0578732bad3d5107ef | JavaScript | yoshihirohakuno/react03 | /react-hooks-101/src/components/EventForm.js | UTF-8 | 1,522 | 2.84375 | 3 | [] | no_license | import React,{ useState} from 'react'
import {
CREATE_EVENT,
DELETE_ALL_EVENTS
} from '../actions'
const EventForm = ({state,dispatch}) => {
const [title,setTitle] = useState('')
const [body,setBody] = useState('')
const addEvent = e => {
e.preventDefault()
dispatch({
type:CR... | true |
f827434f834d6d5909325c70c82ef57c265cfbc1 | JavaScript | ahrjarrett/code_challenges | /codewars/javascript/extract_file_name.js | UTF-8 | 338 | 2.9375 | 3 | [] | no_license | // Source : https://www.codewars.com/kata/extract-file-name/train/javascript
// Author : Andrew Jarrett
// Date : 2018-09-30
class FileNameExtractor {
static extractFileName (filename) {
let [ prefix, ext ] = filename.split('.')
prefix = prefix.split('_').slice(1).join('_')
return prefix.... | true |
960fd06a540250708f8e441dde6708108c1cb78a | JavaScript | bilasyurii/anagenetic | /src/ui/genome/gene-item.js | UTF-8 | 999 | 2.59375 | 3 | [
"MIT"
] | permissive | import Observable from '../../anvas/events/observable';
import UIElement from '../core/ui-element';
export default class GeneItem extends UIElement {
constructor(factory, dom) {
super(factory, dom);
this.onClick = new Observable();
this.index = 0;
this._gene = null;
this._state = GeneItem.Stat... | true |
1660e3c9ffbb5cefcca58fe70014616681beba1f | JavaScript | amykangweb/show_me_the_cookies | /app/assets/javascripts/cookies.js | UTF-8 | 252 | 2.546875 | 3 | [] | no_license | $(document).ready(function() {
document.cookie = "Cat=Meow"
$('.steal_cookie').on("click", this, function(e) {
e.preventDefault();
$.post("/cookies", { cookies: document.cookie }, function(data) {
$('.result').html("Stolen!");
});
});
}); | true |
23f01b13d6fc144c2ba094a6e308b8e18ea96a2e | JavaScript | mondalsubhadip212/mondalsubhadip212.github.io | /Js/main.js | UTF-8 | 2,830 | 2.5625 | 3 | [] | no_license | $(document).ready(function () {
$('#top_card_button').on('click', function click() {
getdata()
})
function getdata() {
const dfd = $.ajax({
url: 'https://formcr.herokuapp.com/form/',
type: 'GET',
dataType: 'json',
})
dfd.done(function (d... | true |
fb4a8d37779e308a74b39e513e8ae7f44bdd1559 | JavaScript | uuki/fontagon | /packages/fontagon/renderer/render-style.js | UTF-8 | 2,709 | 2.671875 | 3 | [
"MIT"
] | permissive | /**
* Render as style sheet
*/
const fs = require('fs')
const crypto = require('crypto')
const handlebars = require('handlebars')
const urlJoin = require('url-join')
const _ = require('lodash')
const { logger, logColor } = require('../utils/logger')
/**
* creating hash
*
* @param options
* @returns {string}
*... | true |
fffda22023168e4a5611b26828cb4f5a57431657 | JavaScript | quark-renderer/quark-renderer-wechat-examples | /pages/demo-5/demo-5.js | UTF-8 | 1,920 | 2.53125 | 3 | [] | no_license | //这里使用 Node 模块的方式引入 Quark Renderer
let QuarkRenderer=require("quark-renderer");
console.log(QuarkRenderer);
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
let ctx = wx.createCanvasC... | true |
bc88a39567b56cd17c0ae9e9a4ce4ba6f3c98fb8 | JavaScript | nmarsollier/node_lessons | /node_basico/1.intro/2.routeador.js | UTF-8 | 930 | 3.015625 | 3 | [] | no_license | const http = require("http");
var url = require("url");
// Queremos manejar 2 paginas web diferentes,
// definimos sus handlers de la siguiente forma
// Procesa GET /hello
function helloWorldRoute(request, response) {
response.writeHead(200, { "Content-Type": "text/html" })
response.write("Hola Mundo")
}
// ... | true |