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 / 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])).
@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 / 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: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 / 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:5217456
Created March 21, 2013 22:36
ruby one-liner for running sum of floats, one per line
cat temp.txt | ruby -ne 's ||= 0.0; s += $_.to_f; puts s'
#!/bin/bash
# nuke-dbs -- completely restore nbuild databases
cd $NBUILD
# Note: This script assumes that your checkout of nbuild is
# in ~/Workspace/nbuild.
# Exit if errors are encountered
@raypereda
raypereda / compile_doc.rb
Created August 27, 2013 23:43
convert from GitHub Markdown to HTML
#!/usr/bin/env ruby
require 'nokogiri'
require 'github/markup'
def preformatted_html
file = ARGV.first
GitHub::Markup.render(file, File.read(file))
end
[
// bind 'jj' to exit insert mode
{ "keys": ["j", "j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{
"auto_complete": false,
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"font_size": 16,
"ignored_packages":
[
],
"ruby_eval":
{
"ruby": "/Users/nbdev/.rvm/rubies/ruby-1.9.3-p327/bin/ruby"