code
stringlengths
2
1.05M
(function() { 'use strict'; angular.module('blocks.users') .controller('Signup', Signup); Signup.$inject = ['auth']; /* @ngInject */ function Signup(auth) { var vm = this; vm.formData = {}; vm.submit = function() { auth.registerUser(vm.formData); ...
define(['angular'], function (angular) { 'use strict'; var directives = angular.module('App.directives', []) .directive('appVersion', ['version', function (version) { return function (scope, elm, attrs) { elm.text(version); ...
import React, {Component, PropTypes} from 'react'; import { LearnMoreForm } from 'components'; import { connect } from 'react-redux'; import _R from 'ramda'; @connect( state => ({ cards: state.cards }), null ) export default class LearnMore extends Component { static propTypes = { params: PropTypes.obj...
import * as React from 'react'; import PropTypes from 'prop-types'; import { formatBalance } from '@utils/formatting'; import { BalanceHeaderWrap } from '@components/Common/Atoms'; const BalanceHeader = ({ balance, ticker }) => { return ( <BalanceHeaderWrap> {formatBalance(balance)} {ticker} ...
var React = require('react'); var Row = React.createClass({displayName: "Row", render: function() { return ( React.createElement("tr", null, this.props.children ) ); } }); module.exports = Row;
// Copyright (c) 2012 Ecma International. All rights reserved. // Ecma International makes this code available under the terms and conditions set // forth on http://hg.ecmascript.org/tests/test262/raw-file/tip/LICENSE (the // "Use Terms"). Any redistribution of this code must retain the above // copyright and this n...
//For front-end storage of questions that can be accessed by different modules 'use strict'; //into the test portal angular.module('test_portal').factory('takeTestService', function() { //initialize questions var questionContainer = { questions: [] }; //populates array with questions questionContainer.setQuesti...
// Generated by CoffeeScript 1.6.3 (function() { var FileCert, NewCert, Q, a, args, argv, c, cn, complain, f, fs, pem, posh, usage, _i, _len, _ref; pem = require('pem'); fs = require('fs'); posh = require('./index'); Q = require('q'); usage = function() { process.stderr.write("Usage: genposh [optio...
var push = { controller: function() {}, view: function() { return m("h1", "push"); } }; module.exports = push;
module.exports = [{ input : ['abba', "dog cat cat dog"], output : true }, { input : ['abba', "dog cat cat fish"], output : false }, { input : ['', ''], output : false }];
//https://github.com/Sector43/SPRESTSearchParser var S43; (function (S43) { "use strict"; var SearchResult = (function () { function SearchResult() { this.rank = -1; this.docId = -1; this.title = ""; this.author = ""; this.size = -...
// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative pat...
//~ name b485 alert(b485); //~ component b486.js
ig.module( 'plugins.shade.drawing' ).requires( 'impact.image' ).defines(function () { "use strict"; window.sh = window.sh || {}; sh.Drawing = ig.Image.extend({ loaded: true, ctx: null, cache: {}, // Caches scaled versions of this image scale: 1, // The current (absolute) scale of this image caching: false, i...
/** * Created by Jilion on 2017/3/10. */ import React from 'react'; import { Form, Spin, Input, Button} from 'antd'; import EditableTable from '../common/EditableTable'; import SizeStore from '../stores/SizeStore'; import SizeActions from '../actions/SizeActions'; import { message } from 'antd'; const FormItem = For...
"use strict"; ace.define("ace/mode/gcode_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function (require, exports, module) { "use strict"; var oop = require("../lib/oop"); var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; ...
/* globals Shasta, ManagerFactories, ViewFactories, sinon */ /** * @venus-library mocha-chai * @venus-fixture fixtures/layout.html * @venus-include-group main */ describe('Shasta.Manager', function() { function viewFactory(tagName, text, attrs) { var View = Backbone.View.extend(_.extend({ render: funct...
import { parse } from 'qs' import { message } from 'antd' import { query, update, password } from '../services/auth' import { getLocalStorage, setLocalStorage } from '../utils/helper' export default { namespace: 'auth', state: { user: {}, isLogined: false, currentMenu: [], }, reducers: { showLo...
/** * marko-template-loader.js * * A simple helper to avoid having to load */ var marko = require('marko') module.exports = loader /** * Load and return a template renderer * * @param String path Relative path to template * @return Object Marko template */ function loader(path) { return marko...
const { expect } = require('chai'); const { fetchMock } = testGlobals; describe('response generation', () => { let fm; before(() => { fm = fetchMock.createInstance(); fm.config.warnOnUnmatched = false; }); afterEach(() => fm.restore()); describe('status', () => { it('respond with a status', async () => { ...
/*! tether-shepherd 1.8.1 */ (function(root, factory) { if (typeof define === 'function' && define.amd) { define(["tether"], factory); } else if (typeof exports === 'object') { module.exports = factory(require('tether')); } else { root.Shepherd = factory(root.Tether); } }(this, function(Tether) { ...
import React, { Component, PropTypes } from 'react'; import axwayLogo from '../../images/logo.png'; import Configuration from '../Configuration'; class Settings extends Component { constructor() { super(); }; static propTypes = { selectedItem: PropTypes.number, userName: PropType...
'use strict'; // Setting up route angular.module('users').config(['$stateProvider', function ($stateProvider) { // Users state routing $stateProvider .state('settings', { abstract: true, url: '/settings', templateUrl: 'modules/users/client/views/settings/settings.client.view.htm...
'use strict'; var cors = require('cors'); var apSession = require('./get-apollo-session'); var mongoose = require('mongoose'); function ensureAuthenticated(req, res, next) { if (req.isAuthenticated()) { return next(); } res.set('X-Auth-Required', 'true'); req.session.returnUrl = req.originalUrl; res.red...
import React from 'react' import Component from './component.js' const normal = { blue: '#509EE3', green: '#9CC177', purple: '#A989C5', red: '#EF8C8C', yellow: '#EF8C8C', }; const saturated = { blue: '#2D86D4', green: '#84BB4C', purple: '#885AB1', red: '#ED6E6E', yellow: '#F9C...
import React from 'react'; import { Button, Form, FormField, FormInput, Alert, Spinner, Modal, ModalHeader, ModalBody, ModalFooter } from 'elemental'; import LoginLinkForm from './LoginLinkForm'; import * as http from '../lib/http'; export default React.createClass({ getInitialState() { return { isS...
/* * moan * https://github.com/neocotic/moan * * Copyright (c) 2015 Alasdair Mercer * Licensed under the MIT license. * https://github.com/neocotic/moan/blob/master/LICENSE.md */ 'use strict' const moan = require('..') module.exports = () => { return moan.fileSet('clean').del() }
// Google Maps Scripts
var expect = require('chai').expect; var Verifier = require('../index'); var sharedKey = ''; var testData = { "userId": "l3HL7XppEMhrOGDnur9-ulvqomrSg6qyODKmah76lJU=", "sku": "de.test.subscription", "purchaseDate": "Mon Mar 30 11:38:15 MESZ 2015", "itemType": "SUBSCRIPTION", "receiptId": "q1YqVrJSSknVK0ktLtEr...
/** * @file rule: protocol-omitted-in-href * @author Oleg Krivtsov <oleg@webmarketingroi.com.au> */ module.exports = { name: 'protocol-omitted-in-href', desc: 'Protocol (http:// or https://) should be omitted from href attribute (there should be "//" instead)', target: 'parser', lint: function (...
version https://git-lfs.github.com/spec/v1 oid sha256:d00a5ba00515a8d20d9a3ac24b44e46a8c310ce2d41485af244e711f4ed38830 size 3138
// Copyright (c) 2011 David Benjamin. All rights reserved. // Use of this source code is governed by an MIT-style license that can be // found in the LICENSE file. function positioned(elem) { var position = window.getComputedStyle(elem).position; return (position === "absolute" || position === "rel...
/*! * artDialog * Date: 2014-06-29 * https://github.com/aui/artDialog * (c) 2009-2013 TangBin, http://www.planeArt.cn * * This is licensed under the GNU LGPL, version 2.1 or later. * For details, see: http://www.gnu.org/licenses/lgpl-2.1.html */ define(['jquery', 'libs/jquery.art-dialog/6.0.0/popup', 'libs/jque...
'use strict'; // Call this function when the page loads (the "ready" event) $(document).ready(function() { initializePage(); }) /* * Function that is called when the document is ready. */ function initializePage() { var isPlaying = false; var isPaused = false; var audio = new Audio('final.mp4'); function re...
import _ from 'lodash'; import React from 'react'; import { connect } from 'react-redux'; import postcardsActions from 'redux/modules/postcards/actions'; import PostcardBox from 'components/PostcardBox/PostcardBox'; const mapStateToProps = (state) => ({ postcards: state.postcards }); export class HomeView extends...
// Copyright (c) 2000-2011 Quadralay Corporation. All rights reserved. // // Load book TOC // WWHFrame.WWHOutline.fInitLoadBookTOC(WWHBookData_AddTOCEntries);
module.exports = { plugins: [ require('autoprefixer')({}), require('postcss-easysprites')({ imagePath: 'src/images/', spritePath: 'src/images' }), require('postcss-flexibility'),//для поддержки flexbox в ie 8 & 9 require('postcss-line-height-px-to-unitless')(), //line-height из px в чи...
// @flow /* eslint no-unused-vars: 0 react/no-multi-comp: 0 */ import React from 'react'; import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import type { CounterType } from './types'; import './style.scss'; import { increase, decrease, double } from './state'; export class App extends R...
/** * ShaderAbstract.js * * HTML5游戏开发者社区 QQ群:326492427 127759656 Email:siriushtml5@gmail.com * Copyright (c) 2011 Sirius2D www.Sirius2D.com www.html5gamedev.org * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software")...
import React from 'react'; import PropTypes from 'prop-types'; import { makeStyles } from '@material-ui/core/styles'; import Modal from '@material-ui/core/Modal'; import Backdrop from '@material-ui/core/Backdrop'; import { useSpring, animated } from 'react-spring/web.cjs'; // web.cjs is required for IE 11 support cons...
/* eslint-disable no-underscore-dangle */ import httpMocks from 'node-mocks-http'; import ApiError from './ApiError'; import NotImplementedError from './NotImplementedError'; import NotFoundError from './NotFoundError'; import UnauthorizedError from './UnauthorizedError'; import BadRequestError from './BadRequestError'...
'use strict'; var gulp = require('gulp'), istanbul = require('gulp-istanbul'), mocha = require('gulp-mocha'), jshint = require('gulp-jshint'), stylish = require('jshint-stylish'); var paths = { js: ['gulpfile.js', 'lib/**/*.js'], test: ['test/**/*.js'] }; gulp.task('mocha', function () { return...
import { css } from 'styled-components'; // import { boxShadow } from './box-shadow'; // import { // inputColorFocus, // inputBgFocus, // inputBorderColorFocus, // inputBoxShadowFocus // } from './defaultTheme'; // Form validation states // // Used in _forms.scss to generate the form validation CSS for warni...
var winston = require('winston'); var isWin = /^win/.test(process.platform); function getLogger(module) { var path = module.filename.split(isWin ? '\\' : '/').slice(-2).join(isWin ? '\\' : '/'); return new winston.Logger({ transports : [ new winston.transports.Console({ co...
'use strict'; /** * Module dependencies. */ var mongoose = require('mongoose'), Schema = mongoose.Schema; /** * Sport Schema */ var SportSchema = new Schema({ name: { type: String, default: '', required: 'Please fill Sport name', trim: true }, created: { type: Date, default: Date.now }, user: { ...
/** * A plugin to identify and validate heading tags (<h1>, <h2>, etc.) */ let $ = require("jquery"); let Plugin = require("../base"); let annotate = require("../shared/annotate")("headings"); let outlineItemTemplate = require("./outline-item.handlebars"); require("./style.less"); const ERRORS = { FIRST_NOT_H1...
window.onload = function() { var apiUrl = window.location.protocol + "//" + window.location.hostname + ":" + window.location.port + "/api"; var messages = document.getElementById("messages"); var submitButton = document.getElementById("submitButton"); var submitField = document.getElementById("submitField"); functio...
export Buy from './Buy'; export Sell from './Sell'; export Lease from './Lease'; export Rent from './Rent'; export Recruit from './Recruit'; export Apply from './Apply'; export BuyDetail from './BuyDetail'; export SellDetail from './SellDetail'; export LeaseDetail from './LeaseDetail'; export RentDetail from './RentD...
// Copyright Joyent, Inc. and other Node contributors. // // 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, modi...
/*! ** bauer-factory -- General utilities for nodejs. ** Copyright (c) 2014 Yuri Neves Silveira <http://yneves.com> ** Licensed under The MIT License <http://opensource.org/licenses/MIT> ** Distributed on <http://github.com/yneves/node-bauer-factory> */ // - ---------------------------------------------------------...
$(document).ready(function() { var select = $('#blog_id'); //Прячем нужный селект //Закомментировать при проверке, чтобы видно было что селект меняет значение $(select).hide(); //Создаём список после нужного селекта $(select).after('<div id="block_addtopicmod"><ul id="links_'+$(select).attr('id')+'"><...
import DS from 'ember-data'; import Ember from 'ember'; import timeUtil from '../util/time-util'; export default DS.Model.extend({ title: DS.attr('string'), description: DS.attr('string'), timeUnit: DS.attr('timeUnit', { defaultValue: timeUtil.defaultUnit }), createdDate: DS.attr('date', { defaultValu...
import React, {Component} from 'react'; import NavigationBar from './navigation_bar'; import { connect } from 'react-redux'; class App extends Component { constructor(props) { super(props); } render() { return ( <div> <NavigationBar /> {this.props.children} {/*Footer*/} ...
// this code is adapted from https://github.com/strongloop/node-foreman/blob/master/lib/envs.js function flattenJSON(json, delimiter, filter, interior) { var flattened = {}; var d = delimiter || "."; var keep_interior = false; if (filter && !(typeof filter === "function")) { keep_interior = filter; } el...
import React from 'react'; import AppBar from 'material-ui/AppBar'; import { Tabs, Tab } from 'material-ui/Tabs'; import { BrowserRouter as Router, Route, Link } from 'react-router-dom'; import About from '../routes/About'; import Graphs from '../routes/Graphs'; import Resources from '../routes/Resources'; impo...
const path = require('path'); const updateNotes = require(path.join(__dirname, './updateNotes')); /** * This class can be used to represent information about a release. * * @author Daniel Strebinger * @version 1.0 * */ class ReleaseInformation { /** * Initializes a new instance of the ReleaseInformatio...
let NeoPixel = { Adafruit_NeoPixel____init___n_p_t: ffi('Adafruit_NeoPixel * Adafruit_NeoPixel____init___n_p_t(uint16_t,uint8_t,uint8_t)'), Adafruit_NeoPixel__begin: ffi('Adafruit_NeoPixel * Adafruit_NeoPixel__begin(Adafruit_NeoPixel *)'), Adafruit_NeoPixel__setPixelColor_n_r_g_b: ffi('void Adafruit_NeoPixel__se...
// **************************** // PAGINATION var addPage = function(id) { // Page var $page = $('<ul>') .attr('data-id', id) .addClass('page'); $page.appendTo('#bookmarks-list'); // Pagination var $pagination = $('<li>') .attr('data-id', id) ...
function ButtonFactory() { this.AddTransaction = function(handler) { var button = document.createElement("input"); button.type = "button"; button.value = "+"; button.classList.add("addButton"); button.addEventListener('click', handler); return button; }; ...
//Load common code that includes config, then load the app logic for this page. require([ 'common' ], function ( _confg ) { //require(['app/main2']); JC.log( 'page2', JC.f.ts() ); });
"use strict"; var html = require("./support/html"); var perspective = require("./perspective"); var Tolerance = 0.0001; describe("perspective", function () { var $camera; var $viewpane; var camera; var position; function setPosition(x, y, z) { position.x = x; position.y = y; ...
/** @namespace photon.ui */ provide("photon.ui");
export default { data () { return { pointer: 0, visibleElements: this.maxHeight / this.optionHeight } }, props: { /** * Enable/disable highlighting of the pointed value. * @type {Boolean} * @default true */ showPointer: { type: Boolean, default: true ...
var runCounter = 0, getCounter = function() { runCounter++; return runCounter; }, simpleTask = function() { var task = function(cb) { if(task.shouldPause) { task.cb = cb; } else { task.counter = getCounter(); cb(); } }; task.shouldPause = false; task.counter = -1; //noinspection Re...
define('dashboard', ["jquery", "require"], function($, require) { var dashboard = function(config) { var me = this; // me._id = config.id; me._col = config.column; me._row = config.row; me._renderToDivId = config.renderTo; // me._class = config.class; return this; }; /*config paremet...
var actions=require("./base/action"); var server = require("./../server"); var util=require("./../util/util"); module.exports= { command: "add", desc: "add a project to the server", paras: ['projectName','projectPath'], fn: function (parameters, cellmapping, allmapping) { var projectName=paramet...
function DayEventRenderer() { var t = this; // exports t.renderDayEvents = renderDayEvents; t.draggableDayEvent = draggableDayEvent; // made public so that subclasses can override t.resizableDayEvent = resizableDayEvent; // " // imports var opt = t.opt; var trigger = t.trigger; var isEventDraggab...
export default (state={}, action={}) => { switch(action.type) { case 'RECEIVE_ITEM': const item = action.data; let nextState = Object.assign({}, state); nextState[item.id] = item; return nextState; default: return state; } }; export const getById = (state, id) => state[i...
var uuid = require('node-uuid') var stackEventsMock = {} // creates date with time in future passed as param (int from -INT_MAX to +INT_MAX) // the reason for doing this is bc function createMockDate (timeInFuture) { timeInFuture = timeInFuture || 0 var mockDate = new Date(Date.now() + timeInFuture) return mockD...
import { merge } from '@ember/polyfills' import { isPresent, typeOf } from '@ember/utils' import Mixin from '@ember/object/mixin' import { underscore } from '@ember/string' import RouteMixin from 'ember-cli-pagination/remote/route-mixin' import { task, timeout } from 'ember-concurrency' import Ember from 'ember' expor...
$(document).ready(function() { // Set up datatables to work nicely with Bootstrap $.extend( $.fn.dataTableExt.oStdClasses, { "sSortAsc": "header headerSortDown", "sSortDesc": "header headerSortUp", "sSortable": "header" }); refreshLibrary(); refreshPlaylist(); }); function refreshLibrary() { $...
/** * Created by dcorns on 5/22/14. */ var Backbone = require('backbone'); var $ = require('jquery'); Backbone.$ = $; var User = require('../models/usermdl'); module.exports = Backbone.Collection.extend({ model: User, url: '/api/users' });
define(function() { 'use strict'; var _merge = function(seqs) { var result = []; while (true) { var nonemptyseqs = seqs.filter(function(seq) { return seq && seq.length; }); if (!nonemptyseqs.length) { return result; } var candidate; //find merge candidates among seq heads none...
"use strict"; Package.describe({ summary: "A roles based account management system using bootstrap 3", version: "0.2.8", git: "https://github.com/hharnisc/meteor-accounts-admin-ui-bootstrap-3.git", name: 'accounts-admin-ui-bootstrap-3' }); Package.onUse(function (api) { api.versionsFrom("METEOR@0.9.0"); ap...
var globi = require('globi'); require('jquery-ui'); module.exports = { bundle: require('globi-bundle'), panels: require('globi-panels'), Spinner: require('spin.js'), hairball: require('globi-hairball'), wheel: require('globi-wheel'), spatialSelector: require('globi-spatial-selector'), glob...
"use strict"; /* * grunt-hogan-example * https://github.com/automatonic/grunt-hogan * * Copyright (c) 2013 Elliott B. Edwards * Licensed under the MIT license. */ exports.awesome = function() { return 'awesome'; };
var __reflect = (this && this.__reflect) || function (p, c, t) { p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t; }; var __extends = this && this.__extends || function __extends(t, e) { function r() { this.constructor = t; } for (var i in e) e.hasOwnProperty(i) &&...
zeus.controller('ProjectCreateController', function ($scope, $state, Project) { $scope.project = {}; var state = {processing: true}; $scope.createProject = function () { state.processing = true; var project = new Project($scope.project); project.$post({name: ''}, function (obj) { ...
/** * Module dependencies. */ var express = require('express'); var http = require('http'); var path = require('path'); var fs = require('fs'); ///athentication var app = express(); var allowCrossDomain = function(req, res, next) { console.log(req.url); res.header('Access-Control-Allow-Origin', '*'); res.h...
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const article_1 = require("./article"); const db_1 = __importDefault(require("../../testing/mock/d...
(function() { /** * Filter view to handle the execution filters */ var FilterView = MiniRox.TooltipableView.extend({ filters: [], ui: { filter: '#filterField', filterElements: '.filter-elements' }, /** * Define the list of icons for GUI improvement when filters are defined */ icons: { k...
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class DemolishedStates { constructor() { this.states = new Map(); this.listeners = new Map(); } add(key) { this.states.set(key, false); return this; } set(key, value) { this.states.se...
Meteor.publish("events", function () { return Events.find(); }); // Events.allow({ // insert: function(doc) { // }, // // update: function(userId, doc) { // } // });
// simple "factory" method to load the templates into the views using the directives (function() { // define here all view bindings var views = [ { div : 'formSize', template: 'views/form.size.html' }, { div : 'formType', template: 'views/form.type.html' }, { div : 'formColors', template: 'views/for...
'use strict'; import User from './user.model'; import config from '../../config/environment'; import jwt from 'jsonwebtoken'; function validationError(res, statusCode) { statusCode = statusCode || 422; return function(err) { return res.status(statusCode).json(err); }; } function handleError(res, statusCode...
function distanceBetweenPoints(x1, y1, x2, y2) { let pointA = {x:x1, y:y1}; let pointB = {x:x2, y:y2}; let distanceX = Math.pow(pointA.x - pointB.x, 2); let distanceY = Math.pow(pointA.y - pointB.y, 2); return Math.sqrt(distanceX + distanceY); } console.log(distanceBetweenPoints(2.34, 15.66, -13....
import React from 'react'; const HighlightOff = (props) => <svg {...props} viewBox="0 0 24 24"><path d="M14.59 8L12 10.59 9.41 8 8 9.41 10.59 12 8 14.59 9.41 16 12 13.41 14.59 16 16 14.59 13.41 12 16 9.41 14.59 8zM12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.5...
import { createTest, createVue, triggerEvent, destroyVM } from '../util'; import Select from 'packages/select'; describe('Select', () => { const getSelectVm = (configs = {}, options) => { ['multiple', 'clearable', 'filterable', 'allowCreate', 'remote'].forEach(config => { configs[config] = configs[config] ...
if (typeof define !== 'function') { var define = require('amdefine')(module); } define([ 'underscore', './Base', 'mongoose', './util' ], function (_, Base, mongoose, util) { return Base.extend({ // PRIVATE /** * ctor, Schema * @params {obj} options ...
/** * Created by johan on 25/03/15. */ // // Johan Coppieters - jan 2013 - Cody CMS // // empty website for Cody CMS // // var cody = require("cody"); var express = cody.express; var fs = cody.fs; var path = require("path"); cody.server = express(); var bodyParser = cody.bodyParser; var expressSession = cody.expre...
(function () { var context; module("Unit.LoadStrategies.adhoc", { setup: function () { context = Test.Unit.context(); } }); test("loader.get is called for each resource", function () { T.LoadStrategies.adhoc({ path: 'new' }, context); ok(context.loader.get.calledThrice); ...
/** * trim leading zero * @author sarkiroka on 2017.04.08. */ var leadingZeroRegex = /^0+([^.])/; module.exports = function (number) { var retValue = number.replace(leadingZeroRegex, '$1'); return retValue; };
/* * grunt-faker * https://github.com/chrisocast/grunt-faker * * Copyright (c) 2013 Chris Cast * Licensed under the MIT license. */ 'use strict'; module.exports = function(grunt) { var path = require('path'); var Faker = require('Faker'); //Loop through entire json object function processJson(obj) { ...
#!/bin/env node /*jslint node: true, stupid: true */ // OpenShift sample Node application var express = require('express'), http = require('http'), bodyParser = require('body-parser'), fs = require('fs'); /** * Define the sample application. */ var SampleApp = function () { // Scope. var sel...
(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 + "'"); ...
import express from 'express'; import bodyParser from 'body-parser'; import logger from 'morgan'; import mongoose from 'mongoose'; import methodOverride from 'method-override'; const app = express(); const PORT = process.env.PORT || 3000; // Run Morgan for Logging app.use(logger('dev')); app.use(bodyParser.json()); ...
/* * Geddy JavaScript Web development framework * Copyright 2112 Matthew Eernisse (mde@fleegix.org) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/l...
var selectify = require('./index.js') var selection = selectify([ {id: 'apple', className: 'fruit'}, {id: 'orange', className: 'fruit'} ]) selection.style({color: 'rgb(255, 0, 0)'}) selection.classed('citrus', function (d) { return d.id === 'orange' }) selection.each(function (d) { console.log('id: ' + d.id) ...
const Sequelize = require('sequelize') const db = require('../db/index') const models = require('../db/models/index') async function getItems () { let items try { items = await models.Item.findAll({ include: [{ model: models.Product, where: Sequelize.where(Sequelize.col('product.id'), Seq...
$(document).ready(function(){ $('.scrollspy').scrollSpy(); });