Skip to content

Instantly share code, notes, and snippets.

View mhink's full-sized avatar

Matt Hink mhink

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mhink on github.
  • I am mhink (https://keybase.io/mhink) on keybase.
  • I have a public key ASD4_JoL6uLuSKirFTrtGCHmp16345uQ5OCen4yrmtwJrAo

To claim this, I am signing this object:

Dungeon Crawl Stone Soup version 0.21-a0-143-g1ab7d47 (tiles) character file.
Imem the Chopper (Minotaur Berserker) Turns: 71, Time: 00:00:31
Health: 15/19 AC: 13 Str: 21 XL: 1 Next: 41%
Magic: 0/0 EV: 3 Int: 4 God: Trog [*.....]
Gold: 0 SH: 0 Dex: 9 Spells: 0/0 levels left
rFire + . . SeeInvis . a - +0 hand axe
rCold + . . Gourm . (no shield)
const FooBar = () => (
<div>Hello, world!</div>
);
const FooBarEquivalent = () => (
React.createElement("div", {}, ["Hello, world!"])
);
const MyComponent = (
<FooBar />
@mhink
mhink / notify.rb
Created November 21, 2016 19:37
A quick ruby script for OS X notifications from the shell (even in tmux!)
#! /usr/bin/env ruby
require 'optparse'
@reattach = true
@title = "Shell Notification"
OptionParser.new do |opts|
opts.banner = "Usage: notify [options] \"This is a notification\""
opts.on("--no-reattach", "don't use 'reattach-to-user-namespace") do |noreattach|
@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}
# 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 / 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
@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)

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: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)