Skip to content

Instantly share code, notes, and snippets.

(global-set-key (kbd "M-s") 'save-buffer)
(global-set-key (kbd "M-z") 'undo)
(global-set-key (kbd "<escape>") 'hippie-expand)
(set-face-font 'default "-apple-inconsolata-medium-r-normal--13-0-72-72-m-0-iso10646-1")
(add-to-list 'default-frame-alist '(width . 100))
(add-to-list 'default-frame-alist '(height . 45))
(setq-default tab-width 2)
@zerowidth
zerowidth / music.rb
Created May 7, 2012 21:37
A functional, lazily-evaluated solution to https://github.com/KeeperPat/music-yaml-parsing for a "coding challenged" competition
Proc.module_eval { def method_missing(m,*a); call(m.to_s,*a); end }
Array.module_eval { def rest; self[1..-1]; end }
Object.module_eval { def let; yield self; end }
Music = Module.new do
def self.load(filename)
depth = ->(l) { %r(^([\s-]*)\w).match(l)[1].length }
ldepth = ->(l) { %r(^(\s*)\S).match(l)[1].length }
nonzero = ->(n) { n > 0 }
empty = ->(c) { c.empty? }
@tobyhede
tobyhede / postsql.sql
Created May 17, 2012 03:08
PostgreSQL as JSON Document Store
-- PostgreSQL 9.2 beta (for the new JSON datatype)
-- You can actually use an earlier version and a TEXT type too
-- PL/V8 http://code.google.com/p/plv8js/wiki/PLV8
-- Inspired by
-- http://people.planetpostgresql.org/andrew/index.php?/archives/249-Using-PLV8-to-index-JSON.html
-- http://ssql-pgaustin.herokuapp.com/#1
-- JSON Types need to be mapped into corresponding PG types
--
@jboner
jboner / latency.txt
Last active November 4, 2024 07:23
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
;; Is it functional programming's immutability that makes it a bad match for
;; object-oriented style, particularly inheritance?
;; For /Functional Programming for the Object-Oriented Programmer/
;; (http://leanpub.com/fp-oo), I've implemented something like the
;; Ruby object system in Clojure. Objects are built out of maps
;; (hashes) with stylized "metadata". Here's a `Point` object:
{:y 6, :x 4, :__class_symbol__ 'Point}
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
Nature's first green is gold,
Her hardest hue to hold.
Her early leaf's a flower;
But only so an hour.
Then leaf subsides to leaf.
So Eden sank to grief,
So dawn goes down to day.
Timezones: they're here to stay.

I'm writing in response to events that have recently come to light involving a sexual assault at a tech conference. Background information can be found [here][1], [here][2], and [here][3] as well as on twitter and google.


I've been watching this from the sidelines, and I've been wrestling with several questions that I can't seem to shake and that I really don't have answers to.

I wear many hats, both in the tech community and others. I'm a coder, a speaker, a user group organizer, a conference organizer, and even a boss. Each of those roles colors how I see this, but there's one role that is overpowering in my reaction.

See, I'm a Dad. A dad of two beautiful and innocent girls who are 3 and 2. They have their whole lives in front of them and so the questions I'm struggling with are:

@rcrowley
rcrowley / bad-side-effects-on-mac-osx.sh
Last active August 29, 2015 13:56
A protip for authors of shell programs. I use this pattern *all the time* for working in a temporary directory and cleaning it up after I'm done but a quirk in how shells interpret failures in command substitution caused a program like these to remove my coworker's home directory when he ran said program on Mac OS X, which doesn't have `mktemp -d`.
set -e
# Looks clever, is short, but removes your working directory on Mac OS X
# where `mktemp -d` fails.
cd "$(mktemp -d)"
trap "rm -rf \"$PWD\"" EXIT INT QUIT TERM
# ...

Reciprocal Needs in the Employment Relation

We can look at two sides of the management coin: What do the individuals get out of it? And what benefit does the whole system derive from it?

I will disregard any benefits that accrue to managers just by holding the position of managing. Those are just circular logic. Circular logic abounds in discussions of management and hierarchy. For example, consider status reports. It will be said that status reports are necessary so managers know what their employees are working on. It’s