code stringlengths 2 1.05M |
|---|
const fs = require('fs');
module.exports = function insertSiteSettings(htmlPath, settings) {
const origHtml = fs.readFileSync(htmlPath, { encoding: 'utf8' });
const html = replaceTitle(origHtml, settings);
const scriptIndex = html.indexOf('<script');
const analyticsCode = settings.trackingId ? ... |
//========================================================================
// not necessary to include just to check wether the prefixes work or not
//========================================================================
// In the following line, you should include the prefixes of implementations you want to test.
... |
import AbstractEnum from './AbstractEnum';
/**
* Keys of contract fields.
*/
export default class ContractAttributeEnum extends AbstractEnum {
static getNiceLabel(key) {
return super.getNiceLabel(`core:enums.ContractAttributeEnum.${key}`);
}
static getHelpBlockLabel(key) {
return super.getNiceLabel(`... |
import { postReviews, parseErrors } from '../adapters/creameryApi'
export const ADD_REVIEW = 'ADD_REVIEW'
export const ADD_REVIEW_SUCCESS = 'ADD_REVIEW_SUCCESS'
export const ADD_REVIEW_ERROR = 'ADD_REVIEW_ERROR'
function initiateAddReview() {
return {
type: ADD_REVIEW
}
}
function addReviewSuccess(... |
// AFRIKADIAL
var baseUrl = 'http://jalapenodigital.co.za/images/Africa-flags/';
var dialObj = {
//CENTRAL AFRICA
AO: {flag: baseUrl + 'ao.png',name: 'Angola',area_code: '+244'},
CM: {flag: baseUrl + 'cm.png',name: 'Cameroon',area_code: '+237'},
CF: {flag: baseUrl + 'cf.png',name: 'Central African... |
var gulp = require('gulp')
var webserver = require('gulp-webserver');
var concat = require('gulp-concat');
var jshint = require('gulp-jshint');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
var cleanCSS = require('gulp-clean-css');
var plumber = require('gulp-plumber');
var metagenerator = requ... |
(function() {
'use strict';
module.exports = function() {
var service = global.io.rootPath + 'back-end/routes/restApi/apImpl/services/';
var config = {
settings : require(service + 'settings'),
user : require(service + 'user'),
upload : require(service + 'upload')
};
re... |
'use strict'
const { Command } = require('discord.js-commando');
const { MessageEmbed } = require('discord.js');
const config = require('config.json')('./config.json');
module.exports = class RolesCommand extends Command {
constructor(client) {
super(client, {
name: 'roles',
group:... |
datab = [{},{"IE":{"colspan":"1","rowspan":"1","text":"Image"},"Module":{"colspan":"1","rowspan":"1","text":"XA/XRF Acquisition"},"PS3.3 Reference":{"colspan":"1","rowspan":"1","text":""},"Usage":{"colspan":"1","rowspan":"1","text":"Specifies the type of detector."}},{"IE":{"colspan":"1","rowspan":"1","text":""},"Modul... |
from collections import OrderedDict as od
def first_non_repeated(s):
d=od()
for c in s:
try: d[c]+=1
except:d[c]=1
for key,val in d.items():
if val==1: return key
|
import _ from "lodash";
import fetch from "cross-fetch";
import moment from "moment-timezone";
export const ACCEPTED_FILE_TYPES = [
"image/*",
"audio/x-wav",
"audio/wav",
"audio/wave",
"audio/mp3",
"audio/mpeg",
"audio/x-mp3",
"audio/mp4",
"audio/x-m4a",
"audio/amr"
].join( ", " );
export const MA... |
'use strict';
angular.module('grubUpClientApp')
.config(function ($routeProvider) {
$routeProvider
.when('/menu', {
templateUrl: 'app/menu/menu.html',
controller: 'MenuCtrl'
});
}); |
var structspp___1_1_combiner_3_01_t_00_014_01_4 =
[
[ "operator()", "structspp___1_1_combiner_3_01_t_00_014_01_4.html#aeacf87124749fd2f7269e8e04dcb410a", null ]
]; |
'use strict';
describe('Controller: PlanningSprintCtrl', function () {
// load the controller's module
beforeEach(module('globalgamejam2015App'));
var PlanningSprintCtrl,
scope;
// Initialize the controller and a mock scope
beforeEach(inject(function ($controller, $rootScope) {
scope = $rootScope.... |
/*! JSON Editor v0.7.28 - JSON Schema -> HTML Editor
* By Jeremy Dorn - https://github.com/jdorn/json-editor/
* Released under the MIT license
*
* Date: 2016-08-07
*/
/**
* See README.md for requirements and usage info
*/
(function() {
/*jshint loopfunc: true */
/* Simple JavaScript Inheritance
* By John Res... |
/**
* Created by Jan on 1/6/16.
*/
$(document).ready(function(){
$('#regCaptcha').keyup(function(){
if($('#regCaptcha').val() == $('#captchaImg').data('code')){
$('#regBtn').removeAttr('disabled');
$('#errorSpan').empty();
$('#successSpan').empty().append('<i class="fa f... |
/**
* Created by Kirsten on 2/11/2015. Adds input functionality to the game.
*
*/
window.uwetech.Input = (function () {
var keys = {};
window.addEventListener('keydown', function (e) {
keys[e.keyCode] = true;
});
window.addEventListener('keyup', function (e) {
delete keys[e.keyCod... |
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.xnt=t():e.xnt=t()}(this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={exports:{},id:n,loaded:!1};return e[n].call(... |
import adapter from '@sveltejs/adapter-static';
export default {
kit: {
adapter: adapter({
// default options are shown
pages: 'build',
assets: 'build',
fallback: null
})
}
}; |
'use strict';
var _templateObject = _taggedTemplateLiteral(['this is string ', ''], ['this is string ', '']);
function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
var Tool = require('../tool');
// notes: define back-tick as... |
import React from 'react';
import {
Text,
View,
TouchableOpacity,
Dimensions,
Image
} from 'react-native';
import styles from '../../themes/styles';
import mystyles from './styles';
import{
Container,
Header,
Title,
Button
} from 'native-base';
import {
Actions
} from 'react-native-router-flux';
im... |
import React, { Component } from 'react';
import { Table, Header, Image, Button } from 'semantic-ui-react';
import axios from 'axios';
export default class AdministratorTableStudents extends Component {
constructor () {
super();
this.state = {
students: []
}
}
componentWillMount () {
const... |
//
// Wraps a Joi type in a magical Proxy API so that we can extend Joi to do
// CRUD validations, e.g.
//
// ```
// {
// _id: id()
// .on('update').required()
// .on('create').forbidden()
// }
// ````
//
const joi = require('joi')
const mongo = require('promised-mongo')
const { each } = require('lodash')
co... |
'use strict';
adsApp.controller('HomeCtrl', ['$scope', 'adsData', 'authService', 'notificationService', 'pageSize',
function($scope, adsData, authService, notificationService, pageSize) {
$scope.pageTitle = 'Home';
$scope.isLoggedIn = authService.isLoggedIn();
$scope.adsParams = {
... |
import { Modal, message } from 'antd'
import React from 'react'
import ReactDOM from 'react-dom'
import classnames from 'classnames'
import styles from './layer.less'
const { info, success, error, warning, confirm } = Modal
const layer = {
prefixCls: 'ant-layer',
index: 1,
info,
success,
error,
warning,
... |
'use strict';
var bygglib = require('../lib');
var mime = require('mime');
var path = require('path');
var vfs = require('vinyl-fs');
module.exports = function (options) {
options = (typeof options === 'string') ? { src: options } : options;
var src = (typeof options.src === 'string') ? [options.src] : optio... |
(function(root, models, depHandler) {
var viewModel = function() {
var self = this;
// må pushe objecter med minimum en prop kalt name i programs og
// programStages
// Kan være lurt å ha en model som ser slik ut kanskje: {name: "Navnet",
// id: "idsomething"}s
self.programs = ko.observableArray();
self... |
define([
'sandbox',
'aura_perms',
'./collectionView',
'./collection'
], function(sandbox, permissions, AppView, payments) {
return function(options) {
var element = sandbox.dom.find(options.element);
new AppView({ collection: sandbox.collection, el: element });
};
});
|
/* */
"format cjs";
import warning from 'warning';
const dayAbbreviation = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];
const dayList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
const monthList = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
'Oct', 'Nov', 'Dec'];
const monthLongList = ['January',... |
/**************************************************************************************
Aria Leave action
Take a call out of a queue.
NOT YET IMPLEMENTED
**************************************************************************************/
twimlActions.Leave = function(command, callback) {
... |
function Coin(parValue, count) {
this.ParValue = ko.observable(parValue);
this.Count = ko.observable(count);
}
function CoinDto(parValue, count) {
this.ParValue = parValue;
this.Count = count;
} |
/*
* Fuel UX Spinner
* https://github.com/ExactTarget/fuelux
*
* Copyright (c) 2012 ExactTarget
* Licensed under the MIT license.
*/
!function (e) {
var t = function (t, i) {
this.$element = e(t), this.options = e.extend({}, e.fn.spinner.defaults, i), this.$input = this.$element.find(".spin... |
// Generated by CoffeeScript 1.4.0
(function() {
define("personBio", function() {
var bio, display, formatBio, get;
bio = null;
get = function(personName, callBack) {
var settings;
settings = {
url: "http://en.wikipedia.org/w/api.php?action=parse&page=" + personName + "§ion=0&form... |
/**
* @author mikael emtinger / http://gomo.se/
* @author alteredq / http://alteredqualia.com/
* @author WestLangley / http://github.com/WestLangley
* @author bhouston / http://exocortex.com
*/
THREE.Quaternion = function ( x, y, z, w ) {
this._x = x || 0;
this._y = y || 0;
this._z = z || 0;
this._w = ( w !=... |
const mongoose = require('mongoose') //.set('debug', true)
const bcrypt = require('bcryptjs')
const ip = require('ip')
const fs = require('fs')
const os = require('os')
const splitca = require('split-ca')
const logger = require('../modules/logger')
const config = require('../config/config')
const encrypt = require('..... |
'use strict';
/**
* Removes server error when user updates input
*/
angular.module('flickrScannerApp')
.directive('mongooseError', function() {
return {
restrict: 'A',
require: 'ngModel',
link: function(scope, element, attrs, ngModel) {
element.on('keydown', () => ngModel.$setValidity... |
// All material copyright ESRI, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.16/esri/copyright.txt for details.
//>>built
define(["require","exports"],function(k,e){Object.defineProperty(e,"__esModule",{value:!0});e.applyToModelMatrix=function(b,a){var c=-b[0],d=-b[1];b=-b[2];var e=a[... |
import hasTransitions from 'ember-modal-service/utils/css-transitions/has-transitions';
import { module, test } from 'qunit';
import { createElement, clearScenario } from './helpers';
module('Unit | Util | css-transitions | has-transitions', (hooks) => {
hooks.afterEach(() => {
clearScenario();
});
test('it retu... |
// // randomColor by David Merfield under the MIT license
// // https://github.com/davidmerfield/randomColor/
// ;(function(root, factory) {
// // Support AMD
// if (typeof define === 'function' && define.amd) {
// define([], factory);
// // Support CommonJS
// } else if (typeof exports === 'object') {
/... |
/*
Dice rolls, coin flips, 8balls, syncwatch, banners, JS injections, missle
launchers - amusement.
*/
const common = require('../common/index'),
config = require('../config'),
db = require('../db'),
fs = require('fs'),
hooks = require('../util/hooks'),
state = require('./state'),
push = require('./websocket... |
var path = require("path"),
app = require(path.join(__dirname, "../server")),
request = require("supertest"),
assert = require("chai").assert,
helper = require(__dirname + "/helper")
async = require("async");
describe("Postcodes routes", function () {
var testPostcode;
before(function (done) {
this.time... |
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModu... |
var Base64={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(input){var output="";var chr1,chr2,chr3,enc1,enc2,enc3,enc4;var i=0;input=Base64._utf8_encode(input);while(i<input.length){chr1=input.charCodeAt(i++);chr2=input.charCodeAt(i++);chr3=input.charCodeAt(i++);enc1=chr1>>2... |
(function () {
'use strict';
angular.module('cd.app.platform')
.factory('PlatformService', PlatformService);
PlatformService.$inject = ['$http'];
function PlatformService ($http) {
var service = {
getPlatforms: getPlatforms
};
return service;
func... |
module.exports = {
BOARD_URL: 'https://www.reddit.com/api/place/board-bitmap',
BOARD_FILE: __dirname + '/tmp/board.bmp',
REMOTE_TARGET_URL: 'https://raw.githubusercontent.com/Zequez/reddit-placebot/master/images/target.png',
REMOTE_TARGET_FILE: __dirname + '/tmp/remote_target',
LOCAL_TARGET_FILE: __dirname ... |
'use strict';
/*jshint asi: true */
var test = require('tape')
var chunkRate = require('../')
, numbers = require('../test/fixtures/number-readable');
test('given a stream that emits numbers every 100 ms - total of 6, measuring rate per 200ms', function (t) {
var numbersStream = numbers({ to: 5, throttle: 100... |
describe('boilerplateConstants factory', function () {
var service;
beforeEach(function () {
angular.mock.module('boilerplate');
inject(function ($injector) {
service = $injector.get('boilerplateConstants');
});
});
it('Should check the constant values to be def... |
var class_yeah_1_1_fw_1_1_http_1_1_exception_1_1_unsupported_media_type_http_exception =
[
[ "__construct", "class_yeah_1_1_fw_1_1_http_1_1_exception_1_1_unsupported_media_type_http_exception.html#a7d2fe9612ef241479a4c10151d580249", null ]
]; |
import { A } from '@ember/array';
import Route from '@ember/routing/route';
export default Route.extend({
model() {
return A(Array.from({ length: 10 }).map((_, index) => `Section ${index}`));
}
});
|
#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
var inject = function(callback) {
// Just make each a 1 property object for demonstration
var services = {
$timeout: {name: 'timeout'},
$window: {name: 'window'}
};
// Find the service names to inject
var fu... |
#!/bin/sh
':' //; exec "$(command -v nodejs || command -v node)" "$0" "$@"
// The data
var vehicles = [
{name: 'mx-5', type: 'car', parts: ['engine', '4wheels']},
{name: 'ninja', type: 'motorcyle', parts: ['engine', '2wheels']},
{name: 'enzo', type: 'car', parts: ['engine', '4wheels']}
];
// The where function... |
var webpack = require('webpack'),
config = require('./webpack.config.js');
config.plugins.concat([
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin()
]);
module.exports = config;
|
/* @requires
mapshaper-common
mapshaper-geojson
mapshaper-topojson
mapshaper-shapefile
mapshaper-json-table
*/
// Parse content of one or more input files and return a dataset
// @obj: file data, indexed by file type
// File data objects have two properties:
// content: Buffer, ArrayBuffer, String or Object
// f... |
import React, { Component } from "react";
import { withStyles } from "@material-ui/core/styles";
const styles = theme => ({
root: {
display: "flex",
width: "100%",
},
});
class Container extends Component {
render() {
const { children, classes, ...props } = this.props;
return (
<div className={classes.r... |
// This loads the environment variables from the .env file
require('dotenv-extended').load();
var restify = require('restify');
var builder = require('botbuilder');
var locationDialog = require('botbuilder-location');
var strava = require('strava-v3');
var bingAPI = require('./Common/bingAPI.js');
var polyline = requi... |
require("./100.js");
require("./201.js");
require("./403.js");
require("./806.js");
module.exports = 807; |
'use strict';
define(function(require) {
var angular = require('angular');
var template = require('text!./selectUsers.tpl.html');
var SelectUsers = function(userService) {
return {
template: template,
restrict: 'E',
scope: {
... |
var Cube = {
initPoly: function () {
Poly.vertices = [
[[0], [0], [0]], [[0], [0], [100]], [[0], [100], [0]], [[0], [100], [100]],
[[100], [0], [0]], [[100], [0], [100]], [[100], [100], [0]], [[100], [100], [100]] //cube
];
Poly.lines = [
[0, 1], [0, 2],... |
$(document).ready(function(){
$('#showPedirProd').click(function () {
$('#modal-peticiones').modal('show');
});
$('#newProd').click(function () {
agregarNuevoProd ();
});
$("#solicitar").click(function () {
solicitar($(this).data('usu'),$(this).data('url'));
});
$('.list-group-item').click(function ... |
export const LABELS = {
kind: 'Kind',
interaction: 'Interaction',
serviceDelivery: 'Service delivery',
advisers: 'Adviser',
myInteractions: 'My interactions',
dateAfter: 'From',
dateBefore: 'To',
service: 'Service',
teams: 'Teams',
sector: 'Sector',
businessIntelligence: 'Business intelligence',
... |
import { Redirect } from 'content/types'
export let mount = (field, onDone) => {
onDone(new Redirect({
url: 'https://github.com/jessepollak/command/wiki/Getting-started',
target: '_blank'
}))
}
export let match = "help"
export let icon = require("./Help.png")
|
// process.env.NODE_ENV = false;
const path = require('path');
const fs = require('grunt').file;
const chokidar = require('chokidar');
const _ = require('lodash');
const Stylus = require('stylus');
const CSSO = require('csso')
const chalk = require('chalk')
let DIST_DIR = path.j... |
if (this.importScripts) {
importScripts('../../../resources/js-test.js');
importScripts('shared.js');
}
description("Test that a database is recreated correctly when an open-with-version call is queued behind both a deleteDatabase and an open-with-version call");
indexedDBTest(prepareDatabase, connection1Succ... |
var path = require('path');
var webpack = require('webpack');
var banner = require('./webpack.banner');
var TARGET = process.env.TARGET || null;
var externals = {
'react': {
root: 'React',
commonjs2: 'react',
commonjs: 'react',
amd: 'react'
},
'react-dom': {
root: 'ReactDOM',
commonjs2: '... |
export default function validatePassword(password) {
if (!password) {
return {
isValid: false,
error: "Passwords must contain four words and be at least 15 characters",
};
}
if (!password.match(/.+\s.+\s.+\s.+/)) {
return {
isValid: false,
... |
import React, { PropTypes } from 'react';
import '../styles/core.scss';
const propTypes = {
children: PropTypes.element,
};
function SimpleContainer(props) {
return (
<div>{props.children}</div>
);
}
SimpleContainer.propTypes = propTypes;
export default SimpleContainer;
|
var Log = require('./../../utils/Log.js');
var util = require('util');
var QueueProcessor = require('./../QueueProcessor');
var OAuth= require('oauth').OAuth;
var https = require('https');
/**
* InsufficientMetadataRemovalController
* @constructor
*/
function InsufficientMetadataRemovalController() {
var self ... |
module.exports = function(models, bot) {
return {
getJSON: function(req, res) {
res.json(Object.keys(bot.getPlugins()));
}
}
};
|
var sqleye = require ('./sqleye')
// *************** Our Parent & Child Bullseye object *************//
var beye = new sqleye( {pname: 'text', ppin: 'integer', pcode: 'text', pfname: 'text', pemail: 'text'},
[ 'pname', 'ppin' ],
'sqllite', 'client' )
var ceye = new sqle... |
var should = require('should');
var getAnalysis= require('../src/interfaceToBunte').getAnalysis;
describe('Bunte API', function () {
it('should return data from Bunte', function (next) {
getAnalysis(function(error, response) {
next();
return; // requires Bunte Api to be up and runn... |
import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: ['overflowHidden:overflow-hidden'],
classNames: ['skills'],
tagName: 'ul',
sortByTitle: ['title:asc'],
userSkillsService: Ember.inject.service('user-skills'),
alphaSkills: Ember.computed.sort('skills', 'sortByTitle'),
... |
/**
* Created by Wayne on 15/7/9.
*/
'use strict';
var mongoose = require('mongoose'),
Schema = mongoose.Schema,
timestamps = require('mongoose-timestamp');
module.exports = function (appDb) {
var OrderOptionSchema = new Schema({
//强制进场
must_entrance: {
type: Boolean,
default: false
... |
exports.padLeft = function () {
return function (input, length, using, options) {
options = arguments[arguments.length - 1];
switch (arguments.length) {
case 1:
if (!options.fn) {
throw new Error('Handlebars Helper "padLeft" needs 2 parameters minimum');
} else {
input = options.fn(this);
leng... |
{
"metadata" :
{
"formatVersion" : 3,
"generatedBy" : "Blender 2.60 Exporter",
"vertices" : 20,
"faces" : 18,
"normals" : 14,
"colors" : 0,
"uvs" : 0,
"materials" : 1,
"morphTargets" : 0
},
... |
var test = require('tape')
var cg = require('../')()
test('hex/rbg linear end-to-end', function (t) {
t.plan(2)
var ops = {
"nshades": 3
}
var hex = cg.colorgrad('#0000FF', '#FFFFFF', ops)
var rgb = cg.colorgrad([60,60,60], [120,120,120], ops)
var expectedhex = [ '#0000ff', '#8080ff', '#ffffff' ]
... |
import React from 'react';
import AppManagementPanel from './AppManagementPanel';
import Panel from '../Panel';
import { mount, shallow } from 'enzyme';
describe('(Component) AppManagementPanel', () => {
it('Shallow renders a Panel', () => {
const _component = shallow(<AppManagementPanel />);
expect(_compone... |
import enumerate from './generators/enumerate';
/**
* Returns the first value in a collection matched by the match function.
*
* @param collection - The collection to search through.
* @param match - The match function.
* @param from - Key to start searching.
* @param to - Key (exclusive) to st... |
MSG.title = "Webduino Blockly Chapter 1-1 : Lighting up an LED";
MSG.subTitle = "Chapter 1-1 : Lighting up an LED";
MSG.demoDescription = "Set up the stack to light up an LED and the bulb in image.";
|
'use strict';
const Immutable = require('immutable');
const validateValuesMap = (valuesMap) => {
const filteredValues = valuesMap.filter((value) => typeof value !== 'undefined');
const net = filteredValues.get('net');
const gross = filteredValues.get('gross');
const vat = filteredValues.get('vat');
const va... |
import React from 'react';
import { bindActionCreators } from 'redux';
import { Counter } from 'routes/Counter/components/Counter';
import { shallow } from 'enzyme';
describe('(Component) Counter', () => {
let _props, _spies, _wrapper;
beforeEach(() => {
_spies = {};
_props = {
cou... |
{
if (e && typeof e.stack === "string") {
e.stack = e.stack
.split("\n")
.map(function(line) {
return rewriteTraceLine(line, mapConsumers);
})
.join("\n");
}
}
|
Oskari.registerLocalization({
"lang": "fi",
"key": "GenericAdmin",
"value": {
"title": "Ylläpito",
"desc": "",
"tile": {
"title": "Ylläpito"
},
"flyout": {
"title": "Ylläpito",
"defaultviews" : {
"title" : "Oletusnäk... |
import {expect} from 'chai'
import path from 'path'
import fse from 'fs-extra'
import _ from 'lodash'
import * as utils from '../../dist/generators/utils'
describe('removeWholeLine', function () {
it('removes the whole line on which the given string appears', function () {
let line = '{\n User,\n Posts,\n Co... |
let data = {
'http://swapi.co/api/people/1': {
name: 'Luke Skywalker'
},
'http://swapi.co/api/films/1': {
title: 'A New Hope'
},
'http://swapi.co/api/starships/9': {
name: 'Death Star'
},
'http://swapi.co/api/vehicles/4': {
name: 'Sand Crawler'
},
'htt... |
var path = require('path');
var webpack = require('webpack');
// extract-text is used to extract CSS definitions into separate CSS file
var ExtractTextPlugin = require('extract-text-webpack-plugin');
// indexhtml is used to enable index.html as an entry point
var IndexHtmlPlugin = require('indexhtml-webpack-plugin');... |
var mongoose = require('mongoose')
var WorkSchema = require('../schemas/work')
var Work = mongoose.model('Work', WorkSchema)
module.exports = Work |
var products = [
"Brooklyn T-Shirt White",
"Brooklyn T-Shirt Black",
"Apple Watch",
"Android Phone"
];
var prices = [10, 10, 199, 159]
var productsText = "";
var productsElement = document.getElementById("product-list");
productsText += "<li class='list-group-item'><span class='badge'>$" + prices[0] +... |
import * as React from 'react';
import createSvgIcon from './utils/createSvgIcon';
export default createSvgIcon(
<React.Fragment><path d="M15.5 10.5h2v1h-2z" /><path d="M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-10 6.5H6.5v.75H9c.55 0 1 .45 1 1V14c0 .55-.45 1-1 1H5v-1.5h3.5v-.75H6c... |
function Draw(n) {
for (var i = 0; i < n; i++) {
var str = "";
for (var k = 0; k < i; k++) {
str += "**";
}
str = str.substring(0, str.length - 1);
console.log(str);
}
}
Draw(8);
|
var Acceptance = (function() {
//================================================================
// DSL function and public methods
//================================================================
var environment = function(rules) {
rules.apply(Root);
};
environment.rea... |
// Manipulating JavaScript Objects
// I worked on this challenge: [by myself, with: ]
// There is a section below where you will write your code.
// DO NOT ALTER THIS OBJECT BY ADDING ANYTHING WITHIN THE CURLY BRACES!
var terah = {
name: "Terah",
age: 32,
height: 66,
weight: 130,
hairColor: "brown",
eye... |
'use strict';
/* jshint ignore:start */
/**
* This code was generated by
* \ / _ _ _| _ _
* | (_)\/(_)(_|\/| |(/_ v1.0.0
* / /
*/
/* jshint ignore:end */
var Holodeck = require('../../../holodeck'); /* jshint ignore:line */
var Request = require(
'../../../../../lib/http/request'); /* ... |
var request = require('request');
request.post({
url: 'http://localhost:3000/endpoint/00000/emit/login/testmember',
json: true,
body: {
payload: 'Hello'
}
}, function(error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
});
|
var TIME_DOT = 0.1;
var TIME_DASH = 3 * TIME_DOT;
var TIME_BETWEEN_SYMBOLS = TIME_DOT;
var TIME_BETWEEN_LETTERS = TIME_DASH;
var TIME_BLANK = 7 * TIME_DOT;
var DOT = '.';
var DASH = '-';
var BLANK = ' ';
var ALPHABET = {
'a': '.-', 'b': '-...', 'c': '-.-.', 'd': '-..',
'e': '.', 'f': '..-.', 'g': '--.... |
'use strict';
angular.module('com.module.tickets')
.config(function ($stateProvider) {
$stateProvider
.state('app.tickets', {
abstract: true,
url: '/tickets',
templateUrl: 'modules/tickets/views/main.html'
})
.state('app.tickets.list', {
url: '',
templateU... |
'use strict';
const extractText = require('extract-text-webpack-plugin');
const path = require('path');
const webpack = require('webpack');
module.exports = env => {
const config = {
entry: './src/js/app.js',
module: {
rules: [
{
include: path.resolve(__dirname, 'src/js'),
... |
export default {
comments: [],
create(comment) {
this.comments.push(comment);
},
};
export const ioc = { };
|
require.config({
baseUrl: '/Scripts',
paths: {
"jquery": "jquery-2.0.3.min",
"bootstrap": "bootstrap.min",
"ko": "knockout-3.0.0",
"signalr": "jquery.signalR-1.2.0.min",
"signalr-hubs": "/signalr/hubs?_",
"json": "json2.min",
"underscore": "underscore-ex... |
var initSidebar = function () {
var getHierarchy = function (coursepath) {
var xmlDom = loadXmlFile(coursepath + "course.xml");
xmlDom = xmlDom.getElementsByTagName("course")[0];
var url_name = xmlDom.getAttribute("url_name");
xmlDom = loadXmlFile(coursepath + "course/" + url_name +... |
jQuery.fn.customList = function (defaults) {
var element = this;
var options = {
elements: {
methodModels: '.c-list-method',
reqUrl: '.c-list-url',
nextAction: '.c-list-next',
contentContainer: '.c-list-content',
contentItem: '.c-list-c-item'... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.