Skip to content

Instantly share code, notes, and snippets.

@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
require 'oauth'
require 'uri'
key = ''
secret = ''
consumer = OAuth::Consumer.new(key, secret, { site: 'http://www.tumblr.com' })
request_token = consumer.get_request_token(exclude_callback: true)
puts request_token.authorize_url
result = gets.chomp
@joelind
joelind / ability_spec.rb
Created March 10, 2012 18:06
Simple scheme for unit testing cancan abilities
require 'spec_helper'
describe Ability do
let(:district) { Factory :district }
let(:root) { Factory :root_user }
let(:admin) { Factory :admin_user, district: district }
let(:other_admin_in_district) { Factory :admin_user, district: district }
let(:admin_in_other_district) { Factory :admin_user }
let(:contributor) { Factory :contributor_user, district: district }
let(:contributor_in_other_district) { Factory :contributor_user }
@olivierlacan
olivierlacan / launch_sublime_from_terminal.markdown
Created September 5, 2011 15:50
Launch Sublime Text 2 from the Mac OS X Terminal

Launch Sublime Text 2 from the Mac OS X Terminal

Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.

open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl

You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html

Installation