Skip to content

Instantly share code, notes, and snippets.

View pellejacobs's full-sized avatar

Pelle Jacobs pellejacobs

View GitHub Profile
const chooseSpawn = (roleCount) => {
const priorityQueue = [
'harvester',
'miner',
'transporter',
]
let nextSpawn
_.reduce(priorityQueue, (expectedRoleCount, role) => {
if (!expectedRoleCount[role]) expectedRoleCount[role] = 0
expectedRoleCount[role] += 1
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = configureStore;
var _redux = require('redux');
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
export const FIRST = 1
export const SECOND = 2
@pellejacobs
pellejacobs / COMMANDS.md
Last active August 31, 2016 11:59
Stackoverflow example

Bash commands:

typings init
typings install -S bluebird
npm install -S bluebird
tsc 
browserify app.js -o bundle.js

Bash commands:

typings init
typings install -S bluebird
npm install -S bluebird
tsc 
node app.js
import { Session } from 'express'
let theSession: Session
theSession.user.login
@pellejacobs
pellejacobs / bundle.d.ts
Created August 26, 2016 08:23
Typings bundling example
// Generated by typings
// Source: submodule.d.ts
declare module '~my-main-module/submodule' {
export interface submoduleInterface {
someProp: number
}
}
declare module 'my-main-module/submodule' {
export * from '~my-main-module/submodule';
}
@pellejacobs
pellejacobs / binding.pry.sublime-snippet
Created October 3, 2015 23:29
binding.pry for pry debugging
<snippet>
<content><![CDATA[
binding.pry
]]></content>
<tabTrigger>binding</tabTrigger>
<description>binding.pry</description>
<scope>source.ruby</scope>
</snippet>
@pellejacobs
pellejacobs / do_end.sublime-snippet
Created October 3, 2015 23:28
general do … end for ruby
<snippet>
<content><![CDATA[
do
${1:code}
end
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>do</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.ruby</scope>