Skip to content

Instantly share code, notes, and snippets.

View mhink's full-sized avatar

Matt Hink mhink

View GitHub Profile
@mhink
mhink / tmux_textaurant.sh
Created December 18, 2011 06:39 — forked from dpickett/tmux_textaurant.sh
scripted way to start your work in a Rails project
export WORKING_DIR=~/work/textaurant
cd $WORKING_DIR; mvim; gitx
tmux start-server
tmux new-session -d -s Textaurant -n work
tmux new-window -tTextaurant:1 -n server
tmux new-window -tTextaurant:2 -n test
tmux send-keys -tTextaurant:0 'cd $WORKING_DIR' C-m
@mhink
mhink / hamljstest
Created February 1, 2012 00:56
Index view located at ./views/index.haml
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
var app = module.exports = express.createServer();
@mhink
mhink / gist:7491098
Created November 15, 2013 20:33
Recent bug discovery on a friend's team. Names have been changed to protect the not-so-innocent :D
jbarrow: can repro in console
mkniel: The 500 errors?
jbarrow: m? nah, scope to field thing
jbarrow: locking up
mkniel: oh, cool
jbarrow: there's a certain input size for which that scopes.subsets.flatMap(scopesToOptionalProfileFields.get).toSet.flatten just hangs
wblack: yeah it's really odd
wblack: just go with lists
jbarrow: m? no, I want subsets
snewton: Streams
@mhink
mhink / gist:ad937cdf1658efd8ddb3
Created December 8, 2014 18:57
Excerpt from "Webapps as microservices"
Webapps as microservices
About a year ago, we migrated the Hailo back end platform to a microservice architecture. At the same time, we tried to imagine what our webapps could look like if they followed the same principles:
Small, independently developed tools
Easily replaceable and upgradeable
Organised around business capabilities
Continuous delivery and automated deployment
In applying this to front end code, we had some worries: that the user experience of flipping between multiple webapps will be jarring; and that maybe we would waste time duplicating code between webapps.
@mhink
mhink / gist:1dd768356b9a8d033787
Created January 14, 2015 19:29
Shell configuration variables for Ruby GC
Some values from http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
export RUBY_HEAP_MIN_SLOTS=5000000 # Initial number of RVALUE slots.
# (default: 10k)
# (current: 5m)
# (37signals: 600k)
# (twitter: 500k)
export RUBY_GC_MALLOC_LIMIT=500000000 # Number of RVALUE allocations that will trigger a GC
# (default: 8m)

Keybase proof

I hereby claim:

  • I am mhink on github.
  • I am mhink (https://keybase.io/mhink) on keybase.
  • I have a public key whose fingerprint is 0BB4 7E9B 1B53 D2F3 FB55 D805 B83B 6C7D 5C40 BBCA

To claim this, I am signing this object:

@mhink
mhink / gist:2cc95c477a909aaaeec9
Created April 24, 2015 23:24
A list of useful links for the Ada folks!
stackoverflow.com
- Best Q&A site on the Internet
guides.rubyonrails.com
- The official guidebook for Ruby on Rails
ruby-lang.com
- The official site for the Ruby programming language
- (lots of resources for learning the language)
@mhink
mhink / dynamic_dispatch_examples.rb
Last active October 22, 2015 23:26
Dynamic Dispatch: Compare/Contrast
class DynamicMethodDispatchExample
def do_something(what_to_do)
begin
self.send("provide_#{what_to_do}_string")
rescue NoMethodError => ex
raise ArgumentError
end
end
def provide_foo_string
# A heavily annotated version of this script follows below.
module EachWindow
def each_window(n, &block)
if self.length < n
raise "Length must be greater than window size"
end
if block_given?
(0..self.size-n).each do |ix|
@mhink
mhink / Vetupot.txt
Last active September 18, 2016 17:22
Dungeon Crawl Stone Soup version 0.18.1 (tiles) character file.
Vetupot the Impregnable (Minotaur Berserker) Turns: 37839, Time: 01:40:37
Health: 185/185 AC: 42 Str: 32 XL: 18 Next: 81%
Magic: 17/17 EV: 10 Int: 6 God: Trog [******]
Gold: 869 SH: 10 Dex: 16 Spells: 0 memorised, 17 levels left
rFire . . . SeeInvis + R - +14 obsidian axe {chop, +Fly Str+3 SInv *Curse} (curse)
rCold . . . Gourm . g - +9 plate armour of Philately {rElec rPois Int+2}