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 'sinatra' | |
get "/" do | |
"<h1>Your files, sir.</h1>" | |
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
require 'sinatra' | |
require 'pathname' | |
get "/" do | |
html = "<h1>Your files, sir.</h1>" | |
dir = "./files/" | |
Dir[dir+"*"].each do |file| | |
html+=file_link(file) | |
end | |
html |
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 'sinatra' | |
require 'pathname' | |
get "/" do | |
dir = "./files/" | |
@links = Dir[dir+"*"].map { |file| | |
file_link(file) | |
}.join | |
erb :index | |
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
require 'sinatra' | |
get "/" do | |
"<h1>Your files, sir.</h1>" | |
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
require 'sinatra' | |
require 'pathname' | |
get "/" do | |
html = "<h1>Your files, sir.</h1>" | |
dir = "./files/" | |
html += file_link("./files/foo.txt") | |
html | |
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
require 'sinatra' | |
require 'pathname' | |
get "/" do | |
dir = "./files/" | |
@links = Dir[dir+"*"].map { |file| | |
file_link(file) | |
}.join | |
erb :index | |
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
<html> | |
<head> | |
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> | |
<style type="text/css" media="screen">@import "/stylesheets/iui.css";</style> | |
<script type="application/x-javascript" src="/javascripts/iui.js"></script> | |
</head> | |
<body> | |
<div class="toolbar"> | |
<h1 id="pageTitle"></h1> |
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
helpers do | |
def file_link(file) | |
filename = Pathname.new(file).basename | |
"<li><a href='#{file}' target='_self'>#{filename}</a></li>" | |
end | |
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
require 'rubygems' | |
require 'ruby-growl' | |
g = Growl.new("localhost", "ruby-growl", ["ruby-growl Notification"], ["ruby-growl Notification"], nil) | |
g.notify("ruby-growl Notification", "It Came From Ruby-Growl", "Greetings!", 1, true) |
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
// This is a slightly altered version of the script at | |
// http://userscripts.org/scripts/show/43545 | |
// I simply replaced | |
// 'w'.charCodeAt(0) | |
// with | |
// 23 | |
document.addEventListener('keypress', function(event){ | |
var target = event.target; | |
if (event.ctrlKey && event.charCode == 23 |