This file contains hidden or 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
| def tip(msg); puts; puts msg; puts "-"*100; end | |
| # | |
| # 30 Ruby 1.9 Tips, Tricks & Features: | |
| # http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
| # | |
| tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
| tip "Ruby 1.9 supports named captures in regular expressions!" |
This file contains hidden or 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
| <!doctype html> | |
| <!--[if lt IE 7]> <html class="ie6 oldie" lang="en"> <![endif]--> | |
| <!--[if IE 7]> <html class="ie7 oldie" lang="en"> <![endif]--> | |
| <!--[if IE 8]> <html class="ie8 oldie" lang="en"> <![endif]--> | |
| <!--[if IE 9]> <html class="ie9" lang="en"> <![endif]--> | |
| <!--[if gt IE 9]><!--> | |
| <html lang="en"> | |
| <!--<![endif]--> | |
| <head> | |
| <meta charset="utf-8"> |
This file contains hidden or 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
| diff --git a/ChangeLog b/ChangeLog | |
| index c4ea779..0a6bf73 100644 | |
| --- a/ChangeLog | |
| +++ b/ChangeLog | |
| @@ -1,3 +1,188 @@ | |
| +Tue Jan 17 12:32:46 2012 Nobuyoshi Nakada <[email protected]> | |
| + | |
| + * gc.c (aligned_malloc, aligned_free): covered missing defined | |
| + operators and fixes for cygwin. | |
| + |
This file contains hidden or 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
| source :rubygems | |
| # We are not loading Active Record, nor Active Resources etc. | |
| # We can do this in any app by simply replacing the rails gem | |
| # by the parts we want to use. | |
| gem "actionpack", "~> 3.2" | |
| gem "railties", "~> 3.2" | |
| gem "tzinfo" | |
| # Let's use thin |
This file contains hidden or 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
| # 2012-01-07 | |
| # | |
| # Mac OS X 10.5.8 | |
| # Homebrew 0.9 | |
| # Xcode 3.1.4 | |
| # Git 1.7.10 | |
| # RVM 1.3.0 | |
| # Ruby 1.9.3 | |
| # MySQL 5.5.20 | |
| # ImageMagick 6.7.5-7 |
This file contains hidden or 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 FooController | |
| respond_to :csv | |
| def index | |
| @foos = Foo.scoped | |
| if stale?(:last_modified => Foo.something) | |
| respond_with @gta do |format| | |
| format.csv { stream_csv @foo } | |
| end | |
| end |
This file contains hidden or 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
| format.csv do | |
| @scheduled_session = Session.find(params[:id]) | |
| @applicants = @scheduled_session.applicant_signups | |
| filename = "#{@scheduled_session.title.parameterize.downcase}_applicant_list_#{Time.now.strftime('%d%m%Y')}.csv" | |
| headers['Content-Disposition'] = 'attachment; filename="' + filename + '"' | |
| titles = [ | |
| "Title", "First Name", "Last Name", "DOB Day", "DOB Month", "DOB Year", "Nationality", \ | |
| "Email", "Mobile Number", "Address Line 1", "Address Line 2", "Place of Work", \ | |
| "Discipline/Speciality", "Job Title", "Key Responsibilities", "Payment Ref." | |
| ] |
This file contains hidden or 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
| data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |
This file contains hidden or 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 'ap' | |
| require 'ripper' | |
| CLASS_TEXT = "class A; end; class B; end" | |
| CLASS_SEXP = Ripper.sexp(CLASS_TEXT) | |
| BIG_TEXT = "class A; def a; @a = b; end; def b; @d = a; @e = a; end; end; module B; def b; end; end" | |
| BIG_SEXP = Ripper.sexp(BIG_TEXT) |
This file contains hidden or 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
| -- Copyright (c) 2009, Ionut Gabriel Stan. All rights reserved. | |
| -- | |
| -- Redistribution and use in source and binary forms, with or without modification, | |
| -- are permitted provided that the following conditions are met: | |
| -- | |
| -- * Redistributions of source code must retain the above copyright notice, | |
| -- this list of conditions and the following disclaimer. | |
| -- | |
| -- * Redistributions in binary form must reproduce the above copyright notice, | |
| -- this list of conditions and the following disclaimer in the documentation |
OlderNewer