This is now an actual repo:
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 ApplicationController < ActionController::Base | |
| ... | |
| # FORCE to implement content_for in controller | |
| def view_context | |
| super.tap do |view| | |
| (@_content_for || {}).each do |name,content| | |
| view.content_for name, content | |
| end | |
| 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
| /* | |
| As of version 1.1.2, Propane will load and execute the contents of | |
| ~Library/Application Support/Propane/unsupported/caveatPatchor.js | |
| immediately following the execution of its own enhancer.js file. | |
| You can use this mechanism to add your own customizations to Campfire | |
| in Propane. | |
| Below you'll find two customization examples. |
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
| /*! | |
| * jQuery Tiny Pub/Sub - v0.X - 11/18/2010 | |
| * http://benalman.com/ | |
| * | |
| * Original Copyright (c) 2010 "Cowboy" Ben Alman | |
| * Dual licensed under the MIT and GPL licenses. | |
| * http://benalman.com/about/license/ | |
| * | |
| * Made awesome by Rick Waldron | |
| * |
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
| #!/usr/bin/env ruby | |
| SECONDS_IN_DAY = (24*60*60) | |
| REPORT_ROOT = File.expand_path("~/Documents/Business/Accounts/iTunes Finance Reports") | |
| # I group US and WW on the same invoice as they are both in USD | |
| INVOICE_GROUPS = [%w{AU}, %w{CA}, %w{GB}, %w{EU}, %w{US WW}, %w{JP}] | |
| one_month_ago = Time.now - (30 * SECONDS_IN_DAY) | |
| # My "fetch_finance_reports" script puts reports in a sub-dir e.g. 2010-09-Aug |
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
| # Using MacPort libs for all RVM rubie installs. | |
| export CC='/usr/bin/gcc-4.2' | |
| export CFLAGS='-O2 -arch x86_64' | |
| export LDFLAGS='-L/opt/local/lib' | |
| export CPPFLAGS='-I/opt/local/include' | |
| rvm install saidrubie -C --with-opt-dir=/opt/local |
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
| ejb-mbp2:activerecord-sqlserver-adapter ebryn$ ruby test/benchmark/query_sqlserver.rb | |
| -- create_table(:test_benchmarks, {:force=>true}) | |
| -> 0.0715s | |
| Query Sqlserver | |
| =============== | |
| Author: Erik Bryn | |
| Date: October 19, 2010 | |
| Summary: Benchmark SQL Server Queries | |
| System Information |
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
| Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%L") # => "123" | |
| Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%3N") # => "123" millisecond (3 digits) | |
| Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%6N") # => "123000" microsecond (6 digits) | |
| Time.utc(1999, 12, 30, 23, 45, 00, 123000).strftime("%9N") # => "123000000" nanosecond (9 digits) | |
| Time.utc(1999, 12, 30, 23, 45, 00, 123000).to_f # => 946597500.123 | |
| Time.utc(1999, 12, 30, 23, 45, 00, 123000).usec # => 123000 | |
| require 'date' | |
| require 'rational' |
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
| [datetime] => SYBDATETIME | |
| 61 1753-01-01T00:00:00.000 y:1753, m:1, d:1 h:0, m:0, s:0 MS:0 tz:1550134876 | |
| 62 9999-12-31T23:59:59.997 y:9999, m:12, d:31 h:23, m:59, s:59 MS:997 tz:1550134876 | |
| 63 2010-01-01T12:34:56.123 y:2010, m:1, d:1 h:12, m:34, s:56 MS:123 tz:1744847616 | |
| [smalldatetime] => SYBDATETIME4 | |
| 231 1901-01-01T15:45:00.000Z days:365 minutes:945 (since 1/1/1900, since midnight) | |
| 232 2078-06-05T04:20:00.000Z days:65169 minutes:260 " | |
| [datetime2_7] => SYBCHAR | |
| 71 0001-01-01T00:00:00.0000000Z 0001-01-01 00:00:00.0000000 |
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
| # result = @client.execute('SELECT 1 AS [one]') | |
| # result.cancel | |
| # result.cancel | |
| write.c:136:tds_put_string converting 17 bytes of "SELECT 1 AS [one]" | |
| write.c:164:tds_put_string wrote 34 bytes | |
| util.c:162:Changed query state from QUERYING to PENDING | |
| net.c:779:Sending packet |