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
public function test_get() | |
{ | |
$this | |
->given($array = ['k1' => 'v1', 'k2' => 'v2', 'k3' => 'v3', 'k4' => 'v4']) | |
->array($array) | |
->isIdenticalTo($array) | |
; |
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
// Example test that spies on SocketStream.publish.channel() calls | |
// Using Mocha to drive: http://visionmedia.github.com/mocha/ | |
// sinon.js for stubs/mocks/spies: http://sinonjs.org | |
// should.js for assertions: https://github.com/visionmedia/should.js | |
var sinon = require('sinon') | |
, should = require('should') | |
, ss = require('socketstream').start(); | |
describe("Spying on SocketStream for testing", function() { |
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 injector = angular.injector(['module1', module2, 'ng']); | |
var service = injector.get("serviceName"); |
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
//app.js Socket IO Test | |
var app = require('express').createServer(), | |
redis = require('socket.io/node_modules/redis'), | |
io = require('socket.io').listen(app); | |
var pub = redis.createClient(port, "url"); | |
var sub = redis.createClient(port, "url"); | |
var store = redis.createClient(port, "url"); | |
pub.auth('pass', function(){console.log("adentro! pub")}); | |
sub.auth('pass', function(){console.log("adentro! sub")}); |
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
gulp.task('angu.webpack', ['angu.assets-js-clean'], function() { | |
return gulp.src('main.js') | |
.pipe(webpack({ | |
entry: { | |
main: paths.client + '/app/main/index.js', | |
user: paths.client + '/app/user/index.js' | |
// other entries ... | |
}, | |
output: { |
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 traverse() { | |
find $1 -mindepth 1 -maxdepth 1 ! -type d -exec echo "$2"{} \; | |
for d in $(find $1 -mindepth 1 -maxdepth 1 -type d ! -name ".") | |
do | |
# if you just need files comment out next line | |
echo "$2$d" | |
traverse "$d" "${2} " | |
done | |
} |
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 promise = require('bluebird'); | |
var fs = primise.promisifyAll(require('fs')); | |
function updateJson(ticker, value) { | |
fs.readFileAsync('stocktest.json', 'utf8') | |
.then(function(contents) { | |
var stocksJson = JSON.parse(contents); |
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
/* | |
Go on your labels page (https://github.com/user/repo/labels) | |
Edit the following label array | |
or | |
Use this snippet to export github labels (https://gist.github.com/MoOx/93c2853fee760f42d97f) | |
and replace it | |
Paste this script in your console | |
Press Enter!! |
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
// ---- | |
// Sass (v3.3.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// Capitalize string | |
// -------------------------------------------------------------------------------- | |
// @param [string] $string | |
// -------------------------------------------------------------------------------- | |
// @return [string] |
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 | |
# Absolute path to this script, e.g. /home/user/bin/foo.sh | |
SCRIPT=$(readlink -f "$0") | |
# Absolute path this script is in, thus /home/user/bin | |
SCRIPTPATH=$(dirname "$SCRIPT") | |
echo $SCRIPTPATH | |
export $(cat ${SCRIPTPATH}/.env | xargs) | |
docker-compose -f ${SCRIPTPATH}/docker-compose.yml up |
OlderNewer