Skip to content

Instantly share code, notes, and snippets.

todgru

Block or report user

Report or block todgru

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@todgru
todgru / git_branch_info.md
Last active Nov 10, 2018
Todd's git branch info! merge move delete ours fix conflicts rebase
View git_branch_info.md
@todgru
todgru / Bcrypt.php
Created Sep 7, 2012 — forked from marcoarment/Bcrypt.php
Simple PHP 5.3+ Bcrypt class and functions php bcrypt
View Bcrypt.php
<?php
/*
By Marco Arment <me@marco.org>.
This code is released in the public domain.
THERE IS ABSOLUTELY NO WARRANTY.
Usage example:
// In a registration or password-change form:
@todgru
todgru / bash_osx_notes.md
Created Nov 19, 2012
BASH OSX notes bash osx
View bash_osx_notes.md

Order of execution in OSX:

/etc/profile
~/.bash_profile
~/.bashrc
~/.bash_login
~/.profile
~/.bash_logout
@todgru
todgru / modules.md
Last active Oct 13, 2015
Git submodule
View modules.md

#Submodules

Here is how we do it at Our Office


When you clone your working repos (api, app, www), you'll have an empty Modules directory. The working repo will contain a pointer to the hash of the last Modules repo committed. All that needs to be done from your working repo directory is:

$ git subumodule init
@todgru
todgru / remove_ds_store.md
Created Nov 20, 2012
Clean up those .DS_store files
View remove_ds_store.md
@todgru
todgru / gist:4128695
Last active Apr 12, 2019
Git Keeps asking for username password clone ssh git https
View gist:4128695
@todgru
todgru / Here_is_why.md
Created Nov 26, 2012
Ruby, Bundler, rvm and gems can be bitches
View Here_is_why.md

#The Big Headache.

A common error we get when attempting to run rake -T after a git pull is:

rake aborted!
cannot load such file -- some/gem_file
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/vlad-2.3.0/lib/vlad.rb:3:in `require'
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/vlad-2.3.0/lib/vlad.rb:3:in `<top (required)>'
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `require'
/Users/todgru/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.2.2/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
@todgru
todgru / how_to_back_out_a_commit.md
Created Dec 10, 2012
oops git reverse commit back out
View how_to_back_out_a_commit.md

#Oops, I merged untested changes to master!

You've made changes to master, commited and push up to your repo. Git is flexible enough that you can dig yourself out rather easily. Here are two of many options to get back to a safe place.

  • Option 1, Branch out and keep your changes.
  • Option 2, Reset the branch and lose changes.

The final step in both of these options is $ git push --force origin master.

##Option 1: Branch Out

@todgru
todgru / how_to_use_pull_request.md
Created Dec 11, 2012
How to use git pull request
View how_to_use_pull_request.md

#How to use Pull Request

From https://help.github.com/articles/using-pull-requests

After you have branched from the mainline, made changes, commit to your branch and push your branch to the Github repo.

In the Github repo, select your branch from the drop down.

Click pull request......

View git_tag.md

#git tag

Think of a git tag as an alias to a sha1 or to a branch.

The Git Book on tagging says there are two main typs of tags, lightweight and annotated. Lightweight only records commit and tag. Annotated records who, what, when and where. Use annotated, -a.

List all tags:

$ git tag
You can’t perform that action at this time.