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
app = Rack::Auth::Digest::MD5.new(my_unprotected_app) do |username| | |
{ 'Alice' => 'correct-password' }[username] | |
end | |
app.realm = realm | |
app.opaque = 'this-should-be-secret' | |
run app |
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 'find' | |
class Scm < Thor | |
desc "fetch", "Fetches the newest updates for all repositories (git, svn, bzr, hg, darcs) in your current working directory and its subdirectories" | |
def fetch | |
#run_pager | |
find_scm_dirs(File.expand_path(Dir.getwd)) do |scm| | |
case scm | |
when ".svn" |
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' | |
get "/" do | |
dir = "./public/files/" | |
@links = Dir[dir+"*"].map { |file| | |
file_link(file) | |
}.join | |
erb :index | |
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
Let's make a list of Sinatra-based apps! | |
Apps: | |
- http://github.com/cschneid/irclogger "Sinatra based irclogger.com" | |
- http://github.com/rtomayko/wink "minimalist blogging engine" | |
- http://github.com/foca/integrity "The easy and fun Continuous Integration server" | |
- http://github.com/sr/git-wiki "git-powered wiki" | |
- http://github.com/entp/seinfeld "Seinfeld-inspired productivity calendar to track your public github commits." | |
- http://github.com/karmi/marley "Marley, the blog engine without <textareas>." | |
- http://github.com/ichverstehe/gaze "Serve up your Markdown files with this tiny Sinatra app!" |
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
# Add the alias | |
git config --global alias.retrack '!retrack() { git config "branch.$1.remote" $(dirname "$2"); git config "branch.$1.merge" "refs/heads/$(basename "$2")"; }; retrack' | |
# We want the local branch 'mybranch' to track the remote branch 'origin/mybranch': | |
git retrack mybranch origin/mybranch |
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 'sinatra' | |
get '/test' do | |
html = <<-HTML | |
<html> | |
<body> | |
<a href="/">root</a> | |
</body> | |
</html> |
NewerOlder