Skip to content

Instantly share code, notes, and snippets.

@squarism
squarism / required_libs.txt
Last active Aug 29, 2015
Libraries Needed for any Language
View required_libs.txt
I'm making this list specifically for any language but I have golang in mind.
Persistence Clients
- mysql
- postgres
- redis
- memcache
- mongodb
- elasticsearch
- solr
View spiking_user_struct.go
// imma go newb.
package main
import "fmt"
type User struct {
email string
enabled bool
}
@squarism
squarism / massive_brew.sh
Last active Aug 29, 2015
Massive Brew Install
View massive_brew.sh
# homebrew got all wonky
# here's my dev env
$ brew install autojump bazaar boost curl ctags elixir elasticsearch \
erlang git haskell-platform jq lame libpng libxml2 libxslt lua mariadb \
memcached mongodb netcat nginx nmap node phantomjs postgresql pstree python3 \
rabbitmq readline redis rethinkdb riak scala siege sqlite tmux tree v8 watch wget yajl
# rvm will install things too if you do `rvm requirements`
@squarism
squarism / pmap.rb
Last active Aug 29, 2015
ruby pmap
View pmap.rb
# Ruby pmap, like Scala's pmap method.
# ------------------------------------
# modified from t-a-w.blogspot.com
require 'thread'
module Enumerable
def pmap(n)
todo = Queue.new
View machine_languages_touched.md

"There are hundreds of different computer languages. Most experienced programmers know a dozen or so." source


WTF!? A dozen? Know? What does know mean? I don't KNOW English. Do you know what "erinaceous" means? (of, preterning to or resembling a hedgehog) I don't KNOW twelve machine languages.

Ok fine, how many languages have I done anything with, anything at all?

View baseball_stories.txt
Strike Out
----------
1. Pitcher pitches ball
2. A strike happens
3. Umpire sees strike
4. Umpire updates internal count
5. Umpire shouts strike to field
6. Pitcher pitches ball, after hearing call in field
... repeat
7. Third strike is called
@squarism
squarism / go_tour.go
Last active Aug 29, 2015
Go Tour Excercies
View go_tour.go
// Exercise 25 - Loops and Functions
// --------------------------------------------------------------------
package main
import (
"fmt"
"math"
)
@squarism
squarism / java8update.sh
Last active Aug 29, 2015
java 8 update
View java8update.sh
# I salute open source projects like OpenJDK but it's mostly unusable
# out of the box. OpenJDK 6 min/major errors on even older projects?
# Are that many people targetting 7+? I don't know, I don't have time for this,
# let's just use the "sun" jdk like we used to do, back in the day.
# ('00 pop hits start playing)
# download the oracle jdk8 by accepting the license with wget
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" \
http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.rpm
View sliding.rb
define_behavior :sliding do
requires :director
setup do
actor.has_attribute :x_tween
actor.has_attribute :y_tween
actor.has_attributes tween_time: opts[:time]
director.when :update do |time|
if actor.x_tween