autocmd BufWritePre * :%s/\s\+$//e
(add-hook 'before-save-hook 'delete-trailing-whitespace)
| #!/usr/bin/ruby | |
| # Download NASA MODIS imagery and use it as a desktop background. | |
| # You'll need ImageMagick installed for this to work. | |
| require 'date' | |
| require 'net/http' | |
| # Screen width/height | |
| X = 2580 | |
| Y = 1024 |
| require 'rubygems' | |
| require 'sinatra' | |
| require 'redis' | |
| # To use, simply start your Redis server and boot this | |
| # example app with: | |
| # ruby example_note_keeping_app.rb | |
| # | |
| # Point your browser to http://localhost:4567 and enjoy! | |
| # |
| current_apt_keys = Dir[ | |
| File.expand_path(File.join(File.dirname(__FILE__), "..", "files", "default", "apt-keys", "*")) | |
| ] | |
| ruby_block "cleanup apt-keys" do | |
| block do | |
| Dir[ | |
| File.expand_path(File.join(Chef::Config[:file_cache_path], "cache", "apt_keys", "*")) | |
| ].each do |rf| | |
| unless current_apt_keys.include?(rf) |
| ### | |
| # Fragile, embedded, deeply tied | |
| ### | |
| <% search("foo").each do |n| -%> | |
| stuff with <%= n %> | |
| <% end %> | |
| ### | |
| # Less fragile, not embedded |
| #!/usr/bin/ruby | |
| # | |
| # Joshua Sierles, 37signals, 2009 | |
| require 'rubygems' | |
| require 'thor' | |
| require 'chef' | |
| require 'chef/node' | |
| require 'chef/rest' | |