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
# Requires Cramp 0.8+ | |
require 'rubygems' | |
require 'usher' | |
require 'cramp/controller' | |
Cramp::Controller::Websocket.backend = :thin | |
class WebsockAction < Cramp::Controller::Websocket | |
periodic_timer :send_hello_world, :every => 2 | |
on_data :received_data |
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 'open-uri' | |
# url dsl -- the ultimate url dsl! | |
# | |
# You just can't beat this: | |
# | |
# $ irb -r url_dsl | |
# >> include URLDSL | |
# => Object | |
# >> http://github.com/defunkt.json |
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/dns/resolver' | |
# Custom Domain | |
# | |
# Require net-dns gem | |
# | |
# A Rack middleware to to resolve the custom domain to original subdomain | |
# for your multi telent application. | |
# | |
# It's all transperant to your application, it performs cname lookup and |
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
# Delete unnecessary files | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/images/rails.png" | |
run "rm public/javascripts/prototype.js" | |
run "rm public/javascripts/effects.js" | |
run "rm public/javascripts/dragdrop.js" | |
run "rm public/javascripts/controls.js" | |
# Copy database.yml for distribution use |
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
Processing CommentsController#create (for 85.177.137.90 at 2009-02-24 22:13:48) [POST] | |
Session ID: | |
Parameters: {"comment"=>{"filter_id"=>"Textile", "author"=>"patrick Detlefsen", "content"=>"hello world comment", "author_email"=>"", "author_url"=>""}, "submit"=>"Save Comment", "url"=>["articles"], "action"=>"create", "controller"=>"comments"} | |
Redirected to http://patrickdetlefsen.com/articles/comments#comment-1 | |
Completed in 3.47220 (0 reqs/sec) | DB: 0.06800 (1%) | 302 Found [http://patrickdetlefsen.com/articles/comments] | |
Processing CommentsController#index (for 85.177.137.90 at 2009-02-24 22:13:52) [GET] | |
Session ID: |
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
(define | |
(container-ok? maxvolumen container) | |
(= (apply + container) maxvolumen)) | |
(define | |
(container-zu-voll? maxvolumen container) | |
(> (apply + container) maxvolumen)) | |
(define | |
(packecontainer stueckgutliste maxvolumen1 container1) |
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 'gistit' | |
gist = Gistit.new | |
gist.paste("puts 'hello world!'") # => 12345 | |
gist.delete 12345 # => 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
defmodule FooServer do | |
@behaviour :gen_server | |
@server_name {:global, :foo_server} | |
# Client | |
def do_it do | |
try do | |
:gen_server.call @server_name, :foo | |
catch |
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
vinz_access [master] ✗ $ mix deps.get && mix test | |
All dependencies up to date | |
* Compiling poolboy | |
==> poolboy (compile) | |
* Compiling decimal | |
* Compiling postgrex | |
* Compiling ecto | |
Compiled lib/mix/tasks/access.ex | |
Compiled lib/vinz/access/repo.ex | |
Compiled lib/vinz/access/models/principal.ex |
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
vinz_access [master] $ mix deps.get && mix test | |
All dependencies up to date | |
* Compiling poolboy | |
==> poolboy (compile) | |
* Compiling decimal | |
Compiled lib/decimal.ex | |
Generated decimal.app | |
* Compiling postgrex | |
Compiled lib/postgrex/binary_utils.ex | |
Compiled lib/postgrex/records.ex |