Skip to content

Instantly share code, notes, and snippets.

View Nicolab's full-sized avatar
:octocat:

Nicolas Talle Nicolab

:octocat:
View GitHub Profile
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
}
@Nicolab
Nicolab / webpack.js
Created July 22, 2014 09:37
Webpack + Angular
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: {
@Nicolab
Nicolab / app.js
Created April 9, 2014 10:33 — forked from elranu/app.js
//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")});
var injector = angular.injector(['module1', module2, 'ng']);
var service = injector.get("serviceName");
// 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() {
public function test_get()
{
$this
->given($array = ['k1' => 'v1', 'k2' => 'v2', 'k3' => 'v3', 'k4' => 'v4'])
->array($array)
->isIdenticalTo($array)
;