Skip to content

Instantly share code, notes, and snippets.

View natlownes's full-sized avatar

Nat Lownes natlownes

View GitHub Profile
CmdUtils.CreateCommand(
{
name: "ruby",
takes: {"function": noun_arb_text},
icon: "http://ruby-doc.org/favicon.ico",
homepage: "http://jackndempsey.blogspot.com",
author: {name: "Jack Dempsey", email: "[email protected]"},
license: "MPL,GPL",
description: "Search ruby functions documentation",
help: "Select a ruby function",
// ==UserScript==
// @name Swoopo Ripoff Calculator
// @namespace http://*.swoopo.com
// @include http://www.swoopo.com/
// ==/UserScript==
var spans = document.getElementsByTagName("span");
var priceRe = /^price_index_page_.*/;
var earnRe = /^earn_price_index_page_.*/
// requires yahoo.util.dom
var InfoWidget = Class.create();
// ex. widget = new InfoWidget({
// 'text': "your text",
// 'severity': 'info',
//
// })
// widget.show();
InfoWidget.prototype = {
initialize: function(options){
div.info-widget {
position: absolute;
border: 2px solid darkgrey;
cursor: default;
font-family: helvetica;
background-color: lightyellow;
border:1px solid lightgrey;
top: auto;
left:auto;
}
root=Dir.pwd
puts ">>> Serving: #{root}"
run Rack::Directory.new("#{root}")
def underscoralize
self.downcase.strip.gsub(/\s+/, "_").gsub(/[^a-z0-9_-]/, "").gsub(/[-_]{2,}/,"_")
end
To change two vertically split windows to horizonally split
^Wt^WK
Horizontally to vertically:
^Wt^WH
where ^W means "hit Ctrl-W". Explanations:
^Wt makes the first (topleft) window current
^WK moves the current window to full-width at the very top
# git pre-receive hook for rejecting ruby code with debugger statements
#!/usr/bin/env ruby
def msg(message)
%{
#############################################################
#{message}
#############################################################
}
" vimrc to allow for blasting off reggaeton horns while coding
nmap HH :silent execute "!afplay $HOME/.vim/audio/air_horn5.mp3 &>/dev/null & redraw!"<CR>
@natlownes
natlownes / gist:1151730
Created August 17, 2011 15:11
git merge cheatsheet. I can never remember the fuck these are.
$LOCAL is set to the name of a temporary file containing the contents of the file on the current branch
$REMOTE set to the name of a temporary file containing the contents of the file to be merged
$BASE set to the name of a temporary file containing the common base for the merge.