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
# modules | |
spawn = require('child_process').spawn | |
credentials = require('sauce-labs-credentials') | |
scPath = 'path/to/sc/bin' | |
R = require('ramda') | |
Q = require('q') | |
# global var | |
startDeferred = null | |
sc = null |
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 pairwise = function(arr) | |
{ | |
if (arr.length < 2){ return []; } | |
var first = arr[0], | |
sliced = arr.slice(1), | |
getPair = function(x){ return [first, x]; } | |
pairs = sliced.map(getPair); | |
return pairs.concat(createPossibilities(sliced)); |
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
function forEach(list, callback, endIndex) | |
{ | |
if (!list instanceof Array) console.error('forEach method accepts an instanceof Array as first parameter!') | |
var end = endIndex || list.length - 1, | |
args = [[list, callback, endIndex], Array.prototype.slice.call(arguments, 3)], | |
args = args.reduce(function(a,b){ return a.concat(b); }); | |
for(var i = 0; i <= end; i++) | |
{ |
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
Function.prototype.memoized = function(key) { | |
this._values = this._values || {}; | |
return this._values[key] !== undefined ? | |
this._values[key] : | |
this._values[key] = this.apply(this, arguments); | |
} | |
Function.prototype.memoize = function() { | |
var fn = this; | |
return 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 add = function() { | |
add.toString = function() { | |
console.log(add.total); | |
}; | |
add.reset = function() { | |
add.total = 0; | |
return add; | |
}; |
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
# spec/fixtures/usernames.rb | |
USERNAMES = ['hermione.granger', | |
'ron.weasley', | |
'harry.potter', | |
'fred.weasley', | |
'georges.weasley', | |
'luna.lovegood', | |
'ginny.weasley', | |
'draco.malfoy', | |
'albus.dumbledore', |
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
// This is just a short reminder of this great explanation: | |
// http://www.2ality.com/2015/06/tail-call-optimization.html | |
// not TCO | |
function factorial(n) { | |
if (n <= 0) return 1; | |
return n * factorial(n-1); // here, the main recursive call not in a tail position because of the `n` context. | |
} |
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
$ sudo -s # enable sudo on current user | |
$ a2ensite [conf-name] # enable site that are in sites-available | |
$ a2dissite [conf-name] # disable site that are in sites-available | |
$ /etc/init.d/apache2 reload # reload Apache |
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
<h3 class="green bgr-grey text-h3 col-xs-12 col-6-md"> | |
I love Kitten | |
</h3> |
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
<div class="project-card"> | |
<h4 class="project-card__title">Mon nouveau projet</h4> | |
<p class="project-card__description">Une description passionnante</p> | |
<a class="project-card__action project-card__action-primary">Découvrir</a> | |
<div> |
OlderNewer