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 'active_support/dependencies' | |
module ActiveSupport::Dependencies | |
alias_method :require_or_load_without_multiple, :require_or_load | |
def require_or_load(file_name, const_path = nil) | |
if file_name.starts_with?(Rails.root.to_s + '/app') | |
relative_name = file_name.gsub(Rails.root.to_s, '') | |
@engine_paths ||= Rails::Application::Railties.engines.collect{|engine| engine.config.root.to_s } | |
@engine_paths.each do |path| | |
engine_file = File.join(path, relative_name) | |
require_or_load_without_multiple(engine_file, const_path) if File.file?(engine_file) |
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 AppDelegate | |
def application(application, didFinishLaunchingWithOptions:launchOptions) | |
@window = UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds) | |
@window.rootViewController = ExampleViewController.alloc.init | |
@window.makeKeyAndVisible | |
true | |
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
it 'should perform a long running operation' do | |
@ary.performSelector("addObject:", withObject:"soup", afterDelay:0.5) | |
wait 0.6 do | |
@ary.size.should.be 1 | |
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
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="1.1" toolsVersion="2182" systemVersion="11E53" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="TW7-Kq-wgK"> | |
<dependencies> | |
<deployment defaultVersion="1296" identifier="iOS"/> | |
<development defaultVersion="4200" identifier="xcode"/> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="1181"/> | |
</dependencies> | |
<scenes> | |
<!--View Controller - Item 2--> | |
<scene sceneID="po5-V2-n83"> |
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
{% if site.coderwall_user %} | |
<section> | |
<h1>Coderwall Badges</h1> | |
<ul id="cw_badges"> | |
<li class="loading">Status updating...</li> | |
</ul> | |
<p id="badges"></p> | |
<script type="text/javascript"> | |
function show_achievements(args) { | |
var badges = args["data"]["badges"]; |
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
url: http://toamitkumar.github.com | |
title: RubyizednRailified Blog | |
subtitle: Ruby, Rails and others. | |
author: Amit Kumar | |
simple_search: http://google.com/search | |
description: toamitkumar | |
date_format: "ordinal" | |
subscribe_rss: /atom.xml | |
subscribe_email: |
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 'nokogiri' | |
require 'fileutils' | |
require 'date' | |
require 'uri' | |
# usage: ruby blogger_import.rb my-blog.xml | |
data = File.read ARGV[0] | |
doc = Nokogiri::XML(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
class Product | |
def initialize | |
@name = "Ruby Book" | |
@price = 20.65 | |
end | |
end | |
product = Product.new | |
hash = {} | |
product.instance_variables.each {|attr| hash[attr.to_s.delete("@")] = product.instance_variable_get(attr) } |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |