Skip to content

Instantly share code, notes, and snippets.

View raypereda's full-sized avatar

Ray Pereda raypereda

  • Genesis Research Group
  • Long Beach, CA
View GitHub Profile
@raypereda
raypereda / gist:5138604
Last active March 8, 2022 18:50
complex git commands for managing branches
# To delete all branches on origin that have already been merged into master:
git fetch origin && git remote show origin | grep tracked | grep -v master | awk '{print $1}' | xargs -I '{}' bash -c 'if [ ! "$(git cherry origin/master origin/{})" ]; then git push origin :{}; fi'
# To show the authors of unmerged branches:
git fetch origin; git branch -r | grep origin | xargs -I {} bash -c 'if [[ ! `git cherry HEAD {}` ]]; then echo "{} -- $(git show --format=%an {} | head -n 1)"; fi'
# If you think you lost a commit somehow and it's not stashed and not in a branch,
@raypereda
raypereda / gist:4558374
Created January 17, 2013 18:35
Put this in "~/Library/Application Support/Google/Chrome/Default/User StyleSheets/Custom.css" to highlight your triage: red, triage: yellow, and triage[:] pink stories
.projects_stories_page .storyLabels a[title="triage: red"] {
background-color: red;
color: white !important;
padding: 0 3px;
display: inline-block;
}
.projects_stories_page .accepted .storyLabels a[title="triage: red"] {
background-color: inherit;
color: inherit !important;
@raypereda
raypereda / ray_local_dev_initializer.rb
Created November 30, 2012 23:57
nbuild/config/initializers/ray_local_dev_initializer.rb
# list interesting methods
def listm(object)
(object.methods - Object.methods).sort
end
@raypereda
raypereda / gist:4179415
Created November 30, 2012 23:21
allow rubymine's command-line tool to use './path/to/filename:12345'
#!/usr/bin/ruby
filename, line_no = ARGV.pop.split ':'
exec "mine -l #{line_no} #{filename} &"
@raypereda
raypereda / debug.erl
Created May 18, 2012 20:13
header file for debugging erlang
% -compile([debug_info, export_all]).
% -define (VALUE (Call), io:format ("~p:~p ~s = ~p~n", [?MODULE, ?LINE, ??Call, Call])).