Skip to content

Instantly share code, notes, and snippets.

View jashmenn's full-sized avatar

Nate Murray jashmenn

View GitHub Profile
" " command-line editing
" move-commands
cnoremap <C-A> <Home>
cnoremap <C-E> <End>
cnoremap <C-B> <Left>
cnoremap <C-F> <Right>
cnoremap <Esc>b <S-Left>
cnoremap <Esc>w <S-Right>
cnoremap <Esc>e <S-Right>
cnoremap <Esc>B <C-Left>
$ cloud provision -d
bootstrapping: 192.168.133.128
Adding default gem dependencies
/Users/nmurray/Programming/Ruby/poolparty/bin/../lib/poolparty/helpers/../../../bin/../lib/../vendor/gems/suitcase/lib/suitcase/zipper.rb:53:in `add': undefined method `each' for nil:NilClass (NoMethodError)
from /Users/nmurray/Programming/Ruby/poolparty/bin/../lib/poolparty/helpers/../../../bin/../lib/../vendor/gems/suitcase/lib/suitcase/zipper.rb:82:in `gems'
from /Users/nmurray/Programming/Ruby/poolparty/bin/../lib/poolparty/helpers/../../../bin/../lib/../vendor/gems/suitcase/lib/suitcase/zipper.rb:79:in `each'
from /Users/nmurray/Programming/Ruby/poolparty/bin/../lib/poolparty/helpers/../../../bin/../lib/../vendor/gems/suitcase/lib/suitcase/zipper.rb:79:in `gems'
from /Users/nmurray/Programming/Ruby/poolparty/bin/../lib/poolparty/helpers/../../../bin/../lib/poolparty/provision/boot_strapper.rb:93:in `pack_the_dependencies'
from /Users/nmurray/Programming/Ruby/poolparty/bin/../lib/poolparty/helpers/../../../bin/../lib/
// bookmarklet to click delicious recommended tags
javascript:var%20tags%20=%20[];%20var%20result%20=%20document.evaluate("//li[@id=\"save-reco-tags\"]//a/text()%20|%20//li[@id=\"save-pop-tags\"]//a/text()",%20document,%20null,%20XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,%20null);%20for%20(var%20i%20=%200;%20i%20<%20result.snapshotLength;%20i++)%20{%20thisLink%20=%20result.snapshotItem(i);%20tags.push(thisLink.nodeValue);%20}%20document.getElementById('tags').value%20+=%20tags.join('%20');
apache do
installed_as_standard
enable_php5 do
extras :cli, :pspell, :mysql
end
config("store", ::File.join(File.dirname(__FILE__), "templates/apache", "store.conf.erb"))
has_custom_store do
#!/usr/bin/env ruby
require 'git-style-binary/command'
GitStyleBinary.command do
short_desc "create a blog post"
banner <<-EOS
Usage: #{command.full_name} #{all_options_string} {content|STDIN}
Posts content to a wordpress blog
" Vim Markdown preview
"
" * compile vim with ruby support
" * sudo gem install rdiscount (update load path to absolute path below)
" * add this file to
" ~/.vim/ftplugin/mkd.vim
function! PreviewMKD()
ruby << EOF
require 'rubygems'
$:.unshift("/usr/local/lib/ruby/gems/1.8/gems/rdiscount-1.3.4/lib")
def require_chef_recipe
unless @required_chef_recipe
include_chef_recipe "god" # requires opscode chef recipes
@required_chef_recipe = true
end
end
# wish it could be
def require_chef_recipe
do_once do
@jashmenn
jashmenn / gist:111981
Created May 14, 2009 23:17
a simple server/client using dnssd (bonjour) and git-style-binaries
#!/usr/bin/env ruby -rubygems
require 'git-style-binary/command'
require 'dnssd'
require 'set'
TestService = Struct.new(:name, :host, :port, :description) unless defined?(TestService)
TcpType = "_dnssdtest._tcp" unless defined?(TcpType)
GitStyleBinary.primary do
version "dnssd-test"
@jashmenn
jashmenn / tweet
Created May 15, 2009 17:21
cli tool for twitter that will help you count the number of characters in your tweet
#!/usr/bin/env ruby
#
# cli tool for twitter that will help you count the number of characters in your tweet
#
require 'rubygems'
require 'thread'
begin
require 'twitter'
rescue LoadError => e
module B
def whisper(a)
puts a.downcase
end
end
class Class
include B
def say(a)
puts a