Skip to content

Instantly share code, notes, and snippets.

View gist:3153babba02dfe0ce2ef
F^Crandallkoutnik: ~/runnable/angular Many-many-changes-in-e2e-tests$ npm test
> runnable-angular@0.2.1 test /Users/randallkoutnik/runnable/angular
> protractor ./test/protractor.conf.js
Using the selenium server at http://localhost:4444/wd/hub
..root@569d5461825a: /bin/sh -c sleep 123456789
..root@909f8b23ff19: /bin/sh -c sleep 123456789
View gist:5234e9fb88da4a18663d
'use strict';
function inherits (ctor, superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
@SomeKittens
SomeKittens / promiseForLoop.js
Created May 18, 2014
for loop bluebird promise
View promiseForLoop.js
var userPromises = [];
// For loop instead of forEach to maintain `this` value
for (var i = 0; i < users.length; i++) {
userPromises.push(this.client.queryAsync('INSERT INTO invites (customerNo, email, name)' +
' VALUES ($1, $2, $3)', [req.user.id, users[i].email, users[i].name]));
}
return bluebird.all(userPromises);
View asdf.md

Don't start a hosting company

I talk to a lot of people who are just starting their first startup. An oddly large percentage of them want to know what it'll take to start a webhosting company. This isn't surprising, as web hosting companies like GoDaddy are very visible. Almost everyone needs some sort of hosting to get started. The technical challenges don't seem overwhelming to the beginner - chances are, they've played with some sort of server already. Most importantly, hosting services seem to make a lot of money. To the uninitiated, this seems like a great area to enter. In this essay, I hope to explain why you shouldn't start a hosting service, while also explaining more general pitfalls beginners encounter.

#It's never about the money Lots of beginners fall for the 1% fallacy (the idea that all they need to succeed is 1% of the market) when selecting what to build. They see large, entrenched players as a good sign - there's money to be made here. Large companies are particularly keen on no

View db.js
'use strict';
var pg = require('pg')
, bluebird = require('bluebird')
, connString = require('./config').pg;
bluebird.promisifyAll(pg);
bluebird.promisifyAll(pg.Client.prototype);
module.exports = function() {
View keybase.md

Keybase proof

I hereby claim:

  • I am somekittens on github.
  • I am rkoutnik (https://keybase.io/rkoutnik) on keybase.
  • I have a public key whose fingerprint is 0E84 45F0 6104 96C0 F62A 1055 6943 A18A 7088 C932

To claim this, I am signing this object:

@SomeKittens
SomeKittens / app.js
Last active Aug 29, 2015
Passport auth example
View app.js
// assuming you're using express
'use strict';
//express stuffs
var passport = require('passport');
var user = require('./user');
// Configs the passports
require('./passportConfig');
@SomeKittens
SomeKittens / gist:9579594
Last active Aug 29, 2015
Converting commands
View gist:9579594
@SomeKittens
SomeKittens / swift required
Created Mar 4, 2014
Sendgrid upgraded everything and made it hard to find the old docs.
View swift required
ln -s swiftmailer/lib/swift_required.php swift_required.php