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
xdg-open http://www.google.com works on linux | |
or, on debian: /etc/alternatives/x-www-browser |
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 'open-uri' | |
require 'nokogiri' | |
if ARGV.empty? | |
repo_name = File.expand_path(".").split("/").last | |
elsif ARGV.count == 1 && !ARGV[0].match(/-[-]?/) | |
repo_name = ARGV[0] | |
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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'nokogiri' | |
if ARGV.empty? | |
repo_name = File.expand_path(".").split("/").last | |
elsif ARGV.count == 1 && !ARGV[0].match(/-[-]?/) | |
repo_name = ARGV[0] | |
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
#!/usr/bin/env ruby | |
#puts "what dir are you in?" | |
#$gitdir = $stdin.gets.chomp #should work off of cd and then check for .git dir | |
if File.exists?('.git') | |
$gitdir = `pwd`.chomp | |
else | |
begin | |
# Dir::chdir($gitdir) | |
rd, wr = IO::pipe |
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 'socket' | |
host = 'localhost' | |
port = 2000 | |
begin | |
# Give the user some feedback while connecting. | |
STDOUT.print "Connecting..." # Say what we're doing | |
STDOUT.flush # Make it visible right away | |
s = TCPSocket.open(host, port) # Connect |
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 | |
#puts "what dir are you in?" | |
#$gitdir = $stdin.gets.chomp #should work off of cd and then check for .git dir | |
if File.exists?('.git') | |
$gitdir = `pwd`.chomp | |
else | |
begin | |
# Dir::chdir($gitdir) | |
rd, wr = IO::pipe |
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 | |
def quit? | |
begin | |
# See if a 'Q' has been typed yet | |
while c = STDIN.read_nonblock(1) | |
puts "I found a #{c}" | |
return true if c == 'Q' | |
end | |
# No 'Q' found |
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 'webrick' | |
include WEBrick | |
s = HTTPServer.new(:Port => 2002) | |
class MyServlet < HTTPServlet::AbstractServlet | |
def do_GET(req, res) |
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> | |
<script> | |
var debug = true; | |
var main = function display_time( ) { | |
var d = new Date( ); | |
var h = d.getHours( ); | |
var m = d.getMinutes( ); | |
var ampm = (h >= 12) ? "PM" : "AM"; |
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
function child_of(o) { | |
function F() {} | |
F.prototype = o; | |
return new F(); | |
} | |
function Obj() { | |
this.speed = 10; | |
} |
OlderNewer