Skip to content

Instantly share code, notes, and snippets.

View tyre's full-sized avatar

Chris Maddox tyre

View GitHub Profile
@tyre
tyre / gist:2017107
Created March 11, 2012 16:50
Chapter One Notes, by Chris

Chapter 1

  • Graham summarizes why junior high sucks. Before maturation, social constructs dominate and lead to viscous social climbing.
  • Nerds aren't good at this, or don't care enough to participate.
  • A common victim leads to social unity.

I loved Graham's thoughts on why this happened.

The inhabitants of all those worlds are trapped in little bubbles where nothing they do can have more than a local effect. Naturally these societies degenerate into savagery. They have no function for their form to follow.

The last line is crucial - without an express goal, people end up focusing too heavily on relative status. Wives of Wall Street's best and brightest are a fascinating example of this. Even with all the money and power in the world, they are reduced to paranoid savages. Another interesting point, that schools are essentially prisons, resonated heavily with me.

Chapter 3

Summary

  • Taboos: Smart people are more willing to consider shocking ideas. This doesn't necessarily mean that they should share them directly with everyone.

    In any period, it should be easy to figure out what such labels are, simply by looking at what people call ideas they disagree with other than untrue.

  • Everyone carries a set of prescribed actions based upon cultural/social norms.

  • You should have opinions that some people would find contentious, as it's doubtful that our era has gotten everything right. Question things, ideas, and fashions; discover their origin and to ask if they make sense.

> It would be like... everyone claiming they had independently decided in 1972 that bell-bottom jeans were a good idea.

@tyre
tyre / HateBot.rb
Created May 16, 2012 15:17
Haters Gonna Hate
require 'json'
require 'faraday'
require 'awesome_print'
require 'hashie'
class Gister
attr_accessor :connection
attr_reader :gists
GIT_API_URL= "https://api.github.com/"

Modularizing Services in Rails

As projects scale, early trade-offs can begin to haunt you, but a "great rewrite" becomes ever more complicated and unlikely. Many larger Rails applications are written to contain every necessary feature, turning even the most distinct concepts and behaviors into one tightly-coupled behemoth.

In this talk, we'll outline a chat application composed of distinct services including:

  • Authorization and session handling
  • Search using ElasticSearch and JSON
  • Persistence API using ActiveRecord
  • Front-end with Ember.js
@tyre
tyre / gist:2863794
Created June 3, 2012 14:48
“We value code that is easy to maintain over code that is easy to write.” -#goos Discuss.
That's because we adopt these practices from the business itself.
Consider the startup world. It's easy to make something flashy that piques your interest for a week or two, but then again 99% of those businesses fail.
The ones that succeed have a real market, data to back it up, and a solid internal organization.
Is it harder to make a business structured this way? Absolutely, but the payoff of creating something that is more than just a fad is huge.
Don't build software that's meant to be a fad.
@tyre
tyre / gist:2903823
Created June 10, 2012 04:29
Configuration for File Uploader
class FileUploader < AWS::S3::S3Object
AWS::S3::Base.establish_connection!(
access_key_id: AWS_KEY,
secret_access_key: AWS_SECRET)
set_current_bucket_to 'hackchat'
end
@tyre
tyre / gist:2992360
Created June 26, 2012 00:44
Stacktrace for lein help
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at jline.ConsoleRunner.main(ConsoleRunner.java:69)
Caused by: java.lang.ExceptionInInitializerError (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
@tyre
tyre / gist:2996086
Created June 26, 2012 14:25
clojure.lang.Symbol cannot be cast to java.lang.String
(defpage "/boundary" {:keys [latitude longitude distance]}
(resp/json (apply LatLong/bounding-box
(
(fn [a b c]
(map read-string '(a b c) ))
latitude longitude distance)))
)
; LatLong/bounding-box takes three arguments which should be numbers (though not necessarily ints)
; latitude, longitude, and distance are strings coming in and need to be numbers passed in
(defmacro create-tag-fn [tag-name]
`(def css-str (atom ""))
(defn (symbol ~tag-name) [properties]
(apply (fn [k v]
(swap! css-str
(str @css-str " " k ": " v "; ")))
(seq properties))))