Skip to content

Instantly share code, notes, and snippets.

View nicolasembleton's full-sized avatar
🏠
Working from home

Nicolas Embleton nicolasembleton

🏠
Working from home
View GitHub Profile
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
authRouteProvider.$inject = ['$routeProvider'];
function authRouteProvider ($routeProvider) {
/**
* Creates a controller bound to the route, or wraps the controller in param
* so the authentication check is run before the original controller is executed
* @param currentController
* @return {Function} The wrapper controller
*/
function redirectCtrlFactory (currentController) {
_ctrl.$inject = ['currentUser__', 'userRole__', '$location'];
@nicolasembleton
nicolasembleton / alert-call.xml
Last active April 8, 2018 02:02
Alert call from Twillio
<Response>
<Say voice="alice">Attention! This is not a drill! A system is currently down and requires immediate attention!</Say>
<Play>https://drive.google.com/file/d/0B_HuLKg9LOdcRE9icmt4cGExRk0/view</Play>
</Response>
@nicolasembleton
nicolasembleton / alert-call.json
Last active April 8, 2018 02:02
Alert call JSON
[
{
"action": "talk",
"voiceName": "Kendra",
"text": "Attention! This is not a drill! A system is currently down and requires immediate attention!,,,,",
"loop": 5
}
]
Verifying my Blockstack ID is secured with the address 1EXqAhrxpjkq1B18FmVmReGZaUZV8V91QZ https://explorer.blockstack.org/address/1EXqAhrxpjkq1B18FmVmReGZaUZV8V91QZ

Keybase proof

I hereby claim:

  • I am nicolasembleton on github.
  • I am nicolasembleton (https://keybase.io/nicolasembleton) on keybase.
  • I have a public key ASDpZ9t6KREhhn-Zg6W2KPa-7bbsKJqMRGNCl0beIos4Rwo

To claim this, I am signing this object:

/*
fileExistSync - Check if a file exist in NodeJS
Twitter: @FGRibreau / fgribreau.com
Usage:
var fileExistSync = require('./fileExistSync');
var exist = fileExistSync('/var/folders/zm/jmjb49l172g6g/T/65b199');
Support for Nodev0.6
@nicolasembleton
nicolasembleton / gist:5d756227a72465cb11cc
Created April 8, 2015 06:46
[REGEX] Convert JSON to CSV
^\s+\{\s+"field1" : "([^"]+)",\s+"field2" : "([^,]+)",\s+"field3" : "([^"]+)",\s+"field4" : "([^"]+)",\s+"field5" : (\d+)\s+\},?\s?
m = function () {
emit(this.ID, 1);
}
r = function (k, vals) {
return Array.sum(vals);
}
db.Vehicle.mapReduce(m, r, {out: {inline: 1}, query: {value: {$gt: 1}}})
var baseUrl = 'https://api.parse.com/1',
appId = 'XXXXXXXXXXXXXXX',
apiKey = 'XXXXXXXXXXXXXX'; // make sure to use the REST API Key
var _register = function(params, lambda, lambdaerror) {
var method = 'POST',
url = baseUrl + '/installations',
payload = (params) ? JSON.stringify(params) : '';
_helper(url, method, payload, function(data, status) {