This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Use vim settings, rather then vi settings (much better!) | |
" This must be first, because it changes other options as a side effect. | |
set nocompatible | |
filetype off " required for vundle | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" Vundle " | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A good architecture maximizes the number of decisions NOT made. - Robert Martin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'FileUtils' | |
url = 'http://feeds.feedburner.com/simpledesktops\?format\=xml' | |
dir = Dir.home + '/Pictures/Wallpaper/' | |
FileUtils.mkdir_p(dir) unless Dir.exists?(dir) | |
wallpapers = `curl -s #{url} \ | |
| grep .static \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'gherkin/parser/parser' | |
require 'gherkin/formatter/json_formatter' | |
require 'stringio' | |
require "active_support/core_ext/hash/conversions" | |
require 'nokogiri' | |
class XMLFormatter < Gherkin::Formatter::JSONFormatter | |
def done | |
@io.write(@feature_hashes.to_xml) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem list --no-versions | xargs gem uninstall -aIx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrick' | |
def serve | |
dir = Dir::pwd | |
port = 12000 + (dir.hash % 1000) | |
s = WEBrick::HTTPServer.new( | |
:Port => port, | |
:DocumentRoot => dir | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/smtp' | |
from = "" | |
to = "" | |
smtp_server = "" | |
port = 25 | |
username = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
URL=$1 | |
RESPONSE=$(curl --write-out %{http_code} --silent --output /dev/null ${URL}) | |
if [ $RESPONSE -ne 200 ] | |
then | |
echo $1 is down | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in your application.rb file under the config directory in your rails 3 app. | |
# Found here http://stackoverflow.com/a/9088501 | |
config.action_controller.default_url_options = { :trailing_slash => true } |
NewerOlder