Skip to content

Instantly share code, notes, and snippets.

View SomeKittens's full-sized avatar

Randall Koutnik SomeKittens

View GitHub Profile
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
'use strict';
function inherits (ctor, superCtor) {
ctor.super_ = superCtor;
ctor.prototype = Object.create(superCtor.prototype, {
constructor: {
value: ctor,
enumerable: false,
writable: true,
configurable: true
alert(1);
@SomeKittens
SomeKittens / promiseForLoop.js
Created May 18, 2014 06:38
for loop bluebird promise
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);

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

'use strict';
var pg = require('pg')
, bluebird = require('bluebird')
, connString = require('./config').pg;
bluebird.promisifyAll(pg);
bluebird.promisifyAll(pg.Client.prototype);
module.exports = function() {
@SomeKittens
SomeKittens / keybase.md
Created March 28, 2014 19:03
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 August 29, 2015 13:57
Passport auth example
// 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 August 29, 2015 13:57
Converting commands
@SomeKittens
SomeKittens / swift required
Created March 4, 2014 18:36
Sendgrid upgraded everything and made it hard to find the old docs.
ln -s swiftmailer/lib/swift_required.php swift_required.php