Skip to content

Instantly share code, notes, and snippets.

View tsycho's full-sized avatar

Asif tsycho

View GitHub Profile

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@tsycho
tsycho / .bash_profile
Last active January 3, 2016 17:10
My .bash_profile
source ~/.git-completion.bash
export PS1='\u:\W\$ '
export CLICOLOR=1 #ls with colors
# export EDITOR='vim -f'
# export EDITOR='subl -w'
export PATH=/usr/local/bin:$HOME/bin:$PATH
export PATH=$PATH:/setups/homebrew/bin
@tsycho
tsycho / .gitconfig
Created January 3, 2016 16:48
My .gitconfig
[alias]
co = checkout
ci = commit
st = status
br = branch
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
[mergetool]
@tsycho
tsycho / ios_app_link_redirector.html
Created July 24, 2013 19:54
Load G+ app or redirect to App store link if that fails
@tsycho
tsycho / gist:5470389
Created April 26, 2013 20:57
Manual rotation and transformation of a view. Useful when a view needs to be displayed without knowing which view controller it will be a part of, eg: status/error notifications that will come on top of all other views.
- (void)reposition {
// https://developer.apple.com/library/ios/#qa/qa2010/qa1688.html
// tl;dr Only the first subview in the window receives orientation changes.
// So we apply a transform manually to rotate the view, and change the origin of the frame so
// that it remains in a top-center position for the user.
UIInterfaceOrientation orientation =
[UIApplication sharedApplication].statusBarOrientation;
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow];
CGAffineTransform viewTransform = CGAffineTransformIdentity;
class OAuthController < ApplicationController
def authenticate
oauth_token = params[:oauth_token]
oauth_verifier = params[:oauth_verifier]
@user = User.find_by_oauth_token(oauth_token)
if !@user
# Do something appropriate, such as a 404
else
begin
oauth_request_url, oauth_token, oauth_token_secret = generate_request_token()
# save oauth_token and oauth_token_secret to @user
redirect_to oauth_request_url
@tsycho
tsycho / NestedDict.py
Created May 20, 2012 01:26
Nested (infinite) dictionary in Python
class NestedDict(dict):
def __getitem__(self, key):
if key in self: return self.get(key)
return self.setdefault(key, NestedDict())
@tsycho
tsycho / ruby_oauth_token_generator.rb
Created March 4, 2012 04:18
Ruby Gmail OAuth token generator
require 'hmac-sha1'
require 'base64'
require 'cgi'
module OauthHelper
def URLEscape(text)
return CGI.escape(text).gsub("+", "%20")
end
@tsycho
tsycho / factors.rb
Created September 26, 2011 19:54
Read ABX/Primex RCD files and extract factors
require "crack"
require "json"
files = File.read("files.txt").split("\n")
files.each { |filename|
filename = filename.strip
next if filename.empty?
myXML = Crack::XML.parse( File.read(filename) )