Skip to content

Instantly share code, notes, and snippets.

View underhilllabs's full-sized avatar

Bart Lantz underhilllabs

View GitHub Profile
@underhilllabs
underhilllabs / tm-swarmlings-4p-win.txt
Created March 21, 2017 02:15
swarmlings win 4 player
size:
13,9,false
landscape:
U,S,Y,Y,Y,S,U,K,R,G,B,R,K,
Y,I,I,Y,Y,I,I,Y,K,I,I,Y,N,
I,I,K,I,U,I,S,I,G,I,S,I,I,
G,B,Y,I,I,S,S,I,R,I,S,U,N,
K,U,R,Y,U,U,S,Y,I,I,S,K,B,
S,G,I,I,Y,Y,I,I,I,U,S,U,N,
@underhilllabs
underhilllabs / tm-faction-handicaps.txt
Created March 20, 2017 19:25
Terra Mystica Handicapts
Well to me bids (at the end VPs) would look like this:
Giants: 0VP
Fakirs: 6VP
Auren: 9VP
Cultists: 12VP
Chaos Magicians: 15VP
Swarmlings: 15VP
Engineers: 18VP
Witches: 21VP
@underhilllabs
underhilllabs / witch-nomad-2-player-witch-wins.txt
Created March 19, 2017 05:40
2 player: witch vs Nomad. witch wins by 2 points
size:
13,9,false
landscape:
U,S,G,B,Y,R,U,K,R,G,G,R,K,
Y,I,I,U,K,I,I,Y,G,I,I,Y,N,
I,I,K,I,S,I,G,I,G,I,S,I,I,
G,B,Y,I,I,Y,G,I,Y,I,R,U,N,
K,U,R,B,K,Y,G,Y,I,I,G,K,B,
S,G,I,I,Y,G,I,I,I,Y,S,Y,N,
@underhilllabs
underhilllabs / mermaids-win.txt
Created March 19, 2017 01:35
terra mystica mermaids win
size:
13,9,false
landscape:
U,U,U,Y,Y,Y,Y,K,Y,B,B,R,K,
U,I,I,U,U,I,I,Y,B,I,I,Y,N,
I,I,Y,I,S,I,S,I,B,I,S,I,I,
G,B,Y,I,I,U,B,I,R,I,R,U,N,
K,Y,Y,Y,U,U,S,Y,I,I,B,K,B,
S,G,I,I,Y,B,I,I,I,U,S,U,N,
@underhilllabs
underhilllabs / archiver.ex
Created December 16, 2016 01:40
an Elixir module to archive pages
defmodule Archiver do
def archive(url, user_id, bookmark_id) do
summary = Readability.summarize(url)
page = summary.article_html
path = "priv/static/archive/#{user_id}"
unless File.exists?(path) do
File.mkdir(path)
@underhilllabs
underhilllabs / scrape-bill-text.rb
Last active December 9, 2016 20:11
Scrape Bill Files from Colorado General Assembly website
require 'open-uri'
require 'nokogiri'
require 'mechanize'
div
def get_bill_nums
doc = Nokogiri::HTML(open("http://leg.colorado.gov/bill-search"))
bill_nums = doc.css("div.field-name-field-bill-number div.field-items").text.split("\s")
bill_nums
end
@underhilllabs
underhilllabs / periodically.md
Created November 25, 2016 16:22
How to run an Elixir Process periodically, S/O answer from Jose Valim

There is a simple alternative that does not require any external dependencies:

defmodule MyApp.Periodically do
  use GenServer

  def start_link do
    GenServer.start_link(__MODULE__, %{})
  end

 def init(state) do
@underhilllabs
underhilllabs / install-vagrant-ubuntu-16.04.md
Last active October 13, 2016 16:45
Install Vlad, the lDrupal VM on Ubuntu 16.04

Install vagrant and supporting libraries

sudo apt-get virtualbox-5.0 # not 5.1

sudo apt-get intall vagrant
vagrant plugin install vagrant-triggers 
vagrant plugin install vagrant-hostsupdater

# Install Python
@underhilllabs
underhilllabs / us-state-names-abbrevs.php
Created July 5, 2016 18:14 — forked from maxrice/us-state-names-abbrevs.php
US State Names & Abbreviations as PHP Arrays
<?php
/* From https://www.usps.com/send/official-abbreviations.htm */
$us_state_abbrevs_names = array(
'AL'=>'ALABAMA',
'AK'=>'ALASKA',
'AS'=>'AMERICAN SAMOA',
'AZ'=>'ARIZONA',
'AR'=>'ARKANSAS',
@underhilllabs
underhilllabs / ballots-view-export.php
Created February 26, 2016 15:55
Exported view for Ballot Blue Books
<?php
$view = new view();
$view->name = 'ballots';
$view->description = '';
$view->tag = 'default';
$view->base_table = 'node';
$view->human_name = 'Ballots';
$view->core = 7;
$view->api_version = '3.0';