This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('supertest'), | |
should = require('should'), | |
app = require('../server'); | |
var Cookies; | |
describe('Functional Test <Sessions>:', function () { | |
it('should create user session for valid user', function (done) { | |
request(app) | |
.post('/v1/sessions') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* `objFromFlatKeys` Convert the template string into a tree path and set the value into the referenced object path. | |
* | |
* @param {string} strPath - template string path to convert in nested object tree | |
* @param {Object} prevobj - reference for the nested object result | |
* @param {*} value - value to set at the end of the nested object tree | |
* | |
* @example | |
* // define the target object | |
* const obj = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
COOKIE_TMP_FILE=".tmp_cookie" | |
USER_EMAIL="foo@example.com" | |
USER_PASSWORD="123" | |
CLIENT_ID="XXXXXXXXXXXXXXXXXXXXXXXX" | |
CLIENT_SECRET="abc123" | |
REDIRECT_URI="http://localhost:3000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mockAsyncProcess = (objToProcess) => { | |
console.time(objToProcess.id) | |
console.log(`BEGIN: ${objToProcess.id}`) | |
return new Promise((resolve) => { | |
setTimeout(() => { | |
resolve(`RESULT -> ${objToProcess.id}`); | |
console.timeEnd(objToProcess.id) | |
console.log(`END: ${objToProcess.id}`) | |
}, Math.random() * 1000) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
mkdir -p ./app | |
echo '{ | |
"name": "my-project", | |
"version": "0.0.0", | |
"scripts": { | |
"dev": "webpack-recipes devserver 9000", | |
"build": "webpack-recipes build --mode=production" | |
}, | |
"devDependencies": { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
'use strict'; | |
var dynamicStates = function ($stateProvider, $urlRouterProvider) { | |
var addRoute = function (name, definition) { | |
$stateProvider.state(name, definition); | |
}; | |
$urlRouterProvider.deferIntercept(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"state-one": { | |
"controller": "stateOneController", | |
"template": "<h1>State One</h1>" | |
}, | |
"state-two": { | |
"controller": "stateTwoController", | |
"template": "<h1>State Two</h1>" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var parseTrack = function (data) { | |
var trackLines = data.replace(/[\r\n]/g, '').replace(/<\/tr>/gi, '</tr>\n').match(/<tr.*?>(.*)<\/tr>/gi); | |
trackLines.shift(); | |
var parsed = [], parts = []; | |
var length = trackLines.length; | |
var details, date, track; | |
while (length--) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var _eventsStack = {}; | |
window.Events = { | |
emit: function (eventName, message) { | |
if (!_eventsStack.hasOwnProperty(eventName)) { | |
_eventsStack[eventName] = []; | |
} | |
_eventsStack[eventName].forEach(function (fn) { | |
fn(message != undefined ? message : {}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gulp = require('gulp'); | |
var gutil = require('gulp-util'); | |
var shell = require('gulp-shell'); | |
var download = require('gulp-download'); | |
var unzip = require('gulp-unzip'); | |
var clean = require('gulp-clean'); | |
var runSequence = require('gulp-run-sequence'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var et = require('elementtree'); |
NewerOlder