code stringlengths 2 1.05M |
|---|
const rules = require('./webpack.rules')
rules.push({
test: /\.css$/,
use: [{ loader: 'style-loader' }, { loader: 'css-loader' }]
})
module.exports = {
// Put your normal webpack config below here
module: {
rules,
}
}
|
'use strict';
// path.sep needed for windows compatibility, rather than just '/'
var path = require('path');
var webpack = require('webpack');
module.exports = {
context: __dirname + path.sep,
entry: './src/browser',
output: {
path: __dirname + path.sep + 'dist',
filename: 'bundle.js'
... |
'use strict';
// Clean up all generated files
// Required modules
var gulp = require('gulp'),
clean = require('gulp-rimraf');
// Main task
// Clean up all generated files
gulp.task('clean', [
'clean:templates',
'clean:style',
'clean:scripts',
'clean:styleguide'
]);
// Sub-task: Clean minified html
gulp.ta... |
var database = require('../db.js'),
should = require('should');
var conf = {
stalk_url: 'http://localhost/chef', // will be spoof by nock
host: 'localhost:27017',
database: 'ChefStalk_test'
};
var database = require('../db.js')(conf);
var db;
describe('Stalkers', function () {
before(function (cb) {... |
/*
* AlphaMapFilter
* Visit http://createjs.com/ for documentation, updates and examples.
*
* Copyright (c) 2010 gskinner.com, inc.
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software w... |
version https://git-lfs.github.com/spec/v1
oid sha256:9d44b7da2200bb7a5a5ad027c0463e017e0e390b3673968859f39656afa62d24
size 1780
|
function join_click(){
alert("Join Now...........");
}
|
/* global: returnExports */
(function (zyncer) {
// path to synchronize
var path = 'a/1/b/2';
zyncer
// putting zyncer to test mode not to issue an AJAX request
// but getting a jQuery.Deferred only - for this example only
.testMode( true )
// registering a... |
define(function () {
return [ {
id: 'rank1',
name: 'Novice Alchemist',
icon: 'novice',
description: '100 points for making it till rank 1 element !',
}, {
id: 'rank2',
name: 'Alchemist',
icon: 'alchemist',
description: '200 points for making it till rank 2 element !',
}, {
id: ... |
import React from 'react';
import {Spring} from 'react-motion';
import {Url} from '../..';
import Chart from './Chart';
import Data from './Data';
import styles from './Content.css';
const Content = React.createClass({
propTypes: {
expanded: React.PropTypes.string.isRequired
},
shouldComponentUpdate({expa... |
'use strict';
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
var ProjectSchema = new Schema({
name: String,
description: String,
// Where is the project hosted? Github, Google Code, etc.
repositoryType: {type: String, default: 'github'},
repositoryUrl: String,
websiteUrl: String,
gith... |
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the Lic... |
import {core} from '../core/core';
let eventBus = core.eventBus;
import {loadMachines} from '../services/drummachineLoader';
let createCell = ()=>({activated:false, active:false});
let createCellsIfNeeded = (machineConfig)=>{
let {rows, cellsPerRow} = machineConfig;
rows.forEach(row=>{
[...Array(cellsPerRow).keys(... |
//from: https://github.com/auth0/jwt-decode/blob/master/lib/index.js
import { base64UrlDecode } from './-base64-url-decode';
export function jwt_decode(token) {
if (typeof token !== 'string') {
throw new Error('Invalid token specified');
}
let tokenParts = token.split('.');
if (tokenParts.length !== 3) {
... |
import _ from 'lodash'
import cx from 'classnames'
import React, { Children, cloneElement, PropTypes } from 'react'
import {
AutoControlledComponent as Component,
createShorthand,
customPropTypes,
getElementType,
getUnhandledProps,
isBrowser,
keyboardKey,
makeDebugger,
META,
objectDiff,
useKeyOnl... |
/*
* ------------------------------------------
* 字体选择控件实现文件
* @version 1.0
* @author genify(caijf@corp.netease.com)
* ------------------------------------------
*/
var f = function(){
var _ = NEJ.P,
_o = NEJ.O,
_e = _('nej.e'),
_p = _('nej.ui.cmd'),
_proFontNameCard,
... |
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends2 = require('babel-runtime/helpers/extends');
var _extends3 = _interopRequireDefault(_extends2);
var _assign = require('babel-runtime/core-js/object/assign');
var _assign2 = _interopRequireDefault(_assign);
var _objectWitho... |
//A game by Brian MacIntosh
bmacSdk =
{
CFG_PAUSE_WHEN_UNFOCUSED: false,
DEBUG_RENDERSTATS: false,
//Used to ignore large frame delta after focusin
_eatFrame: false,
isFocused: true,
domAttached: false,
deltaSec: 0,
engines: []
};
bmacSdk.Engine = function(canvasDiv)
{
bmacSdk.engines.push(this);
this.ob... |
"use strict";
var _require = require("./promise"),
toPromise = _require.toPromise,
resolve = _require.resolve;
var _require2 = require("./interceptor"),
registerGlobalInterceptor = _require2.registerGlobalInterceptor;
var _require3 = require("./pipeline"),
createPipeline = _require3.createPipeline;
... |
/**
* @jsx React.DOM
*/
'use strict';
var React = require('react');
var FormContextMixin = require('./FormContextMixin');
var getDefaultValueForSchema = require('./getDefaultValueForSchema');
var Value = require('./Value');
var v = require('./... |
import Toolbox from '../tools/Toolbox'
/*
A default implementation to render the content for the overlay (aka popup) tools.
*/
class Overlay extends Toolbox {
didMount() {
super.didMount()
if (!this.context.scrollPane) {
throw new Error('Requires scrollPane context')
}
this.context.scrollPan... |
/* Smalltalk from Squeak4.5 with VMMaker 4.13.6 translated as JS source on 3 November 2014 1:52:23 pm */
/* Automatically generated by
JSPluginCodeGenerator VMMakerJS-bf.15 uuid: fd4e10f2-3773-4e80-8bb5-c4b471a014e5
from
ScratchPlugin VMMaker-bf.353 uuid: 8ae25e7e-8d2c-451e-8277-598b30e9c002
*/
self.module("user... |
(function () {
angular
.module('simplySocialApp.currentUser.service')
.factory('CurrentUserService', CurrentUserService);
function CurrentUserService(){
var profile = {
about: 'Designer and Developer living in San Diego, CA',
avatars: {
small: '/images/avatar-small-jess... |
import {
moduleForComponent,
test
} from 'ember-qunit';
import Ember from 'ember';
const { run } = Ember;
moduleForComponent('sortable-group');
test('items', function(assert) {
let component = this.subject();
assert.deepEqual(component.get('items'), [],
'expected items to default to an empty array');
});... |
window.onload = function(){
var game = new Phaser.Game(800,600, Phaser.AUTO, '', {create: create});
function create (){
console.log('Instalado');
}
}; |
'use strict';
var angular = require('angular');
var dataService = require('./dataService');
module.exports = angular.module('myApp.services.eventService', [
dataService.name
])
.service('MyEventService', function (
$q,
$rootScope,
DataService
) {
var mURL = DataService.apiRoot() + 'events';
var getEvent = fun... |
import { Observable } from 'rxjs/Observable';
import reducer, { constants, actions, cycles } from '../service';
import { actions as uiActions } from '../ui';
import { assertSourcesSinks } from '../../utils/helpers';
describe('service - 1. Constants', () => {
it('should return constants', () => {
expect(constants... |
/********************************************
0;136;0cDependencies
********************************************/
const fs = require('fs'); // file system
const argv = require('minimist')(process.argv.slice(2)); // used for easy param parsing
const readlineSync = require('readline-sync'); // reads input synchonously
con... |
/* eslint-disable no-undef */
const path = require("path");
const glob = require("glob");
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const PurgecssPlugin = require("purgecss-webpack-plugin");
const TerserPlugin = require("terser-webpack-plugin");
const PATHS = {
src: path.join(__dirname),
};
va... |
'use strict'
/* applicatin libraries */
var db = require('./log-database')
var isObject = require('isobject')
var microTimestamp = require('../../lib/micro-timestamp')
var stableId = require('../../lib/stable-id')
var stableIdWithData = require('../../lib/stable-id-with-data')
/* public functions */
var log = module.... |
export default (state) => {
return state.loading;
};
|
QUnit.test('Number.range', assert => {
const { range } = Number;
const { from } = Array;
assert.isFunction(range);
assert.name(range, 'range');
assert.arity(range, 3);
assert.looksNative(range);
assert.nonEnumerable(Number, 'range');
let iterator = range(1, 2);
assert.isIterator(iterator);
assert.... |
var searchData=
[
['i',['i',['../structstat_1_1stataccumulator.html#aa8f9105e658b823c19d9e7a67c1cb10b',1,'stat::stataccumulator']]],
['inner_5fproducts',['inner_products',['../structinprod__analytic_1_1atmosphereinnerproducts.html#acfba9f7e96f6cb71d932ed0f2bbf24ac',1,'inprod_analytic::atmosphereinnerproducts::inner... |
import { Meteor } from 'meteor/meteor';
import { check } from 'meteor/check';
import { Accounts } from 'meteor/accounts-base';
import * as Mailer from '../../../mailer';
import { Users, Subscriptions, Rooms } from '../../../models';
import { settings } from '../../../settings';
import { relinquishRoomOwnerships } from... |
var fs = require('fs');
var DOMParser = require('xmldom').DOMParser;
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var JSON = require('JSON');
var scope = {
XMLHttpRequest: XMLHttpRequest,
DOMParser: DOMParser,
JSON: JSON,
execute: function (fileName) {
filedata =... |
(function() {
var __hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prot... |
var wrap = require('number-wrap');
var verticalScroll = {
getCellRectangleOfIndex: function (gridSolution, cellIndex) {
return {
x: wrap(cellIndex, 0, gridSolution.cols) * gridSolution.cellWidth,
y: (~~((cellIndex / gridSolution.cols)+1)-1) * gridSolution.cellHeight,
width: gridSolution.cellWidth,
heigh... |
require("app").directive("viewDatabase", [function () {
return {
restrict : "EAC",
templateUrl: "/app/views/forms/view/view-database.directive.html",
replace : true,
transclude : false,
scope: {
document: "=ngModel",
locale : "=",
target : "@linkTarget"
},
controller : [function ()
{
... |
import './helpers/dom';
import test from 'ava';
const JParticles = require('../../production/jparticles');
global.JParticles = JParticles;
require('../../production/wave');
const {wave} = JParticles;
test('defaultConfig', t => {
t.deepEqual(wave.defaultConfig, {
num: 3,
fill: false,
fillC... |
require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)... |
'use strict'
const { css } = require('glamor')
const propTypes = require('prop-types')
const h = require('../utils/h')
const navItem = require('../styles/navItem')
const NavIcon = require('./NavIcon')
const IconLink = require('./IconLink')
const style = {
self: css(navItem),
label: css({
textOverflow: 'ellips... |
var main = function(){
$('.dropdown-toggle').click(function() {
$('.dropdown-menu').toggle()
});
}
$(document).ready(main)
|
/*
* utils
* */
define(function () {
var utils = {
// 获取两点的之间的距离
getDelta: function (prevPoint, curPoint) {
return {
x: curPoint.x - prevPoint.x,
y: curPoint.y - prevPoint.y
}
},
// 获取一个 touch 对象的坐标位置
getPoint: function (touch) {
return {x: touch.pageX, y: tou... |
jest.mock('../actions');
import { AsyncStorage } from 'react-native';
const mockStorage = require('mock-async-storage');
import { loadHistory, saveHistory } from '../statsStorage';
import { restoreStats, showMessage } from '../actions';
describe('Statistics storage and retrieval', () => {
beforeEach(() => {
re... |
'use strict';
var app = require('electron').app;
var BrowserWindow = require('electron').BrowserWindow;
var mainWindow = null;
app.on('window-all-closed', function() {
app.quit();
});
app.on('ready', function() {
mainWindow = new BrowserWindow({
height: 600,
width: 1200
});
... |
export default (collection, callback) => {
let mappedOutput = []
if (collection instanceof Array || typeof collection === 'string' ) {
for (let i=0;i < collection.length; i++) {
mappedOutput.push( callback(collection[i],i) )
}
} else if (collection && typeof collection === "object") {
let keys =... |
import Vue from 'vue'
import Vuex from 'vuex'
import modules from './modules'
import middlewares from './middlewares'
Vue.use(Vuex)
export default new Vuex.Store({
modules,
middlewares,
strict: true
})
|
const mongoose = require('mongoose')
const Termo = require('./TermosSchema')
const express = require('express')
const router = express.Router()
router.get('/', (req, res) => {
Termo.find({}, (err, termos) => {
res.render('../termos/termos', {
glossario: termos
})
})
})
module.exports = router; |
$(function() {
$("#opening-hours-button").on('click', function() {
$(".opening-hours").slideToggle(500)
$("#opening-hours-button").toggleClass("open")
});
}); |
// var validator = require('validator');
//
// //验证登陆
// exports.checkUser=function(req,res)
// {
// // var account = validator.trim(req.body.account).toLowerCase();
// // var pwd = validator.trim(req.body.password);
// // var imgcode = validator.trim(req.body.imgcode);
// //
// // res.json({ account: "sna... |
/**
Created radom 32 byte string
@method random32Bytes
*/
var random32Bytes = function() {
function s4() {
return Math.floor((1 + Math.random()) * 0x10000)
.toString(16)
.substring(1);
}
return s4() + s4() + s4() + s4() +
s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4() +
s4() + s4(... |
import React, { Component } from 'react';
import getGithubCornerStyles from './styles.js';
const githubCornerStyleId = '____GITHUB_CORNER_SUPER_SECRET___';
const githubCornerStyles = getGithubCornerStyles();
/**
* A react component based off of:
* https://github.com/tholman/github-corners
*
* @class GithubCorne... |
require([
'agrc/modules/Domains',
'dojo/dom-construct',
'dojo/Deferred',
'dojo/request',
'stubmodule'
],
function (
Domains,
domConstruct,
Deferred,
request,
stubModule
) {
describe('agrc/modules/Domains', function () {
var select;
var fakeUrl = 'blah';
... |
import Piece from '../../../common/Piece'
export default class BodyGuard extends Piece{
constructor(board, id, containerSvg, x, y, numCol, numRow, unitW, unitH, w, h, isRed, priority) {
super(board, id, containerSvg, x, y, numCol, numRow, unitW, unitH, w, h, isRed, priority)
this.isRed = isRed;
this.bgImag... |
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Refl... |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M17 10h-3.61l2.28 2.28zm0-8H7v1.61l6.13 6.13zm-13.59.86L2 4.27l5 5V13h3v9l3.58-6.15L17.73 20l1.41-1.41z" />
, 'FlashOffSharp');
|
define([
'backbone',
'App.config',
'App.models.Candidate'
], function(Backbone, config, CandidateModel) {
'use strict';
return Backbone.Collection.extend({
model : CandidateModel,
url : config.data.candidates
});
});
|
(function($, window, document, undefined) {
var formbuilder = {};
var selector = 'form[class^="form formbuilder-"]';
var getRendererSettings = function(form) {
return form.data('renderer').Settings;
};
var getValidationSummary = function(form, errors) {
var dfd = $.Deferr... |
export function set_pomodoro(data) {
return {
type: 'SET_POMODORO',
data
}
}
export function set_short_break(data) {
return {
type: 'SET_SHORT_BREAK',
data
}
}
export function set_long_break(data) {
return {
type: 'SET_LONG_BREAK',
data
}
}
|
'use strict'
var bl = require('bl')
var inherits = require('inherits')
var EE = require('events').EventEmitter
var Packet = require('./packet')
var constants = require('./constants')
function Parser () {
if (!(this instanceof Parser)) return new Parser()
this._states = [
'_parseHeader',
'_parseLength',
... |
'use strict';
// MODULES //
var isPositiveInteger = require( 'validate.io-positive-integer' );
// INCREMENTAL MOVING SUM //
/**
* FUNCTION: incrmsum( W )
* Returns a method to compute a moving sum incrementally.
*
* @param {Number} W - window size
* @returns {Function} method to compute a moving sum incrementally
... |
var React = require('react');
var ReactNative = require('react-native');
var Icon = require('react-native-vector-icons/Ionicons');
var {
Component,
AppRegistry,
TabBarIOS,
StyleSheet,
Text,
View
} = ReactNative;
var rn = React.createClass({
displayName: 'TabBarExample',
getInitialState: function() {... |
var ad_divs = $obj('ad_none').getElementsByTagName('div');
var ad_obj = null;
for (var i = 0; i < ad_divs.length; i++) {
if (ad_divs[i].id.substr(0, 3) == 'ad_' && (ad_obj = $obj(ad_divs[i].id.substr(0, ad_divs[i].id.length - 5))) && ad_divs[i].innerHTML) {
ad_obj.innerHTML = ad_divs[i].innerHTML;
... |
/*
* Challenge desc - Returns the missing letter in the string given by the first argument.
* level - Intermediate
* @author : HS<dcotre.1760@outlook.com>
*/
function range_sum(s,e){
var sum = 0;
for(var i = s; i<=e; i++){
sum += i;
}
return sum;
}
function fearNotLetter(str) {
var range_start = str.char... |
var test = require('tape'),
fs = require('fs'),
path = require('path'),
Templator = require('../');
function process (filename, options, st) {
var templator = new Templator(options),
input = 'test/fixtures/' + filename,
output = 'test/expected/' + filename;
var actual = templator.processF... |
// -----------------------------------------------------------------------------
// POLYFILLS
// -----------------------------------------------------------------------------
// SMOOTH SCROLL
// https://iamdustan.com/smoothscroll/
const _smoothScroll = require('smoothscroll-polyfill').polyfill;
function smoothScroll... |
// Menu.js
//
// © 2013 David J. Goehrig <dave@dloh.org>
//
Menu = function(method) {
var self = this
var message = arguments.list()
switch(method) {
case 'new':
var self = Menu.clone()
self.action = function() { console.log("Pressed") }
self.labels = message[1]
self.x = message[2]
self.y = message[3]
... |
import React from 'react'
import ComponentExample from 'docs/src/components/ComponentDoc/ComponentExample'
import ExampleSection from 'docs/src/components/ComponentDoc/ExampleSection'
const RevealStatesExamples = () => (
<ExampleSection title='States'>
<ComponentExample
title='Active'
description='A... |
(window.webpackJsonp=window.webpackJsonp||[]).push([[24],{151:function(n,t,e){},361:function(n,t,e){"use strict";var i=e(151);e.n(i).a},374:function(n,t,e){"use strict";e.r(t);var i={beforeMount:function(){e.e(107).then(e.t.bind(null,367,7)).then((function(n){n.initialize({startOnLoad:!0}),n.init("div.language-mermaid>... |
/**
* React Starter Kit (https://www.reactstarterkit.com/)
*
* Copyright © 2014-present Kriasoft, LLC. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE.txt file in the root directory of this source tree.
*/
// stylelint configuration
// https://stylelint.io/user... |
const TecDocClient = require('../lib/client.js');
describe('TecDoc Client Car functions() test', () => {
/**
*
* @type {Client}
*/
let client;
before(() => {
client = new TecDocClient({
'provider': 111,
'articleCountry': 'UKR',
'lang': 'EN',
... |
const path = require('path');
module.exports = {
entry: './src/app.js',
output: {
path: path.join(__dirname, 'public'),
filename: 'bundle.js'
},
module: {
rules: [{
loader: 'babel-loader',
test: /\.js$/,
exclude: /node_modules/
}, {
test: /\.s?css$/,
use: [
... |
var Hashes = require('../../hashes');
// sample string
var str = 'This is a sample text!';
// new MD5 instance
var MD5 = new Hashes.MD5;
// new SHA1 instance
var SHA1 = new Hashes.SHA1;
// new SHA256 instance
var SHA256 = new Hashes.SHA256;
// new SHA512 instace
var SHA512 = new Hashes.SHA512;
// new RIPEMD160 ins... |
(
function () {
this.addEventListener("message", onMessage);
}
)()
function onMessage(eventData) {
var data = eventData.data;
var result = fibonacci(data);
this.postMessage(result);
}
function fibonacci(number) {
var temp = 0;
var prevNumber = 0;
var currentNumber = 1;
i... |
import React, { Component, PropTypes } from 'react';
export default class ControlLabel extends Component {
constructor() {
super();
this.handleToggle = this.handleToggle.bind(this);
this.generateHeaderIcon = this.generateHeaderIcon.bind(this);
}
handleToggle(onOrOff) {
if (this.props.canToggleGr... |
import { normalize } from './utils';
import PatternBuffer from './pattern_buffer';
import Scanner from './scanner';
import treeify from './tree';
export function findPatterns(text, buffer, { pattern, onMatch }) {
if (!text || !pattern || !onMatch || !buffer) return;
let tokens;
let match = pattern.exec(text);
... |
/**
* DocuSign REST API
* The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign.
*
* OpenAPI spec version: v2.1
* Contact: devcenter@docusign.com
*
* NOTE: This class is auto generated. Do not edit the class manually and submit a new issue inste... |
'use strict';
/* jshint ignore:start */
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
/* jshint ignore:end */
var Q = require('q'); /* jshint ignore:line */
var _ = require('lodash'); /* jshint ignore:line */
var util = require('util'); /* jshin... |
var examples = [{
title: 'Data list',
code: function() {
var table = new jsTable(data);
return table;
}
}, {
title: 'Search by id 211',
code: function() {
// we need to set the unique id field to allow fast search by id
var table = new jsTable(data, 'id');
return table.find(211);
}
}, {
t... |
'use strict';
const getChannelURL = require('ember-source-channel-url');
module.exports = async function() {
return {
useYarn: true,
scenarios: [
{
name: 'ember-lts-2.18',
npm: {
devDependencies: {
'@ember/jquery': '^1.1.0',
'@ember/test-helpers': '^1.... |
window.Params = {
init: function(canvas) {
var draw = canvas.getContext('2d'),
audio = new AudioContext(),
startTime = audio.currentTime,
osc = audio.createOscillator(),
analyser = audio.createAnalyser(),
data = new Float32Array(analyser.frequencyBinCou... |
import fs from 'node:fs';
import path from 'node:path';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import BinWrapper from 'bin-wrapper';
import { packageConfigSync } from 'pkg-conf';
const { hugoVersion } = JSON.parse(fs.readFileSync(new URL('../package.json', import.meta.url)));
co... |
/**
* Created by lilu on 2017/10/17.
*/
import XLSX from 'xlsx'
import FileSaver from 'file-saver'
//转换函数
function s2ab(s) {
let buf = new ArrayBuffer(s.length);
let view = new Uint8Array(buf);
for (let i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
return buf;
}
/*
根据数组导出excel
data为一个二维数组,
*/
exp... |
'use strict';
define([], function() {
var ThingsController = function($scope, ThingsService) {
ThingsService.things().then(function(data) {
$scope.things = data;
});
};
// ThingsController.$inject = ['$scope', 'ThingsService'];
return ThingsController;
});
|
var app = require('app'); // Module to control application life.
var BrowserWindow = require('browser-window'); // Module to create native browser window.
// Report crashes to our server.
require('crash-reporter').start();
// Keep a global reference of the window object, if you don't, the window will
// be... |
// @flow
import Big from 'bignumber.js';
const UNITS = {
wei: '1',
kwei: '1000',
ada: '1000',
femtoether: '1000',
mwei: '1000000',
babbage: '1000000',
picoether: '1000000',
gwei: '1000000000',
shannon: '1000000000',
nanoether: '1000000000',
nano: '1000000000',
szabo: '1000000000000',
microet... |
import Reflux from 'reflux';
import $ from 'jquery';
import StoryActions from '../actions/StoryActions.js';
import url from 'url';
const StoryStore = Reflux.createStore({
listenables: [StoryActions],
storyData: [],
init() {
this.fetchStories();
},
fetchStories() {
const idUrl = 'https://hacker-news.... |
import React from 'react';
import ReactDOM from 'react-dom';
import randomSample from '../../logic/random-sample.js';
import classData from '../../data/class-data.js'
import store from '../../store/configure-store.js'
describe('.randomSample()', () => {
let currClassName = store.getState()["class"]
let currElement... |
/**
* Borrowed from https://github.com/ded/express-limiter
* @param app
* @param db
* @returns {Function}
*/
module.exports = function (app, db) {
return function (opts) {
var middleware = function (req, res, next) {
if (opts.whitelist && opts.whitelist(req)) return next();
opts... |
'use strict';
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// Renders the partials into whole pages
mustache_render: {
options: {
data: '_source/templates/data/data.json',
directory: '_source/templates'... |
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import AppBar from 'material-ui/AppBar';
import Drawer from 'material-ui/Drawer';
import MenuItem from 'material-ui/MenuItem';
import { List, ListItem } from 'material-ui/List';
import Divider from 'material-ui/Divider';
import FontIcon from ... |
'use strict';
angular.module('usermanagement.members',
['bellows.services', 'palaso.ui.listview', 'palaso.ui.typeahead',
'ui.bootstrap', 'palaso.ui.notice', 'ngRoute'])
.controller('MembersCtrl', ['$scope', 'userService', 'projectService',
'sessionService', 'silNoticeService', '$window',
function ($sco... |
var pokeback = (function() {
var selection = "normal";
var pokemonNames = [];
var autoComplete;
///////////////////////////////////
function init() {
$(document).ready(initialLoad);
}
function initialLoad(e) {
window.console.log("initiated!")
for (var i = 0; i < ... |
Package.describe({
name: 'ox2:modals',
version: '3.5.0',
// Brief, one-line summary of the package.
summary: 'DO NOT USE',
// URL to the Git repository containing the source code for this package.
git: '',
// By default, Meteor will default to using README.md for documentation.
// To avoid submitting do... |
/*
Simon: run up a happner-client, for emulating reconnection logic and some activity
*/
const commander = require('commander');
commander.option('--activity [number]', 'activity interval').parse(process.argv);
const HappnerClient = require('happner-client');
client = new HappnerClient();
var model = {
localCompone... |
var gulp = require('gulp'),
livereload = require('gulp-livereload'),
gutil = require('gulp-util'),
path = require('path'),
spawn = require('child_process').spawn;
var cp;
var isLaunched = false;
gulp.task('serve', ["build"], function() {
livereload.listen({livereload: path.resolve(__dirname... |
'use strict';
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require('html-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var CleanWebpackPlugin = require('clean-webpack-plugin');
var PATHS = {
main: path.join(__dirname, 'app', 'client', 'c... |
module.exports = {
output: {
path: __dirname
},
module: {
loaders: [
{ test: require.resolve("./index"), loader: 'expose?Lexer' },
]
},
}; |
var fms = require('fms')
var Mock = require('mockjs')
// todo divide public and admin entry
fms.get({
title: 'Get post list',
url: '/posts',
request: {
page: {
current: 2,
limit: 15
}
},
res: {
ok: function () {
return Mock.mock({
page: {
total: '@natural(38,46... |
import React, { Component, PropTypes } from 'react';
// discrete lines data [[1, 2], [2, 3], [5,7]]
// 2x continuous line data [[2, 5, 3, 7], [5, 6, 7, 10]]
const Lines = (props) => {
const { points, data, stroke } = props;
const buildPath = function () {
const res = data.map(p => {
return p.map((... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.