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
// Usage : | |
// | |
// @import "BrowserWindow.j" | |
// ... | |
// [BrowserWindow show]; | |
@import <AppKit/CPWindowController.j> | |
@import <AppKit/CPWebView.j> | |
@implementation BrowserWindow : CPWindowController |
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
t = ["vert", "jaune", "rouge"] | |
puts t.push( t.shift )[-1] | |
# => "vert" | |
puts t.push( t.shift )[-1] | |
# => "jaune" | |
puts t.push( t.shift )[-1] | |
# => "rouge" | |
puts t.push( t.shift )[-1] | |
# => "vert" |
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 'net/http' | |
require 'rubygems' | |
#I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2=true | |
require 'nokogiri' | |
# This class allow you to retrive "lorem ipsum" placeholder text from lipsum.com. | |
# | |
# == What is "lorem ipsum"? | |
# |
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 'ar' | |
class DBSchema < AR::Schema 1.0 | |
def self.up | |
create_table :users do |t| | |
t.string :login | |
t.string :password | |
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 'sq' | |
class CreateUsers < SQ::Schema 1.0 | |
def up | |
create_table :users do | |
String :login | |
String :password | |
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
# (The MIT License) | |
# | |
# Copyright (c) 2009 Grégoire Lejeune | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# 'Software'), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to |
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 'eventmachine' | |
class Timer | |
def initialize | |
@run = false | |
@timeout_proc = nil | |
end | |
# Run <tt>blk</tt> every <tt>every</tt> seconds during <tt>during</tt> seconds |
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 'java' | |
require 'rubygems' | |
rb_root = File.dirname(__FILE__) | |
app_root = File.dirname(__FILE__)+'/..' | |
Dir[app_root+"/*.jar"].each { |jar| require jar } | |
require 'rack' | |
Dir[app_root+"/Java/jetty/*.jar"].each { |jar| require jar } |
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
<img src="http://dotgraph.net/embed/[mysite]/image/?src=http://mysite.com/my_graph.dot"> |
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 "shortcut" | |
require 'hotcocoa' | |
class Application | |
include HotCocoa | |
def start | |
application :name => "Shortcut" do |app| | |
app.delegate = self |
OlderNewer