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 'rake' | |
require 'rake/gempackagetask' | |
LEGS_GEMSPEC = eval(File.read('mtest.gemspec')) | |
Rake::GemPackageTask.new(LEGS_GEMSPEC) do |pkg| | |
pkg.need_tar_bz2 = true | |
end | |
task :default => "pkg/#{LEGS_GEMSPEC.name}-#{LEGS_GEMSPEC.version}.gem" 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
#!/usr/bin/env ruby | |
puts $stdin.read.gsub(Regexp.new(ARGV[0]), ARGV[1]) |
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
/* | |
* js3 - javascript simple slideshow system | |
* | |
*/ | |
js3 = { | |
"current": 0, | |
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' | |
class Jaxer | |
class << self | |
def json_to_png(json) | |
# producing image data | |
File.open('foo', 'w+') do |f| | |
cmd = "echo" | |
raise "Failed to convert canvas to PNG." unless system(cmd) |
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
str, t = "", nil | |
b, bt = "", nil | |
c = nil | |
vc = 0 | |
Shoes.app :height => 500, :width => 450 do | |
background rgb(77, 77, 77) | |
stack :margin => 10 do | |
para span("TEXT EDITOR", :stroke => red, :fill => white), " * USE ALT-Q TO QUIT", :stroke => white | |
bt = para "Select: ", :margin => 1, :font => "10px", :stroke => white | |
c = para "Cursors (r|v): ", :margin => 1, :font => "10px", :stroke => white |
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
class Term | |
def method_missing(meth, *args) | |
cmd = args.unshift(meth).collect! {|a| a.to_s }.join(' ') | |
puts `tput #{cmd}` | |
end | |
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
$HTTP["host"] == "yapok.org" { | |
server.document-root = "/home/madx/yapok.org/" | |
$HTTP["url"] =~ "^/.*" { | |
expire.url = ("" => "access plus 10 years") | |
} | |
} | |
$HTTP["host"] == "www.yapok.org" { | |
url.redirect = ( "^/(.*)" => "http://yapok.org/$1" ) | |
} |
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
int fib(n) { | |
if(n <= 1) | |
return 1; | |
else | |
return fib(n-1)+fib(n-2); | |
} | |
int main() { | |
fib(30); | |
return 0; |
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
module Xup#:nodoc: | |
module Helpers#:nodoc: | |
module Typography | |
def parse_typography | |
# Unbreakable spaces before double punctuations | |
parse_unbreakable_punctuation ':' | |
parse_unbreakable_punctuation ';' | |
parse_unbreakable_punctuation '!' | |
parse_unbreakable_punctuation '?' |
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
#include "main.h" | |
Line * Line_new(int id, int city_c, int travel_c) { | |
int i; | |
Line * line = malloc(sizeof(Line)); | |
assert(line != NULL); | |
line->id = id; | |
line->city_c = city_c; | |
line->travel_c = travel_c; |
OlderNewer