Skip to content

Instantly share code, notes, and snippets.

View urfolomeus's full-sized avatar

Alan Gardner urfolomeus

View GitHub Profile

Elixir Notes

Elixir Sips

Ep 2

Numbers

1 + 1 ``

##heroku
alias hp="heroku_helper production"
alias hs="heroku_helper staging"
alias hpc="heroku_helper production run console"
alias hpl="heroku_helper production logs"
alias hprdbm="heroku_helper production run rake db:migrate"
alias hsc="heroku_helper staging run console"
alias hsl="heroku_helper staging logs"

Keybase proof

I hereby claim:

  • I am urfolomeus on github.
  • I am mr_urf (https://keybase.io/mr_urf) on keybase.
  • I have a public key whose fingerprint is 7B00 D961 9D80 A819 25F4 E1BF 8BA8 5E57 E481 E6D4

To claim this, I am signing this object:

defmodule TspSolver.Fitness do
import TspSolver.Helpers
@city_distances HashDict.new(
[
{ {:Aberdeen, :Dundee}, 67 },
{ {:Aberdeen, :Edinburgh}, 129 },
{ {:Aberdeen, :Glasgow}, 146 },
{ {:Aberdeen, :Inverness}, 105 },
{ {:Aberdeen, :Perth}, 84 },
@urfolomeus
urfolomeus / gist:7958451
Created December 14, 2013 12:06
sublime prefs
{
"color_scheme": "Packages/Theme - Railscasts/Railscasts.tmTheme",
"font_face": "monaco",
"font_size": 14,
"save_on_focus_lost": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true
}
@urfolomeus
urfolomeus / na_no_bot.rb
Last active December 27, 2015 00:59
NaNoWriMo helper script. Gives you a quick summary of progress so far.
#!/usr/bin/env ruby
class NaNoBot
TARGET_WORDS = 50000
TOTAL_DAYS = 30
WELL_DONE = [
"Get in!",
"Doing great!",
"Nice job!",
#!/usr/bin/env ruby
##
# script to amend a commit which should be been created with the previous script
##
commit_message = `git log --format=%B -1`.strip
branch_name = `git rev-parse --abbrev-ref HEAD`.strip
matches = branch_name.match (/\w\-(\d+)\Z/i)
def create
user = User.find_by_omniauth(request.env["omniauth.auth"])
if user
path = root_url
else
user = User.create_with_omniauth(request.env["omniauth.auth"])
path = edit_user_path(user)
session[:new_user] = true
end
session[:user_id] = user.id
@urfolomeus
urfolomeus / gist:5090510
Created March 5, 2013 14:04
My customisations to the neo vim-config
" Default color scheme
color vibrantink
" Change cursor in insert mode
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
@urfolomeus
urfolomeus / heroku_db_migrate.rb
Created August 4, 2012 15:12
Quick script to migrate heroku apps to the new free individual postgres DBs
## README
# This is a quick script I hacked out to migrate all my heroku apps
# to the new free individual postgres DBs. To use it:
# - install the heroku gem if you don't already have it
# - set the value of IGNORE_OTHERS_APPS to true if you only want to
# run the script against apps you've created yourself
# - add any apps you want to ignore because they don't use PostgreSQL
# (or for any other reason) to the IGNORE_LIST
## CAVEAT!!