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
// Here's a custom Knockout binding that makes elements shown/hidden via jQuery's slideDown()/slideUp() methods | |
// Could be stored in a separate utility library | |
ko.bindingHandlers.slideToggle = { | |
init: function(element, valueAccessor) { | |
// Initially set the element to be instantly visible/hidden depending on the value | |
var value = valueAccessor(); | |
$(element).toggle(ko.utils.unwrapObservable(value)); // Use "unwrapObservable" so we can handle values that may or may not be observable | |
}, | |
update: function(element, valueAccessor) { | |
// Whenever the value subsequently changes, slowly slide the element down or up |
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 s = document.createElement("script"); | |
s.type = "text/javascript"; | |
s.src = "https://rawgit.com/darsain/fpsmeter/master/dist/fpsmeter.min.js"; | |
$("head").append(s); | |
var meter = new FPSMeter(); | |
function animate(){ | |
requestAnimationFrame(animate); | |
meter.tick(); | |
} | |
animate(); |
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 npm install casperjs | |
npm ERR! Error: EPERM, chown '/vagrant/silex/node_modules/casperjs/package.json' | |
npm ERR! { [Error: EPERM, chown '/vagrant/silex/node_modules/casperjs/package.json'] | |
npm ERR! errno: 50, | |
npm ERR! code: 'EPERM', | |
npm ERR! path: '/vagrant/silex/node_modules/casperjs/package.json', | |
npm ERR! fstream_finish_call: 'chown', | |
npm ERR! fstream_type: 'File', | |
npm ERR! fstream_path: '/vagrant/silex/node_modules/casperjs/package.json', | |
npm ERR! fstream_class: 'FileWriter', |
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 Crafty = require('craftyjs'); | |
Crafty.init(300, 300); | |
Crafty.background('black'); | |
Crafty.e('2D, Canvas, Color') | |
.attr({x: 20, y: 20, w: 30, h: 30}) | |
.color('red'); |
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 Crafty = require('craftyjs'); | |
Crafty.init(300, 300); | |
Crafty.background('black'); | |
Crafty.e('2D, Canvas, Color') | |
.attr({x: 20, y: 20, w: 30, h: 30}) | |
.color('red'); |
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
You talked about the place you worked that they wanted to | |
have a micro service architecture, but they instead ended | |
up with a split up monolith app because they were all | |
dependent on each other. | |
Didn't they have messages queues, and wouldn't that make | |
it a microservice? | |
What is the principle for not ending up with a split up monolith? |
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 stream = require('stream'); | |
var timer = new stream.Readable({ | |
read: function() { | |
var self = this; | |
console.log('called'); | |
setTimeout(function() { | |
if(!timer.isPaused()){ | |
self.push('ping\n'); |
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
// ---- | |
// Sass (v3.4.12) | |
// Compass (v1.0.3) | |
// ---- | |
.grad { | |
background: linear-gradient(to bottom, rgba(255,255,255,0) 0%,rgba(242,242,242,1) 70%); | |
} |
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 gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var transform = require('vinyl-transform'); | |
gulp.task('browserify', function() { | |
var browserified = transform(function(filename) { | |
var b = browserify(filename); | |
return b.bundle(); | |
}); |
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
$ ping tdc.dk | |
PING tdc.dk (213.174.68.45): 56 data bytes | |
Request timeout for icmp_seq 0 | |
Request timeout for icmp_seq 1 | |
Request timeout for icmp_seq 2 | |
Request timeout for icmp_seq 3 | |
Request timeout for icmp_seq 4 | |
Request timeout for icmp_seq 5 | |
Request timeout for icmp_seq 6 | |
^C |