Skip to content

Instantly share code, notes, and snippets.

View seanhealy's full-sized avatar
🐢
Slow and Steady.

Sean Healy seanhealy

🐢
Slow and Steady.
  • Edmonton, AB, Canada
View GitHub Profile

Keybase proof

I hereby claim:

  • I am seanhealy on github.
  • I am seanhealy (https://keybase.io/seanhealy) on keybase.
  • I have a public key whose fingerprint is 8584 BFA4 0DD9 CA9A 8C64 3051 6675 B3F5 1A15 F96F

To claim this, I am signing this object:

@seanhealy
seanhealy / Puzzle_2015-07-03.md
Last active May 4, 2016 06:03
Puzzle_2015-07-03.md

Last week we were discussing options to perform a map operation a hash. For example in ruby from symbols to strings. But, really this could be generalized. Your mission, should you choose to accept it is to write a function that takes a hash and performs a map operation on the keys.

You may do this in whatever language you choose the example is just in ruby.

Example

myHash = {
  'a' => 1,
 'b' => 2,
@seanhealy
seanhealy / Puzzle_2015-04-17.md
Last active May 3, 2016 19:08
Puzzle 2015-04-17

Write a simple way of adding a before filter onto a given method of a class.

Here is some Psudo code for you as an example of the functionalty I'm looking for.

a = new AClass;

a.talk();
// Logs:
// "Hello"
@seanhealy
seanhealy / puzzle_2015-04-02.md
Last active August 29, 2015 14:18
Puzzle 2015-04-02

2 + 2 = 5

You've recently been transfered from Product Development to the newly formed Department of Truth.

People being 'educated' by your department don't belive that 2 + 2 = 5. You need to prove it to them. Write a little program that seemingly adds 2 + 2 and outputs 5.

Use some globals, leak some memory; more creative / nefarious is better. You may use whatever language or bad practices you feel are appropriate for this problem.

@seanhealy
seanhealy / Puzzle_ prep.md
Last active May 4, 2016 06:50
Puzzle Prep

We have a grid of mostly 0s there will be one 1. Write a function that returns the position of the 1 relative to the bottom left of the grid.

For example:

grid = [[0, 0, 0],
        [0, 0, 0],
        [0, 0, 1]]

findIt(grid) # => [2, 0]
Array.prototype.bob = function(thing) {
var result = this.slice(0);
result.reverse();
if (typeof thing !== "undefined" && thing !== null) {
for (var i = 0; i < result.length; i++) {
$("img").get().reduce(function(reduction, item){
if ($(item).parents('.gmail_quote, .gmail_extra').length === 0) {
reduction.push(item);
return reduction;
}
}, [])
@seanhealy
seanhealy / dnsimple_domain_update.sh
Last active December 18, 2015 19:29
Just a simple script to update a DNSimple record to my current (or home) IP address. I switched from DynDNS a while ago due to their annoying login rules.
#!/bin/bash
set -e
TOKEN='DOMAIN API TOKEN'
DOMAIN="YOUR DOMAIN (eg. bob.com)"
RECORD_ID="RECORD ID FROM DOMAIN (Found when hovering over a record. eg. home.bob.com)"
IP="`curl http://icanhazip.com/`"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAABYCAYAAADY6G3MAABAAElEQVR4AXS9WZMlS3LfF2c/tVf1dre+c2cwg4UkAIIU9UBJD3yhjGb6NvoyetQH0JvM9CCZUQtM0AYBBIQBB7MQM3fpe3ut7uraTp1Vv9/fM6vvQKasOicjIzw83D08PDw9IvMMjh8d7gaDQWtt0Ha7bduZ4nq3NcXhmevtbtcGw0EbjoAdtjaejttoPmyzvXEbjvkMh20wHrYR5/FkSpVRmwxnYG2NBvgegmMDXtrYgW+zpmAb9DZDi2234RrcgLQBza62yzYiYziSjF3b8BFgOACordtuuG0j/u7x0E7a43u7WTVagw7gQ7v1bIWDa0gIb17f1yJ/SwGlwAQwp912E57XnIcSaB3qy4uH3/K4gR/pnvBluztAlcegjYNnSz65aV84oMO/Ii2aLBMxHwC2HX4yuFYw5JEeULZbIw/S8sa/ECmztVAoGjLTb+RFqDaT/iTBoTw2XPf8K4nIcssZjLb/QRcsI1vCheNsvcFYnQAX5xH9P841VIzGfNCHCen0Af1PTYkawp94t7QjPSvkuo1spRco9RCY7dozfFLW94l15HQgTOiFFHBJlbDS1vUyaQ6ywg26K+mRqRnm0pRiTXlgq36SFKpn205eKREXwGkmFAVRJxILrAPd4BzSXqG0f2g77YNgCP/T1mYHkzabKp9RGyOnHfLyWMPzZrlpaz4OkQa/0hD50OZmAw76RZw0ZjJ9HJmGJvkhnz9FOUK5qs+lp6PJPk//KQKgzZZPjp63gfj5d8ypU+KK/KhhuwPb7fRDQOsVBq6k7x4lejECBzoywV7MD7EJjAnZmM5myGkK/nEbA7B1TCu/FTLbkqZRed8hiDXp6AAVxe0HUYJnResgD7GbyBkzQt1u/HCWvdBLLXl1TDg4TQunfJRZMHNt32nPlLWgyia6pbJIE5nqnKIonbMm9Sy3tQjKNrQJhTvwXJeNVZ7Qyn
@seanhealy
seanhealy / gist:2174350
Created March 23, 2012 19:56
Fun Problem
# JOEL:
def split(string, seperator = "::")
string.split(seperator).inject([]){ |acc, element|
acc.unshift( ( acc.first ? acc.first() + "::" : "" ) + element )
}
end
# RAILS GUY (Yehuda):
def module_split(module_path, separator = "::")