Skip to content

Instantly share code, notes, and snippets.

View edhemphill's full-sized avatar

Ed Hemphill edhemphill

  • Izuma Networks
  • Austin, TX
View GitHub Profile
@timelf123
timelf123 / pauseChildrenWatchersIf.directive.js
Created March 29, 2016 14:21
Pauses all the children's $$watchers if the expression on the attribute evaluates to true, on false it restores any backed up $$watchers http://stackoverflow.com/a/29840248/411284
app.directive('pauseChildrenWatchersIf', function(){
return {
link: function (scope, element, attrs) {
scope.$watch(attrs.pauseChildrenWatchersIf, function (newVal) {
if (newVal === undefined) {
return;
}
if (newVal) {
toggleChildrenWatchers(element, true)
@goffrie
goffrie / libuv-epoll-bug.js
Last active December 19, 2015 01:49
node.js testcase for a bug in libuv.
var child = require('child_process');
var net = require('net');
var dgram = require('dgram');
// Create a new fd.
var sock = dgram.createSocket('udp4');
sock.bind(4321, function() {
// Send that fd to another process.
// This keeps the file description open,
// even after we close our local fd.