This file contains hidden or 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 'sinatra' | |
| require 'redis' | |
| $redis = Redis.new | |
| get '/s' do | |
| 'Enter a URL: <form method="post" action="s"><input type="text" name="url"><input type="submit" value="Shorten"></form>' | |
| end | |
| post '/s' do |
This file contains hidden or 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 'ostruct' | |
| require 'rubygems' | |
| require 'rest_client' | |
| require 'nokogiri' | |
| SOLR_ROOT = 'http://solr:8983' | |
| FEDORA_ROOT = 'username:password@fedora:8080/fedora' |
This file contains hidden or 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
| <?php | |
| /** | |
| * @file | |
| * Install, update and uninstall functions for the site feature. | |
| */ | |
| /** | |
| * Implements hook_enable(). | |
| * |
This file contains hidden or 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 'rubygems' | |
| require 'rest_client' | |
| require 'nokogiri' | |
| ROOT = 'http:/SOLRHOST:8983' | |
| # Colorful strings |
This file contains hidden or 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
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # Dropbox Helper | |
| alias dropb='sudo sysctl fs.inotify.max_user_watches=100000' | |
| # Ports | |
| alias ports='sudo netstat -lpn' |
This file contains hidden or 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 install sinatra bluecloth | |
| require 'rubygems' | |
| require 'bluecloth' | |
| require 'sinatra' | |
| get '/' do | |
| f = File.open(ARGV[0]) | |
| BlueCloth.new(f.read).to_html | |
| end |
This file contains hidden or 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 'rubygems' | |
| require 'anemone' | |
| require 'redis' | |
| require 'trollop' | |
| require 'highline' | |
| $term = HighLine.new | |
| opts = Trollop::options do | |
| opt :redis, "Select redis store", :default => 2 |
This file contains hidden or 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 'rubygems' | |
| require 'httparty' | |
| require 'json' | |
| require 'csv-mapper' | |
| require 'trollop' | |
| $opts = Trollop::options do | |
| opt :username, "Github username", :default => 'USERNAME' | |
| opt :password, "Github password", :default => 'XXXXXXX' |
This file contains hidden or 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
| # $ ruby complete-build.rb ezp-manifest.txt ext-manifest.txt tki-pb4l 4.4-1.0.2 | |
| require 'fileutils' | |
| EXT_REPO_DIR = 'extension-repos' | |
| EZP_REPO_DIR = 'ezpublish' | |
| SVN2GIT = 'svn2git' | |
| SVN2GIT_FLAGS="--exclude doc --exclude '.*~$' -v" |
This file contains hidden or 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 'ostruct' | |
| require 'rubygems' | |
| require 'rest_client' | |
| require 'nokogiri' | |
| SOLR_ROOT = 'http://search.tki.org.nz:8983' | |
| FEDORA_ROOT = 'username:password@fedora-mms:8080/fedora' | |
| @xpaths = { |