Skip to content

Instantly share code, notes, and snippets.

Avatar

Aaron Boyd aaronyo

  • Nomic
  • Bend, Oregon
View GitHub Profile
@aaronyo
aaronyo / pipe-compose-typescript.ts
Created October 14, 2019 05:39
Pipe, compose and the trouble with typescript generics... conclusion: pipe is better than compose in typescript
View pipe-compose-typescript.ts
import fp from 'lodash/fp';
function compose<TS extends any[], R>(
f1: (...args: TS) => R,
): (...args: TS) => R;
function compose<TS extends any[], R1, R2>(
f1: (a: R1) => R2,
f2: (...args: TS) => R1,
): (...args: TS) => R2;
View gist:9a77ae54f4ce07eed217
function app (profile, appContent) {
return (
$t(
'content',
style(
size('100%'),
flex({'flex-direction': 'column'}),
{
'background-color': 'white',
'font-family': 'ProximaNovaBold',
View gist:9078232
MEMBER ACTIVITY ONLY
handle | id | messages | pings | contributors | readers | members
--------------------+------+----------+-------+--------------+---------+---------
burnerslv | 1234 | 349 | 19 | 19 | 27 | 31
theunderground | 1306 | 334 | 36 | 22 | 32 | 35
lvmusic | 1301 | 186 | 17 | 19 | 38 | 46
DowntownChic | 1297 | 113 | 24 | 10 | 17 | 21
PublicArts | 1303 | 107 | 9 | 17 | 27 | 34
lvtech | 1300 | 75 | 8 | 13 | 26 | 31
@aaronyo
aaronyo / databases.rake
Last active December 19, 2015 00:29 — forked from wbailey/databases.rake
Standalone migrations for postgres with foreign key support.
View databases.rake
require 'yaml'
require 'logger'
require 'active_record'
require 'foreigner'
namespace :db do
def create_database config
options = {:charset => 'utf8'}
create_db = lambda do |config|
View gist:5609406

Errors in synchronous js code are pretty straightforward and not unlike errors or exceptions in other languages. They can be thrown and caught, and when they are created they get a stack trace.

var fnInner = function() {
    throw new Error("busted");
};

var fnOuter = function() {
    fnInner();
};