This file contains hidden or 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
{ | |
"container": "atl", | |
"head": "079d75659f6e8e88e17d219095329b36", | |
"contents": { | |
"b3eec16119413f83132c63095c59a0fa": { | |
"name": "02", | |
"hash": "b3eec16119413f83132c63095c59a0fa", | |
"files": [ | |
{ | |
"name": "another.js", |
This file contains hidden or 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
module.exports = function(app){ | |
app.express.use(function(req, res, next){ | |
// initialise rethink connection | |
if(!app.rethinkdb){ | |
return next(); | |
} | |
app.rethinkdb.connect(function(err, r, conn, rethinkNext){ | |
if(err){ | |
return res.error('DB Error', err).end(); | |
} |
This file contains hidden or 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
'use strict'; | |
var io = require('socket.io'), | |
express = require('express'), | |
http = require('http'), | |
https = require('https'), | |
fs = require('fs'), | |
splitca = require('split-ca'); | |
module.exports = function(){ |
This file contains hidden or 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 ejs = require('ejs'), | |
_ = require('lodash'); | |
var util = require('util'); | |
app.engine('ejs', ejs.renderFile); | |
app.set('view engine', 'ejs'); | |
app.set('views', '/path/to/templates'); | |
app.use(function(req, res, next){ |
This file contains hidden or 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
new Date(dateString); |
This file contains hidden or 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 timestamp = '2000/01/01 00:00:00', | |
dates = [], | |
total = 1000, | |
i = 0, | |
pattern = new RegExp('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2})\.([0-9]{1,2})'); | |
var makeNiceDate = function(date, len){ // make sure our date formats are "01-01-2000" rather than "1-1-2000" | |
len = len || 2; | |
return String("0"+date).slice(-len); | |
} |
This file contains hidden or 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 pattern = new RegExp('([0-9]{4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2})\.([0-9]{1,2})'); | |
var parts = dates[i].match(pattern); | |
new Date(parts[1], parts[2], parts[3], parts[4], parts[5], parts[6]); |
This file contains hidden or 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
new Date(dates[i].slice(0, 4), dates[i].slice(5, 7), dates[i].slice(8, 10), dates[i].slice(11, 13), dates[i].slice(14, 16), dates[i].slice(17, 19)); |
This file contains hidden or 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 nodegit = require('nodegit'); | |
var opts = { | |
fetchOpts: { | |
callbacks: { | |
credentials: function() { | |
return nodegit.Cred.sshKeyNew('git', './ssh/id_rsa.pub', './ssh/id_rsa', ''); | |
}, | |
certificateCheck: function() { | |
return 1; |
This file contains hidden or 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
app.directive('verification', function($interval, $timeout){ | |
return { | |
scope: { | |
submit: '=' | |
}, | |
restrict: 'E', | |
template: '<div id="verificationPhone"></div>', | |
link: function($scope){ | |
let widget = null; | |
let setup = function(){ |