code stringlengths 2 1.05M |
|---|
import mongoose from 'mongoose'
const BookSchema = new mongoose.Schema({
isbn: String,
title: String,
author: String,
description: String,
published_date: { type: Date },
publisher: String,
updated_date: { type: Date, default: Date.now }
})
export default mongoose.model('Book', BookSchema)
|
var path = require('path');
var util = require('util');
var autoprefixer = require('autoprefixer');
var pkg = require('../package.json');
var loaders = require('./loaders');
var plugins = require('./plugins');
var DEBUG = process.env.NODE_ENV === 'development';
var TEST = process.env.NODE_ENV === 'test';
var jsBundl... |
// @flow strict
import React from 'react';
import Utterances from '../Utterances';
import { useSiteMetadata } from '../../../hooks';
const Comments = () => {
const { utterances } = useSiteMetadata();
if (!utterances) {
return null;
}
return (
<Utterances utterances={utterances} />
);
};
export def... |
import test from 'ava'
import {PreErrors} from './Pre'
import Pre from './Pre'
test(t => {
t.deepEqual(new Pre().analyse(),{t:undefined, e:[PreErrors.MISSING_BASE]})
t.deepEqual(new Pre({}).analyse(),{t:undefined, e:[PreErrors.MISSING_BASE]})
t.deepEqual(new Pre('in').analyse(),{t:'in', e:[]})
t.deepEqual... |
(function () {
"use strict";
var StateExt = Class.extend({
excludeNextStateChangeFromHistory: false,
targetParams: null,
targetState: null,
$injector: null,
$location: null,
$state: null,
session: null,
history: [],
initialize: function ($cookieStore, $http, $injector, $location, $state, authorizat... |
require('styles/paper-theme.css');
require('styles/App.css');
import React from 'react';
import { TestComponent, Header, CurrentlyPlayingComponent, Navigation, Menu } from './index';
import _ from 'lodash';
import { Grid, Row, Col, Button, Glyphicon } from 'react-bootstrap';
class AppComponent extends React.Component ... |
export {
select
} from 'd3-selection'
export {
geoPath,
geoMercator
} from 'd3-geo'
|
var _ = require("underscore");
var r = require('../db');
module.exports = function(apiRoutes){
var model='settings'
apiRoutes
.get ("/settings", function(request, response){
return r.table(model)
.orderBy(r.desc('createdAt'))
.coerceTo('array')
.run(r.conn)
.t... |
var helper=require("./test-helper.js"),Stream=require("..").WritableStream,fs=require("fs"),path=require("path");helper.mochaTest("Stream",__dirname,function(e,t){var n=path.join(__dirname,"Documents",e.file);fs.createReadStream(n).pipe(new Stream(helper.getEventCollector(function(r,i){t(r,i);var s=helper.getEventColle... |
var colors = ["#FF6384", "#4BC0C0", "#FFCE56", "#E7E9ED", "#36A2EB", "#F38630", "#E0E4CC", "#69D2E7", "#F7464A", "#E2EAE9", "#D4CCC5", "#949FB1", "#4D5360"];
function getChartColors(len) {
if (len >= colors.length) {
return colors;
}
return colors.slice(0, len);
}
function getChartColor(i) {
... |
// suites/camelize
require('../../../lib/node/monad');
var camelize = define.camelize;
var assert = require('assert');
/* TESTS START HERE */
suite('camelize');
test('exists', function () {
assert(typeof camelize == 'function');
});
test('path/to/file', function () {
assert(camelize('path/to/file') === 'file'... |
'use strict';
import Camera from './camera';
import Recognizer from './recognizer';
import Authenticator from './authenticator';
import Gate from './gate';
export default () => {
const camera = new Camera;
const recognizer = new Recognizer;
const gate = new Gate;
const authenticator = new Authenticator;
ca... |
exports.levelText = {
// __for developement__
// 1: [ "ab", "cd", "ef", "gh"],
// 2: [ "ij", "kl", "mn", "op"],
// 3: [ "qr", "st", "uv", "wx"],
// 4: [ "yz", "ba", "dc", "fe"],
// 5: [ "ji", "lk", "vn", "kd"],
// 6: [ "ha", "uh", "mq", "yb"]
//__actual challenge texts__
1: ["ene ite nee inet one ene ite ete... |
// *- SKIP
function a$def() {
eff(1) + eff(2);
}
M.option({ expr: "seq" });
function a$seq() {
eff(1) + eff(2);
}
|
/**
* Created by gaurangdave on 9/15/16.
*/
module.exports = function (grunt, options) {
var utils = require("./utils");
return {
"lazyload": {
"src": "package.json",
"dest": utils.getTmpFolder() + "modules/"
},
"update":{
"src": "package.json",
... |
$(document).ready(function() {
$("#myonoffswitch").change(function(){
var check= $('#myonoffswitch').attr('checked');
if(check){
$('#myonoffswitch').attr('checked',false);
current_check = false;
}else{
$('#myonoffswitch').attr('checked',true);
... |
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.SQRT2Docs = void 0;
var SQRT2Docs = {
name: 'SQRT2',
category: 'Constants',
syntax: ['SQRT2'],
description: 'Returns the square root of 2, approximately equal to 1.414',
examples: ['SQRT2', 'sqrt(2)'],
seealso: []
};
exp... |
'use strict';
var RollingSpider = source("driver");
describe("Cylon.Drivers.RollingSpider", function () {
var driver = new RollingSpider({
connection: {}
});
it("needs tests");
});
|
"use strict";
var debug = require('debug')('ansijet-job-processor'),
co = require('co'),
path = require('path'),
thunkify = require('thunkify'),
waigo = require('waigo');
var timers = waigo.load('support/timers');
var buildTimerHandler = function(app, maxParallelJobs) {
return co(function*() {
var... |
7.0-alpha1:84ba5e3811fef6fb8a24452ed62e382505a9fa41eb0c841eb41b37d43ee17091
7.0-alpha2:84ba5e3811fef6fb8a24452ed62e382505a9fa41eb0c841eb41b37d43ee17091
7.0-alpha3:84ba5e3811fef6fb8a24452ed62e382505a9fa41eb0c841eb41b37d43ee17091
7.0-alpha4:84ba5e3811fef6fb8a24452ed62e382505a9fa41eb0c841eb41b37d43ee17091
7.0-alpha5:84ba5... |
var PixelManager = function (mount) {
var self = this;
self.pixels = new Array();
for(var row = 0; row < P.height; row++){
for(var column = 0; column < P.width; column++){
var pixel = new Pixel(P.random(P.width),P.random(P.height));
// pixel.showBody();
... |
'use strict';
function weightedMean(weightedValues) {
var totalWeight = weightedValues.reduce(function (sum, weightedValue) {
return sum + weightedValue[1];
}, 0);
return weightedValues.reduce(function (mean, weightedValue) {
return mean + weightedValue[0] * weightedValue[1] / totalWeight;... |
var _; //globals
describe("About Applying What We Have Learnt", function() {
var products;
beforeEach(function () {
products = [
{ name: "Sonoma", ingredients: ["artichoke", "sundried tomatoes", "mushrooms"], containsNuts: false },
{ name: "Pizza Primavera", ingredients: ["roma", "sundried tom... |
/**
* pubfood
*
* Errors live here..
*/
'use strict';
var ERR_NAME = 'PubfoodError';
/**
* Pubfood Error
* @class
* @param {string} message - the error description
* @return {pubfood.PubfoodError}
*/
function PubfoodError(message) {
this.name = ERR_NAME;
/** @property {string} message The error message *... |
application.whenConnected('something') |
module.exports = (function() {
function ParameterTrackModel(parameter, dataModel) {
this.parameter = parameter;
this.dataModel = dataModel;
this.graphColumn = undefined;
dataModel.addListener(this);
// Returns an array with parameter value objects
this.getParameterPath = function() {
re... |
'use strict';
const request = require('supertest');
const assert = require('assert');
const Koa = require('../..');
describe('ctx.state', function(){
it('should provide a ctx.state namespace', function(done){
const app = new Koa();
app.use(function *(ctx){
assert.deepEqual(ctx.state, {});
});
... |
module.exports = function(sequelize, db) {
return sequelize.define("Search", {
name: db.STRING,
profile_type: db.STRING,
image: db.STRING,
document: db.STRING,
slug: db.STRING
}, {
classMethods: {
search: (query, filter) => {
if (sequelize.options.dialect !== "postgres") {
... |
var fs = require('fs');
var path = require('path');
var glob = require('glob');
var defer = require('node-promise').defer;
var http = require('http');
var connect = require('connect');
var io = require('socket.io');
var assets = {
scripts: {},
styles: {}
};
var connectionPort = 8111;
var clientdir = path.join(pr... |
import path from 'path'
import fs from 'fs'
import mkdirp from 'mkdirp'
/**
* All files in dir
*/
function getFileList (dir) {
return fs.readdirSync(dir).reduce((list, file) => {
const name = path.join(dir, file)
const isDir = fs.statSync(name).isDirectory()
if (isDir) {
list.push({
isDir... |
exports.post = function(req, res) {
var DiaryItem = require('../models/diaryItem');
var diaryitem = new DiaryItem(req.body.diaryitem);
diaryitem.addedBy = req.user._id;
diaryitem.addedByName = req.user.firstName + ' ' + req.user.lastName;
diaryitem.addedOn = new Date();
diaryitem.save(function(err) {
if(err) t... |
var myApp = angular.module('myApp', []);
myApp.controller('AppCtrl', ['$scope', '$http', function($scope, $http) {
//set 'this' to the variable self
var self = this;
//is set to true when editing a contact
self.editModeActive = false;
//get data from server
$http.get("/contactList")
.then(function(dataRe... |
export default function calculateMidpoint(entity) {
return {
left: entity.position.left + (entity.size.width / 2),
top: entity.position.top + (entity.size.height / 2),
};
}
|
const assert = require('assert');
const Retracer = require('../retracer');
const mappingFile1 = "com.example.test.AnotherClass -> o.w:\n"
+ " java.lang.String TAG -> `\n"
+ " android.content.Context mContext -> ,\n"
+ " android.net.Uri mContentUri -> .\n"
+ " 52429:52430:void checkSelfPermi... |
var ActionAtADistance = function() {
var _socket, _lastRequestedUrl, _currentlyLoadedUrl,
_uuid, _lastEvalResp, _connected = false, _onCallback, _initCallback, _onDisconnect;
function _log(msg) {
if (typeof console !== 'undefined' &&
(typeof console.log === 'function' || typeof co... |
"use strict";
var ensureDatabase = require('dbjs/valid-dbjs')
, ensureString = require('es5-ext/object/validate-stringifiable-value')
, ensureObject = require('es5-ext/object/valid-object')
, queryMaster = require('../../query-master/slave')
, defineUser = require('../../../../model/user');
module.... |
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" />
, 'KeyboardArrowUp');
|
import React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<path d="M15 1H9v2h6V1zm4.03 6.39l1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61zM12 20c-3.87 0-7-3.13-7-7s3.13-7 7-7 ... |
/*
Create an issue link
*/
module.exports = function (task, jira, grunt, callback) {
'use strict';
// ## Create an issue link between two issues ##
// ### Takes ###
//
// * link: a link object
// * callback: for when it’s done
//
// ### Returns ###
// * error: string if there w... |
var express = require('express');
var router = express.Router();
var rsssection = require('../app/models/rsssection');
var rssfeed = require('../app/models/rssfeed');
var coaching = require('../app/models/coaching');
var user = require('../app/models/user');
var email = require('../app/models/email');
var mongodb = req... |
/*
Copyright (c) 2011, Chris Umbel
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 without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, su... |
var config = require('../config');
if(!config.tasks.fonts) return;
var browserSync = require('browser-sync');
var changed = require('gulp-changed');
var gulp = require('gulp');
var path = require('path');
var paths = {
src: path.join(config.root.src, config.tasks.fonts.src, '/**/*'),
dest: path.join(config.r... |
import {createPartStore, createReducer} from '../index';
let modelState = {
name: 'Tom',
age: 12,
isboy: true,
address: {
city: 'Guangzhou',
school: 'SCUT'
}
};
let initState = modelState;
const namespace = 'merge';
const partStore = createPartStore(namespace, modelState);
const reducer = createReducer(name... |
import { combineReducers } from 'redux';
import actionCableReducer from './action-cable-reducer';
export default combineReducers({
actionCable: actionCableReducer
});
|
/**
* @namespace tetris
*/
define(function () {
'use strict';
/**
* @class tetris.Logger
*/
function Logger(name) {
this._name = name;
this._console = 'console' in window ? window.console : null;
}
Logger.prototype.error = function (msg) { this._log('error', msg); };
Logger.prototype.warn = function (msg) { t... |
version https://git-lfs.github.com/spec/v1
oid sha256:ebb7daa36c51853820ec193e5e56aa0d47e36900b3bb4874b150e4c1c530ad4b
size 1407
|
describe('FeatureManagerService', function() {
var featureMgrService;
var mapService;
var serverService;
var configService;
var exclusiveModeService;
var translateService;
var q;
var defer;
var rootScope;
var httpBackend;
var dialogService;
var window;
//include the whole application to initi... |
function eventline() {
// Default values for each of the plot's properties.
// These may be retrieved/modified via the getters/setters
// at the end of this file.
// An object specifying the margins around the plot.
// Must contain values for 'top', 'right', 'bottom', 'left'.
var margi... |
/*!
* numbro.js language configuration
* language : German
* locale: Liechtenstein
* author : Michael Piefel : https://github.com/piefel (based on work from Marco Krage : https://github.com/sinky)
*/
(function () {
'use strict';
var language = {
langLocaleCode: 'de-LI',
cultureCode: 'de-LI... |
const symbols = require('../symbols');
const createToken = require('../create-token');
const cleanToken = require('./clean');
let depthPointer = 0;
const addTokenToExprTree = (ast, token) => {
let level = ast;
for (let i = 0; i < depthPointer; i++) {
//set the level to the rightmost deepest branch
level = ... |
'use strict';
var CongestReset = Symbol( );
function implementation( Promise )
{
function defer( )
{
var obj = { };
obj.promise = new Promise( ( resolve, reject ) => {
obj.resolve = resolve;
obj.reject = reject;
} );
return obj;
}
function promise_try( fn, args )
{
args = args || [ ];
return... |
var app = require('./app');
var config = require('config');
var util = require('util');
module.exports = app.listen(process.env.PORT || config.port || 3000, function() {
util.log('Server started: http://%s:%s/', this.address().address, this.address().port);
});
|
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _api = require('./api');
var _moment = require('moment');
var _moment2 = _interopRequireDefault(_moment);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var details = function detail... |
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.definePrope... |
const {ipcRenderer} = require('electron')
const printPDFBtn = document.getElementById('print-pdf')
printPDFBtn.addEventListener('click', (event) => {
ipcRenderer.send('print-to-pdf')
})
ipcRenderer.on('wrote-pdf', (event, path) => {
const message = `Wrote PDF to: ${path}`
document.getElementById('pdf-path').in... |
import React, { Component } from 'react';
import 'bootstrap';
import 'bootstrap/dist/css/bootstrap.min.css';
import './App.css';
import {
Collapse,
Navbar,
NavbarToggler,
NavbarBrand,
Nav,
NavItem,
NavLink,
Container,
Row,
Col,
Jumbotron,
Button
} from 'reactstrap';
class App extends Component... |
'use strict';
const _ = require('lodash');
const moment = require('moment-timezone');
const inherits = require('../../utils/inherits');
module.exports = BaseTypes => {
BaseTypes.ABSTRACT.prototype.dialectTypes = 'https://mariadb.com/kb/en/library/resultset/#field-types';
/**
* types: [buffer_type, ...]
* @... |
var fs = require('fs')
var moduleName = 'mnGroup'
var controllerName = moduleName + 'Controller'
var template = fs.readFileSync(__dirname + '/template.html')
var directiveFn = function () {
return {
controller: controllerName,
controllerAs: 'vm',
bindToController: true,
template: template,
scope... |
var wallabify = require('wallabify');
var wallabyPostprocessor = wallabify({
// browserify options, such as
// insertGlobals: false
}
// you may also pass an initializer function to chain other
// browserify options, such as transformers
// , b => b.exclude('mkdirp').transform(require('babelify'))
);
... |
/* jshint node: true, esnext: true */
'use strict';
var React = require('react');
var modes = require('js-git/lib/modes');
var BlobBox = require('./blob-box');
var TreeBox = React.createClass({
getInitialState : function () {
return this._getState();
},
componentDidMount: function() {
this.props.obje... |
'use strict';
/**
* Module dependencies.
*/
var mongoose = require('mongoose'),
Schema = mongoose.Schema;
/**
* Kontakt Schema
*/
var KontaktSchema = new Schema({
name: {
type: String,
default: '',
required: 'Please fill Kontakt name',
trim: true
},
created: {
type: Date,
default: Date.now
},
us... |
/* eslint-env mocha */
'use strict'
import { expect } from 'chai'
import trumpet from 'trumpet'
import fs from 'fs'
import path from 'path'
import { trumpetInnerText, trumpetClasses, trumpetAttr } from '../../../lib/html-parsers/index'
describe('HTML parsers tools', () => {
it('trumpetInnerText function delivers ... |
module.exports = function(grunt) {
const DEST = 'lib/expaste.js';
const DEST_MIN = 'lib/expaste.min.js';
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkg,
meta: {
banner:
'/**\n' +
' * <%= pkg.name %> - v<%= pkg.version %>\n' +
' * update: <%= g... |
"use strict";
function kotools() {
var self = this;
var today = new Date();
self.currentYear = today.getFullYear();
self.currentMonth = today.getMonth();
self.isEmpty = function (str) {
return (!str || 0 === str.length);
};
Date.prototype.toFormattedString = function () {
... |
import path from 'path';
import HtmlWebpackPlugin from 'html-webpack-plugin';
export default {
debug: true,
devtool: 'inline-source-map',
noInfo: false,
entry: [
path.resolve(__dirname, 'src/index')
],
target: 'web',
output: {
path: path.resolve(__dirname, 'src'),
publicPath: '/',
filenam... |
import { Actions } from 'flummox';
class CounterActions extends Actions {
increment() {
return true;
}
decrement() {
return true;
}
incrementAsync() {
return new Promise(resolve => {
setTimeout(() => {
resolve(true);
}, 1000)
});
}
}
export default CounterActions;
|
import chai from 'chai'
import QueueDS from './queue'
chai.should()
describe('[Data Structure] Queue', () => {
it('Get the length() of the queue', (done) => {
const queue = new QueueDS()
queue.enqueue(1).enqueue(2).enqueue(3)
// Assertions.
queue.length().should.equal(3)
done()
})
it('enq... |
/*!
* Angular Material Design
* https://github.com/angular/material
* @license MIT
* v1.1.0-rc.5-master-7f01138
*/
function createDirective(e,i){return["$mdUtil",function(n){return{restrict:"A",multiElement:!0,link:function(t,o,r){var a=t.$on("$md-resize-enable",function(){a();var c=window.getComputedStyle(o[0]);t... |
define(function (require) {
// imports
var RAF = require('../lib/RequestAnimationFrame');
var Container = require('Container');
var Sprite = require('Sprite');
var TestBasic = function(canvas) {
console.log('[TestBasic] Initializing');
this.stageWidth = canvas.width = window.innerWidth;
this.stageHeight =... |
<% if(includeNeturalNotice) {%>import companyNotice from './companyNotice';<% } %><% if(includeMojito) {%>
import mojitoSetup from './mojitoSetup';<% } %>
|
var pg = require("pg");
var async = require("async");
var fs = require("fs");
function getEnvironmentVariables(filepath, existingVariables) {
var vars = {};
// Copy over existing variables
for (var key in existingVariables) {
vars[key] = existingVariables[key];
}
if (fs.existsSync(filepath... |
import React from 'react'
import NavHelper from './components/nav-helper'
export default React.createClass({
displayName: 'Layout',
render () {
return (
<NavHelper>
<nav className='top-nav top-nav-light cf' role='navigation'>
<input id='menu-toggle' className='menu-toggle' type='checkbox... |
import angular from 'angular'
import './components'
import './controllers'
import './dependencies'
import './routes'
import './style'
const MODULE_NAME = 'app.core'
angular.module(MODULE_NAME, [
'app.core.components',
'app.core.controllers',
'app.core.dependencies',
'app.core.routes',
'app.core.style'
])
... |
var gulp = require('gulp');
var browserSync = require('browser-sync');
// Watch Files For Changes & Reload
gulp.task('serve', function () {
browserSync({
notify: false,
snippetOptions: {
rule: {
match: '<span id="browser-sync-binding"></span>',
fn: function (snippet) {
... |
var Character = require('../models/character');
function charactersIndex(req, res){
Character.find({}, function(err, characters){
if (err) return res.status(404).json({ message: "Error while finding characters." });
res.status(200).json({ characters: characters });
});
}
function characterCreate(req, res)... |
import React from 'react';
import {Decorator as Cerebral} from 'cerebral-view-react';
import styles from '../styles.css';
import currentLoader from '../../../computed/currentLoader';
@Cerebral({
loader: currentLoader
})
class JadeConfig extends React.Component {
render() {
const loader = this.props.loader;
... |
/* eslint no-empty-pattern: "off" */
/* eslint no-magic-numbers: ["error", { "ignore": [2] }] */
export default function createSuggestedActionsStyle({
paddingRegular,
suggestedActionsStackedHeight,
suggestedActionsStackedOverflow,
transcriptOverlayButtonBackground,
transcriptOverlayButtonBackgroundOnDisabled... |
var gulp = require('gulp');
var filter = require('gulp-filter');
var minifyCss = require('gulp-minify-css');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
gulp.task('deploy', ['deploy:dist']);
gulp.task('deploy:dist', ['sass:foundation', 'javascript:foundation'], function() {
var cssFilt... |
var IRC = function IRC(nickname, password, callback) {
// Varable d'instance
var self = this;
self.socket = io();
self.callbacks = [];
// Envoyer une commande en brute sur le réseau IRC
self.sendCommand = function sendCommand(command) {
console.log("> " + command);
self.socket.e... |
var Tecnotek = Tecnotek || {};
Tecnotek.Reports = {
List: {
init : function() {
$('#btnPrint').click(function(event){
$("#report").printElement({printMode:'popup', pageTitle:$(this).attr('rel')});
});
$("#activityTypeId").change(function(event){
... |
/*global todomvc */
'use strict';
/**
* Directive that executes an expression when the element it is applied to loses focus
*/
todomvc.directive('todoBlur', function () {
return function (scope, elem, attrs) {
elem.bind('blur', function () {
scope.$apply(attrs.todoBlur);
});
};
})... |
/* eslint-disable max-len */
import classNames from 'classnames'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import urlManager from './../utils/urlManager.js'
import nameUtil from './../utils/nameUtil.js'
const Navigation = ({ domain, locationClass, isHomepage }) => {
const baseURL = u... |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
function chunkContainsModule(chunk, module) {
var chunks = module.chunks;
var modules = chunk.modules;
if(chunks.length < modules.length) {
return chunks.indexOf(chunk) >= 0;
} else {
return modules.indexOf(modul... |
/**
* Recompile library for AngularJS
* version: TODO
*
* NOTE: It's best to not directly edit this file. Checkout
* this repo and edit the files in src/. Then run 'grunt' on the
* command line to rebuild dist/recompile.js
*/
(function() {
'use strict';
/**
* NOTE: It's best to change the namespace with... |
/*
内容 (content[string],回答内容)
回答时间 (addTime[string])
热度 (heat[int],被赞+1,被踩-1)
回答者ID (answererID[ObjectID],回答者的ID)
回答者nickname (answererNickname[string],回答者的nickname)
评价过这条回答的人ID (viewers[ObjectID数组])
是否被采纳 (isBest[bool])
*/
Template['questionDetail'].events({
'click #selectBest': function(e) {
e.preventDefault();
... |
import {OPEN, CLOSE, RECEIVE_COMPONENT} from '../actions/modal_actions';
import merge from 'lodash/merge';
const initialState = {
isOpen: false,
component: ''
};
const ModalReducer = (state = initialState, action) => {
Object.freeze(state);
switch(action.type){
case RECEIVE_COMPONENT:
let compon... |
/**
* Client entry file
*/
console.log('Blocker - The Hunter is welcome!')
const config = require('./../../../common/config')
const blocker = require('./blocker')
const socketUrl = location.protocol + '//' + location.hostname + ':' + config.serverPort
window.COMMON_MODULE = require('./../../../common/module')
wind... |
/**
* @preserve jquery-param (c) 2015 KNOWLEDGECODE | MIT
*/
/*global define */
(function (global) {
'use strict';
var param = function (a) {
var add = function (s, k, v) {
v = typeof v === 'function' ? v() : v === null ? '' : v === undefined ? '' : v;
s[s.length] = encodeURIC... |
var mongoose = require('mongoose')
var User = mongoose.model('User')
var LocalStrategy = require('passport-local').Strategy
var bCrypt = require('bcrypt-nodejs')
module.exports = function(passport){
// Passport needs to be able to serialize and deserialize users to support persistent login sessions
passport.seriali... |
'use strict';
var grunt = require('grunt');
/*
======== A Handy Little Nodeunit Reference ========
https://github.com/caolan/nodeunit
Test methods:
test.expect(numAssertions)
test.done()
Test assertions:
test.ok(value, [message])
test.equal(actual, expected, [message])
test.notEqual(actua... |
/*!
* baguetteBox.js
* @author feimosi
* @version 1.11.1
* @url https://github.com/feimosi/baguetteBox.js
*/
/* global define, module */
(function (root, factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
... |
import $ from 'jquery';
import _ from 'lodash';
import FontFaceObserver from 'fontfaceobserver';
import React from 'react';
import ReactDom from 'react-dom';
import { IndexLink } from 'react-router';
import ReactVTT from '../../common/components/ReactVTT';
import VideoTrack from '../../common/components/VideoTrack';
... |
/*
* Kendo UI v2014.2.716 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial licen... |
angular.module('maktaba.services')
.factory('Documents', ['$resource', function($resource) {
return $resource('/api/documents/:id', {
id: '@id'
}, {
update: {
// this method issues a PUT request
method: 'PUT'
}
}, {
stripTrailingSlashes: false
});
}]);
|
var React = require("react");
var {Type, Node} = require("./base");
var {View} = require("./workbench");
var {CSideEffect} = require("./util");
var {ButtonGroup, Button, Glyphicon, Table} = require("react-bootstrap");
var saveAs = require("browser-filesaver");
// TODO Use a CSV lib?
function csvLine(fields) {
var li... |
import { ok } from 'assert'
import { execSync } from 'child_process'
import { statSync, readFileSync, writeFileSync } from 'fs'
import { binary } from 'dr-js/module/common/format'
import { createDirectory } from 'dr-js/module/node/file/File'
import { getFileList } from 'dr-js/module/node/file/Directory'
import { runSyn... |
"use strict";
var commandToBuffer = require("./commandToBuffer");
var AudioState = module.exports = function(self) {
this.self = self;
};
AudioState.prototype.audioStreamingRunning = function(running) {
var buffer = commandToBuffer(0, "AudioState", "AudioStreamingRunning", running);
this.self._writePacket(... |
'use strict';
var key_arr = document.getElementsByClassName('key');
var border = document.getElementById('key-container');
var keycode_letters = {
key_nums: [82, 84, 89, 85, 73, 79, 80, 65, 83, 68, 70, 71, 72, 74, 75, 76],//key codes
key_letters: ['A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ';'],//array of keys
... |
var through = require('through2');
var gutil = require('gulp-util');
var pathModule = require('path');
var sass = require('node-sass');
var less = require('less');
var fs = require('fs');
var autoprefixer = require('autoprefixer');
var postcss = require('post... |
const test = require('ava')
const evaluate = require('../evaluate')
test('works', t => {
t.is(evaluate('foo', { foo: 'hehe' }), 'hehe')
})
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.