Skip to content
View MainActivity.java
public class MainActivity extends LocationManagingActivity implements ActionBar.OnNavigationListener,
GooglePlayServicesClient.ConnectionCallbacks,
GooglePlayServicesClient.OnConnectionFailedListener {
//...
private static MeTrackerStore mMeTrackerStore;
//...
View .vimrc
set enc=utf-8
set nu
function! WindowsizeMaximize13()
set lines=570
set columns=1810
colorscheme ir_black
endfunction
"command! WindowsizeMaximize13 call WindowsizeMaximize13()
filetype indent plugin on
View railsConfAPIDesign.md
  1. never use a metaphor, simile, or other figure of speech which you are used to seeing in print.
  2. never use a long word where a short one will do
  3. if it's possible to cut a word out, always cut it out.
  4. never use the passive where you can use the active
  5. never use a foreign phrase, a scientific word, or a jargon word if you can think of an everday English equivalent
  6. break any of these rules sooner than say anything outright barbarrous

Five guiding principles

  1. minimalism
  2. get out of the way
View railsConfShopifyScaling.md

How Shopify Scales Rails John Duff

The Stack:

  • ruby1.9.3-p327
  • rails3.2
  • unicorn 4.5
  • percona Mysql5.5
  • memcache14.14
  • redis2.6

33 app servers, 1172 unicorn workers, 5 job servers, 370 job workers

View gist:5504445
Code Triage: gemhttp://www.codetriage.com/
budle open gemName
puts caller.inspect #where it came from
object#method
object.method(:method_name).source_location
method.source_location
self.class.ancestors #get superclass names in order
View gist:5504109
Diametric gem https://github.com/relevance/diametric
- ActiveModel wrapper of Datomic. MRI via REST service. Jruby via REST service
Datomic is via Rich Hickey, newSql database.
ACID (atomicity, consistency, Isolation, Durability) guranteed.
- has idea of simplicity
- datomics schema, - Array of Hash
- data: array of hash
- query - array in array
- data is immutable
View railsConfExractableLib.md

Building Extractable Libraries in Rails

Avoiding the autoload trap

  • rails 3: removing /lib from automatically being loaded on application boot

create a namespace and setup a proper layout when we need to extract our code outside the application into a gem

Hide your credentials from your Library

#config/initializers/twitter_wrangler.rb
View railsConfElasticSearchNote.md

Using elastic search with rails app via Brian Gugliemetti

http://www.elasticsearch.org/

elastic search

  • RESTful search engine built on top of Apache

wanted: autocomplete, replace database full-text search, bring site earch in-house

Terms

node: instance of elasticsearch which belongs to a cluster

View railsConfNote_documentationTips.md
View REPL
(main)> bag = NanoStore::Bag.bag
=> #<NanoStore::Bag:0x8c930b0>
(main)> NanoStore.shared_store.addObject(bag, error:nil)
=> true
(main)> bag.setName "cars"
=> #<NanoStore::Bag:0x8c930b0>
(main)> user = User.create(8, 'demo', 23, bag.name)
=> #<User:0x8c93800>
(main)> user.save
=> #<User:0x8c93800>
Something went wrong with that request. Please try again.