Skip to content

Instantly share code, notes, and snippets.

View todgru's full-sized avatar

todgru

  • Portland, OR
View GitHub Profile
@todgru
todgru / git_branch_info.md
Last active November 10, 2018 05:30
Todd's git branch info! merge move delete ours fix conflicts rebase
@todgru
todgru / Bcrypt.php
Created September 7, 2012 22:52
Simple PHP 5.3+ Bcrypt class and functions php bcrypt
<?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 November 19, 2012 21:21
BASH OSX notes bash osx

Order of execution in OSX:

/etc/profile
~/.bash_profile
~/.bashrc
~/.bash_login
~/.profile
~/.bash_logout
@todgru
todgru / modules.md
Last active October 13, 2015 01:08
Git submodule

#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 November 20, 2012 17:42
Clean up those .DS_store files
@todgru
todgru / gist:4128695
Last active April 12, 2019 00:45
Git Keeps asking for username password clone ssh git https
@todgru
todgru / Here_is_why.md
Created November 26, 2012 21:47
Ruby, Bundler, rvm and gems can be bitches

#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 December 10, 2012 18:58
oops git reverse commit back out

#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 December 11, 2012 18:31
How to use git pull request

#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......

@todgru
todgru / git_tag.md
Last active December 12, 2019 19:49
git tag

#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