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
# must have log module loaded | |
# working to regex out the timestamps and repeat posts | |
ssh your.znc.server "tail -f ~/.znc/users/your_user_name/moddata/log/#channel.log" | while read line ; do echo $line | say ; 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
/** | |
* Request Animation Frame Polyfill | |
* Authored by Erik Möller | |
* http://my.opera.com/emoller/blog | |
* | |
* Polyfills requestAnimationFrame and cancelAnimationFrame | |
* for ms/mox/webkit/o vendor prefixes. | |
* | |
* Will fallback to setTimeout for non-supportive browsers. | |
*/ |
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 _writeHead = res.writeHead; // Store the original function | |
res.writeHead = function(statusCode, headers) { | |
res.writeHead = _writeHead; // Put the original back | |
if (statusCode === 401) { | |
// Change a 401 statusCode to a 403 in order to prevent browser's BASIC AUTH dialog from appearing. | |
// This allows the Backbone app's login page to handle the credentials. | |
_writeHead.call(res, 403, headers); | |
} else { | |
res.writeHead(statusCode, headers); // Call the original | |
} |
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 q = require('q'); | |
if (debug) { | |
q.onerror = function(err) { | |
console.log(err); // auto-links source map refs in stack trace | |
}; | |
} | |
somePromiseThatThrowsAnError | |
.then(function() { /* do stuff */ }) |
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
# Use to proxy commands through a proxy server: | |
Host your_destination_name | |
HostName your.destination | |
ProxyCommand ssh -i ~/.ssh/your_key -A -q your_user@your.proxy nc -q0 your.destination 22 | |
ForwardAgent yes |
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 () { var root = $(document.getElementsByTagName('body')); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watcher) { watchers.push(watcher); }); } angular.forEach(element.children(), function (childElement) { f($(childElement)); }); }; f(root); console.log(watchers.length); })(); |
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 directory/file structure: | |
* | |
* app | |
* |-- components/ | |
* | └-- user-profile/ | |
* | |-- user-profile.js | |
* | |-- user-profile-directives.js | |
* | └-- user-profile-services.js | |
* └-- main.js |
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 createInjector(modulesToLoad) { | |
var INSTANTIATING = {}, | |
providerSuffix = 'Provider', | |
path = [], | |
loadedModules = new HashMap(), | |
providerCache = { | |
$provide: { | |
provider: supportObject(provider), | |
factory: supportObject(factory), | |
service: supportObject(service), |
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
/** | |
* @monkeypatch | |
* $http gives us no way to add a global timeout default. This is critical | |
* for triggering the YOUR_FAULT_TOLERANCE module to handle timeouts after | |
* a reasonable amount of time: | |
* | |
* @upgrade instructions | |
* Ensure that arguments[x] is overriding the timeout property of the | |
* $httpBackend provider's constructor. | |
* |
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 items = [{ | |
content: 'hotdog 1' | |
}, { | |
content: 'hotdog 2' | |
}, { | |
content: 'hotdog 3' | |
}, { | |
content: 'hotdog 4' | |
}, { | |
content: 'hotdog 5' |
OlderNewer