Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🌾
Tending the weeds

Daniel Hedlund dhedlund

👨‍🌾
Tending the weeds
View GitHub Profile
View gist:6fd47ddfbf51b48a12385760cf2c8c31
### 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 Mar 19, 2014
Dynamic Tracing with DTrace and SystemTap
View gist:9635035

class: center, middle

Dynamic Tracing with DTrace and SystemTap


DTrace

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

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 Nov 6, 2011
coffee-script-1.1.2 PKGBUILD
View 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 Nov 3, 2011
PLUG Presentation - November 2011
View gist:1338058

Generating an SSH Key

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