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 addLoadEventListener (listener) { | |
var done, oldonload; | |
if(typeof addEventListener !== "undefined") { | |
return addEventListener("load", listener, false); | |
} | |
if(typeof attachEvent !== "undefined") { | |
return attachEvent("onload", listener); | |
} |
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/lib/pgsql/9.1/data/pg_hba.conf.bak 2013-06-24 16:22:00.544751787 +0200 | |
+++ /var/lib/pgsql/9.1/data/pg_hba.conf 2013-06-24 14:10:34.017828693 +0200 | |
@@ -79,7 +79,7 @@ | |
# "local" is for Unix domain socket connections only | |
local all all peer | |
# IPv4 local connections: | |
-host all all 127.0.0.1/32 ident | |
+host all all 127.0.0.1/32 trust | |
# IPv6 local connections: | |
host all all ::1/128 ident |
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
# Redis configuration file example | |
# Note on units: when memory size is needed, it is possible to specifiy | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# | |
# 1k => 1000 bytes | |
# 1kb => 1024 bytes | |
# 1m => 1000000 bytes | |
# 1mb => 1024*1024 bytes | |
# 1g => 1000000000 bytes |
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 nconf = require('nconf'); | |
module.exports = nconf | |
.env() | |
.file(__dirname + '/config.json') | |
.file('env', __dirname + '/config.' + nconf.get('NODE_ENV') + '.json') | |
.file('user', __dirname + '/config.' + nconf.get('NODE_ENV') + '.' + nconf.get('USER') + '.json'); |
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 request = require('supertest'); | |
describe('API testing', function () { | |
it('should return 200', function (done) { | |
request('http://mywebsite.com') | |
.get('/users') | |
.expect(200) | |
.end(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 cluster = require('cluster'); | |
if (cluster.isMaster) { | |
// Fork workers. | |
for (var i = 0; i < 20; i++) { | |
cluster.fork(); | |
} | |
return ; |
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
Show hidden characters
{ | |
"color_scheme": "Packages/User/Solarized (Dark) (SL).tmTheme", | |
"draw_white_space": "all", | |
"font_size": 17, | |
"ignored_packages": | |
[ | |
"Markdown", | |
"Vintage" | |
], | |
"rulers": |
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
# You may have to logout and log back in again for | |
# this to take effect. | |
sudo gpasswd -a $USER docker | |
# Restart the docker daemon. | |
sudo service docker restart |
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
describe('My controller', function () { | |
var scope, createController; | |
beforeEach(module('app.controllers')); | |
beforeEach(inject(function ($injector) { | |
var $rootScope = $injector.get('$rootScope'); | |
var $controller = $injector.get('$controller'); | |
scope = $rootScope.$new(); |
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
describe('My directive', function () { | |
var scope, $compile; | |
beforeEach(module('app.directives')); | |
beforeEach(inject(function ($injector) { | |
$compile = $injector.get('$compile'); | |
var $rootScope = $injector.get('$rootScope'); | |
scope = $rootScope.$new(); |
OlderNewer