Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am conradchu on github.
  • I am chuboy (https://keybase.io/chuboy) on keybase.
  • I have a public key ASABhl78y4V31mSvua0un9qpDuh2E0_QgiKQ2Vw4YHKlXgo

To claim this, I am signing this object:

View menu.css.scss
.menu-unsubscribed
{
margin-top: 30px;
padding: 30px;
}
View gist:4265746
Started POST "/users?traditional=true" for 10.240.223.45 at Tue Dec 11 23:13:04 -0800 2012
Processing by Users::Devise::RegistrationsController#create as HTML
Parameters: {"user"=>{"email"=>"aviva_cohen@comcast.net", "last_name"=>"Cohen", "first_name"=>"Aviva", "password"=>"[FILTERED]", "zipcode"=>"94010"}, "invitation"=>{"code"=>"JHXFJYX9"}, "utf8"=>"✓", "traditional"=>"true", "commit"=>"Create Account", "authenticity_token"=>"jxOAmx4nvkLBTcw/J+/RlWxhqQiMF+UzNsBsGQDYzNg="}
Rendered home/_testimonials.html.erb (0.8ms)
Rendered shared/_error_messages.html.erb (0.1ms)
Rendered shared/_footer.html.erb (2.0ms)
Rendered shared/_kissmetrics.html.erb (0.3ms)
Rendered shared/_fb_og.html.erb (0.6ms)
Rendered shared/_ga.html.erb (0.1ms)
Rendered shared/_mixpanel.html.erb (0.1ms)
View omniauth_callbacks_controller.rb
class Users::Devise::OmniauthCallbacksController < Devise::OmniauthCallbacksController
# guest trying to login with facebook
def facebook
self.process_login
end
# guest trying to login with twitter
def twitter
self.process_login
end
View registrations_controller.rb
if @new_user.save
if @invitation && @invitation.persisted?
# Mark private invites as used.
@invitation.deactivate unless @invitation.public?
# Send referrer feedback/rewards when the new user signs up.
@invitation.delay.reward_referrer_on_signup(@new_user)
end
View Default (OSX).sublime-keymap
[
{"keys": ["super+alt+["], "command": "reindent" , "args": {"single_line": false}}
]
View Preferences.sublime-settings
{
"color_scheme": "Packages/Color Scheme - Default/Vibrant Ink.tmTheme",
"font_size": 17.0,
"ignored_packages":
[
"Vintage"
],
"theme": "Soda Dark.sublime-theme"
}
View Preferences.sublime-settings
// These files will still show up in the side bar, but won't be included in
// Goto Anything or Find in Files
"binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip", "*.log"],
View Default (OSX).sublime-keymap
// ERB hotkey, based on https://github.com/eddorre/SublimeERB
{ "keys": ["ctrl+shift+."], "command": "erb", "context":
[
{ "key": "selector", "operator": "equal", "operand": "text.html.ruby, text.haml, source.yaml, source.css, source.scss, source.js, source.coffee" }
]
}
@conradchu
conradchu / Reading S3 keys as a file hierarchy
Created Jan 27, 2011
Here's a way I parse through keys in an S3 bucket, calculating depth based on number of /'s in the key. I then parse and throw folders/files that are too deep and show only the folder/file entries at the current level
View Reading S3 keys as a file hierarchy
def entries(dir = '')
entries = []
# Depth of the directory path
dir_depth = dir.count('/')
@bucket.keys(:prefix => path).each do |entry|
# Entries cannot end with ~ (ascii 126) or starts with # or . (35 and 46 respectively)
if entry.name[-1] != 126 && entry.name[0] != 35 && entry.name[0] != 46 && entry.name != path
# If is a subdirectory (entries that are deeper than the current path must only be directories)