Skip to content

Instantly share code, notes, and snippets.

View hauntedhost's full-sized avatar
💭
👻

Jules Omlor hauntedhost

💭
👻
View GitHub Profile
@hauntedhost
hauntedhost / postgresql.conf
Created October 14, 2014 18:06
/Library/Application Support/Postgres/var-9.3/postgresql.conf
shared_buffers = 3GB # 30% of total system RAM
work_mem = 5MB
maintenance_work_mem = 64MB
fsync = off
synchronous_commit = off
full_page_writes = off
checkpoint_segments = 100
checkpoint_timeout = 45min
effective_cache_size = 6GB # twice shared_buffers
@hauntedhost
hauntedhost / target-fade.css
Created November 14, 2014 21:00
slowly fade out background color
.target-fade {
-webkit-animation: target-fade 10s 1;
-moz-animation: target-fade 10s 1;
}
@-webkit-keyframes target-fade {
0% { background-color: rgba(80, 173, 118, .1); }
100% { background-color: rgba(80, 173, 118, 0); }
}
@hauntedhost
hauntedhost / sideload_cats.rb
Last active August 29, 2015 14:14
active_model_serializers condition sideloading
class CatsController < ApplicationController
def index
render json: Cat.all, simple: params[:simple], status: :ok
end
end
class CatSerializer < ActiveModel::Serializer
attributes :id, :age, :name
has_many :birds
@hauntedhost
hauntedhost / ruby-to-clojure.md
Last active February 19, 2016 15:47
ruby to clojure
%w[a b c].reduce({}) { |accum, char| 
  accum[char.to_sym] = char * 3; accum 
}
# {:a=>"aaa", :b=>"bbb", :c=>"ccc"}
(into {} 
 (map (fn [char] [(keyword char) (apply str (repeat 3 char))]) 
@hauntedhost
hauntedhost / mixed-map.clj
Last active February 19, 2016 15:47
mixed map in clojure hack (wip)
(def items {:item_name_1 "Great Deal",
:item_options_2 "blah: 2",
:item_name_2 "Awesome Deal",
:item_options_1 "foo: 3",
:item_quantity_1 "1",
:item_price_2 "9.99",
:item_price_1 "9.99",
:itemCount "2"})
(def item-keys
@hauntedhost
hauntedhost / mixed_map.rb
Last active February 19, 2016 15:47
mixed map in ruby
items = { item_name_1: "Great Deal",
item_options_2: "blah: 2",
item_name_2: "Awesome Deal",
item_options_1: "foo: 3",
item_quantity_1: "1",
item_price_2: "9.99",
item_price_1: "9.99",
itemCount: "2" }
def item_key_index(key)
@hauntedhost
hauntedhost / learn-haskell.md
Last active January 30, 2022 12:58
haskell learning resources

free:

@hauntedhost
hauntedhost / learn-clojure.md
Last active August 29, 2015 14:20
clojure learning resources

free:

paid:

@hauntedhost
hauntedhost / hacker-book-club-3.md
Last active August 29, 2015 14:21
hacker book club v3
  • Functional Programming for the Object-Oriented Programmer - We need something to bridge the gap between the huge population of OO programmers, and the growing need for functional programmers. I’ve seen nothing else that fills this need so well -- @unclebobmartin
  • The Joy of Clojure (2nd Edition) - I've read a couple dozen programming books in my day, but Joy of Clojure stands out as one of my all-time favorites. [...] I've read all of the Clojure books to date and I whole-heartedly recommend Joy of Clojure as the best of the bunch. -- @devn
  • Understanding Computation - If you haven’t read "SICP", don't feel guilty. Instead, read "Understanding Computation" by @tomstuart. Quick. Easy. And very good. -- @raganwald
  • Introduction to Haskell - Brent Yorgey's course is the best I've found so far. This course is valuable as it wil