Discover gists
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
adaniele@nutcracker:~/ironruby$ mono bin/ir.exe | |
IronRuby 1.0.0.1 on .NET 2.0.50727.42 | |
Copyright (c) Microsoft Corporation. All rights reserved. | |
Note that local variables do not work today in the console. | |
As a workaround, use globals instead (eg $x = 42 instead of x = 42). | |
>>> puts 'hello' | |
hello | |
=> nil |
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
/** | |
* Add link to google maps japan on address-like texts | |
* @param node optional (document.body) | |
* @return links | |
* | |
* @version 20070304 | |
* @see http://nonn-et-twk.net/twk/ | |
* @see http://d.hatena.ne.jp/shinichitomita/20060713/1152800000 | |
*/ | |
function AddressLink(node) { |
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
class Problem | |
attr_reader :x, :y, :op | |
def initialize(op, x, y) | |
@op = op | |
@x = x | |
@y = y | |
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
MODE_EASY = 1 | |
MODE_DIFFICULT = 2 | |
OP_ADD = 0 | |
OP_SUB = 1 | |
OP_MULTI = 2 | |
OP_DIV = 3 | |
QUESTIONS = 100 | |
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
## /users/edit.html.erb | |
<% form_for [:cp, @user], :url => { :action => 'update', :id => @user.id } do |f| %> | |
... | |
<%= collection_select :users, :show_id, Show.find(:all), :id, :name, { :prompt => true } %> | |
## users_controller.rb | |
@user.shows << Show.find(params[:users][:show_id]) | |
## error | |
ActiveRecord::AssociationTypeMismatch in Cp/usersController#update |
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
javascript:(function(){%09var%20s=document.createElement('script');%09s.charset='UTF-8';%09s.language='javascript';%09s.type='text/javascript';%09var%20d=new%20Date;%09s.src='http://gist.github.com/raw/2618/128a57e50252e49e6bd1d417e94bbfcff4af7913?'+d.getMilliseconds();%09document.body.appendChild(s);})() |
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
/* ======================================================================== | |
Flip | |
======================================================================== */ | |
.dashcode-transition-flip-container { | |
-webkit-perspective: 800; /* subviews should have the same perspective during flip */ | |
-webkit-animation-name: "dashcode-transition-flip-container"; | |
} | |
/* This works great for ease-in-out but not for other timing. */ | |
@-webkit-keyframes dashcode-transition-flip-container { |
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
{ :one => "Weee", :two => { :three => "" }, :four => "" }.delete_if { |k,v| v.class == Hash ? v.delete_if { |k2,v2| v2.blank? } : v.blank? } |
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
<% for color in colors %> | |
<%= color %> | |
<% 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
package com.ontometrics; | |
/** | |
* A singleton class, that has external properties injected by spring and be | |
* used by all | |
* | |
* @author Noura | |
* | |
*/ | |
public class ApplicationConfigurations { |