Skip to content

Instantly share code, notes, and snippets.

View urban's full-sized avatar

Urban Faubion urban

  • Seattle, WA, USA
View GitHub Profile
@urban
urban / machine.js
Created January 3, 2020 17:25
Generated by XState Viz: https://xstate.js.org/viz
const chart = {
id: "auth",
context: {
auth: null,
error: null,
loggedoutTime: null
},
initial: "initialCheck",
states: {
initialCheck: {
// There area lot more checks in the Redux lib but this gets the point across.
function createStore(reducer, initialState) {
let currentState = initialState;
const listeners = [];
function getState() {
return currentState;
}
function subscribe(listener) {
.DS_Store
node_modules/
npm-debug.log
@urban
urban / angellist-csv.js
Last active February 24, 2017 21:29
Script to print [AngelList](https://angel.co/) CSV data to `stdout` with `babel-node --stage 0 angellist-csv.js email password`
import 'babel/polyfill'
import co from 'co'
import request from 'request'
import parse from 'csv-parse'
import transform from 'stream-transform'
import querystring from 'querystring'
const loginData = {
'authenticity_token': 'DvEfVp8JrbtP9bBLukcfRMblLqf5Ln5djQS3eW2F3M4=',
'user[email]': process.argv[2],

Vim basics:

  • How to switch from command mode to insert mode i
  • How to switch from insert mode to command mode Esc
  • How to navigate up a line in command mode k
  • How to navigate down a line in command mode j
  • How to navigate left a character in command mode h
  • How to navigate right a character l
  • How to search for any string / (write) Enter
  • How to save a file :wEnter (write)
@urban
urban / index.html
Last active August 29, 2015 14:15
Selectize.js less error test
<!DOCTYPE html>
<html>
<head>
<title>Less Test</title>
<link rel="stylesheet" type="text/css" href="styles.css">
</head>
<body>
<div class="container">
<div class="box"></div>
</div>
@urban
urban / .tmux.conf
Last active December 21, 2015 02:09
Custom tmux configuration
# utf8
set-window-option -g utf8 on
# fix the titles
set -g set-titles on
set -g set-titles-string "#I:#W"
# 1-based window indexing
set -g base-index 1
@urban
urban / fiddle.css
Last active December 19, 2015 02:09
Template Inheritance with Hogan.js
body {
font: 94% helvetica, arial, freesans, clean, sans-serif;
}
.modal {
height: 100%;
left: 0;
position: fixed;
text-align: center;
top: 0;
@urban
urban / fiddle.hogan.js
Last active December 17, 2015 08:29
Hogan.js with inheritance
/*!
* Copyright 2011 Twitter, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@urban
urban / bar-template.js
Last active December 17, 2015 08:19
Template Inheritance using Hogan.js
var TEMPLATES = TEMPLATES || {};
TEMPLATES["bar-modal"] = Hogan.compile(' \
{{<modal-layout}} \
{{$body}} \
<p>This is the <b>bar</b> modal!</p> \
{{/body}} \
{{$footer}} \
<footer> \
<a href="#" data-method="remove" data-target="body > .modal">Cancel</a> \