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
// JQuery URL Parser plugin - https://github.com/allmarkedup/jQuery-URL-Parser | |
// Written by Mark Perkins, mark@allmarkedup.com | |
// License: http://unlicense.org/ (i.e. do what you want with it!) | |
;(function($, undefined) { | |
var tag2attr = { | |
a : 'href', | |
img : 'src', | |
form : 'action', |
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
/*! | |
* 2009 Jiayong Ou | |
* | |
* License (MIT): | |
* http://github.com/jou/jquery.tap.js/blob/master/LICENSE | |
*/ | |
(function(){ | |
jQuery.fn.tap = function(fn /* [callback_arg], [callback_arg], [...] */) { | |
var args = jQuery.makeArray(arguments); | |
args.unshift(); |
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
# -*- encoding: utf-8 -*- | |
lib = File.expand_path('../lib/', __FILE__) | |
$:.unshift lib unless $:.include?(lib) | |
require "current/version" | |
Gem::Specification.new do |s| | |
s.name = "current" | |
s.version = Current::VERSION | |
s.platform = Gem::Platform::RUBY |
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
$RAILS = {scheme: 'http', host: 'localhost', port: '3000' } | |
def $RAILS.scheme; $RAILS[:scheme]; end | |
def $RAILS.host; $RAILS[:host]; end | |
def $RAILS.port; $RAILS[:port]; end | |
def $RAILS.authority; "#{$RAILS.host}:#{$RAILS.port}"; end | |
def $RAILS.uri_root; "#{$RAILS.scheme}://#{$RAILS.host}:#{$RAILS.port}"; 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 'shell' | |
class VERSION | |
sh = Shell.cd(Rails.root) | |
@@i=sh.system('hg','identify','-i').to_s.gsub("\n","") | |
@@n=sh.system('hg','identify','-n').to_s.gsub("\n","") | |
@@b=sh.system('hg','identify','-b').to_s.gsub("\n","") | |
cattr_reader :i,:n,:b | |
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
@techs.empty? | |
# Output "I love Ruby" | |
say = "I love Ruby" | |
puts say | |
# Output "I *LOVE* RUBY" | |
say['love'] = "*love*" | |
puts say.upcase | |
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
<div id="fb-root"></div> | |
<script>(function(d, s, id) { | |
var js, fjs = d.getElementsByTagName(s)[0]; | |
if (d.getElementById(id)) {return;} | |
js = d.createElement(s); js.id = id; | |
js.src = "//connect.facebook.net/ja_JP/all.js#xfbml=1&appId=111570108909859"; | |
fjs.parentNode.insertBefore(js, fjs); | |
}(document, 'script', 'facebook-jssdk'));</script> |
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
a = {a:1,b:2} | |
b = {b:3,c:4} | |
$.extend(a, b) | |
a #=> {a: 1, b: 3, c: 4} | |
a = {a:1,b:2} | |
b = {b:3,c:4} | |
_.extend(a, b) | |
a #=> {a: 1, b: 3, c: 4} |
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 A | |
def a | |
"super" | |
end | |
end | |
module B | |
def a | |
"module" | |
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
class EnumInput < Formtastic::Inputs::SelectInput | |
def collection | |
enum = @object.enums(@method.to_sym) | |
choices = enum ? enum.select_options : [] | |
end | |
end |
OlderNewer