Skip to content

Instantly share code, notes, and snippets.

View dhedlund's full-sized avatar
👨‍🌾
Tending the weeds

Daniel Hedlund dhedlund

👨‍🌾
Tending the weeds
  • Seattle, WA
View GitHub Profile
### Keybase proof
I hereby claim:
* I am dhedlund on github.
* I am dhedlund (https://keybase.io/dhedlund) on keybase.
* I have a public key ASA0mGPwrTLRmvwITbe3clki11kFVvs-M_j2lLVEr_N1qAo
To claim this, I am signing this object:
@dhedlund
dhedlund / gist:9635035
Created March 19, 2014 03:36
Dynamic Tracing with DTrace and SystemTap

class: center, middle

Dynamic Tracing with DTrace and SystemTap


DTrace

  • Originally developed by Sun Microsystems, now Oracle
@dhedlund
dhedlund / gist:1938130
Created February 29, 2012 05:23
PDXErlang intersection implementation w/ Nick
-module(intersection).
-compile(export_all).
intersection(ListA, ListB) ->
intersection([], ListA, ListB).
intersection(Acc, [], ListB) ->
Acc;
intersection(Acc, ListA, ListB) ->
@dhedlund
dhedlund / gist:1727909
Created February 3, 2012 04:31
Salt Presentation
@dhedlund
dhedlund / gist:1561873
Created January 4, 2012 20:13
Palindrome Iteration

Discovered an interesting algorithm for finding longest palindrome by playing with sequences in a text editor. Anyone know if there's a name for this algorithm?

Worst running time is O(n^2), which is better than the naive implementation of O(n^3) but not as efficient as some O(n) implementations (http://www.akalin.cx/longest-palindrome-linear-time). In general, assuming a non-pathological case, running time is around 2n * m where n is the length of the string and m is the mean length of all palindromes. For non-pathological cases (i.e. human sentences), n is often logarithmic (log n) and fast approaches 1 as n increases. This puts the average case complexity at around n log n and best-case n.

Developed as a solution to: http://www.therubygame.com/challenges/4

Algorithm

Original hand-work to discover a pattern:

@dhedlund
dhedlund / PKGBUILD
Created November 6, 2011 05:42
coffee-script-1.1.2 PKGBUILD
# Maintainer: Simon Lipp <aur@simon.lipp.name>
# Contributor: Chris Bolton <http://scr.im/chris-kun>
# Contributor: Sergei Lebedev <superbobry at gmail dot com>
pkgname=coffee-script
pkgver=1.1.2
pkgrel=1
pkgdesc='CoffeeScript is a little language that compiles into JavaScript.'
arch=any
url=http://coffeescript.org
@dhedlund
dhedlund / gist:1338058
Created November 3, 2011 22:21
PLUG Presentation - November 2011

Generating an SSH Key

ssh-keygen -f ~/.ssh/github
Host github.com
  Hostname github.com
 IdentityFile ~/.ssh/github