Skip to content

Instantly share code, notes, and snippets.

@rtdp
rtdp / tshirt.sh
Created October 29, 2012 07:36
tshirt lines
lunch android
make -j14
# you got it B-)
@rtdp
rtdp / securing_rails_updates.md
Created March 11, 2012 11:36 — forked from hellopatrick/securing_rails_updates.md
How Homakov hacked GitHub and how to protect your application

##How Homakov hacked GitHub and the line of code that could have prevented it


Please note: THIS ARTICLE IS NOT WRITTEN BY THE GITHUB TEAM or in any way associated with them. It's simply hosted as a Gist because the markdown formatting is excellent and far clearer than anything I could manage on my personal Tumblr at peternixey.com.

If you'd like to follow me on twitter my handle is @peternixey


@rtdp
rtdp / about.md
Created March 9, 2012 13:00 — forked from yogsototh/about.md
Programming Achievements: How to Level Up as a Developer
@rtdp
rtdp / deploy.rb
Created February 17, 2012 17:55
helps avoiding asset pre-compilation, if assets are not changed.
namespace :deploy do
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
from = source.next_revision(current_revision)
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
else
logger.info "*"*100
logger.info "Skipping asset pre-compilation because there were no asset changes"
logger.info "*"*100
@rtdp
rtdp / about.md
Created August 22, 2011 19:46 — forked from yogsototh/about.md
Programming Achievements: How to Level Up as a Developer
@rtdp
rtdp / gist:1086873
Created July 16, 2011 22:32
Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
# deb cdrom:[Ubuntu 10.10 _Maverick Meerkat_ - Release i386 (20101007)]/ maverick main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ natty main restricted
deb-src http://in.archive.ubuntu.com/ubuntu/ natty main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ natty-updates main restricted
@rtdp
rtdp / gist:742461
Created December 15, 2010 19:27
Importing Gmail Contacts list to Rails Application.
class ImportedContactsController << ApplicationController
require 'net/http'
require 'net/https'
require 'uri'
#THIS METHOD TO SEND USER TO THE GOOGLE AUTHENTICATION PAGE.
def authenticate
# initiate authentication w/ gmail
# create url with url-encoded params to initiate connection with contacts api
# next - The URL of the page that Google should redirect the user to after authentication.
# scope - Indicates that the application is requesting a token to access contacts feeds.