Skip to content

Instantly share code, notes, and snippets.

View krivaten's full-sized avatar

Kristopher Van Houten krivaten

View GitHub Profile
@krivaten
krivaten / try-catch.ts
Created July 19, 2025 18:11 — forked from t3dotgg/try-catch.ts
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};
import Ember from 'ember';
export default Ember.Component.extend({
});
@krivaten
krivaten / setup.sh
Created February 17, 2016 19:42 — forked from tristanoneil/setup.sh
PhantomJS 2.1.0
PHANTOMJS_URL="https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2"
set -e
rm -rf ~/.phantomjs
wget --continue "${PHANTOMJS_URL}" -O "${HOME}/cache/phantomjs"
tar xvfj "${HOME}/cache/phantomjs"
ln -s "${HOME}/cache/phantomjs" "${HOME}/bin/"
chmod +x "${HOME}/bin/phantomjs"