Skip to content

Instantly share code, notes, and snippets.

@noel
noel / 2012 Top 10 movies
Created December 28, 2012 22:53
Ebert's top 10 for 2012
1. • "Argo"
2. • "Life of Pi"
3. • "Lincoln"
4. • "End of Watch"
5. • "Arbitrage"
6 • "Flight"
7. • "The Sessions"
8. • "Beasts of the Southern Wild"
9. • "Oslo, August 31"
10. "A Simple Life"
<VirtualHost *:80>
ServerName smdm-test.mycompany.com
DocumentRoot /smdm/apps/reports_app/current/public
<Directory /smdm/apps/reports_app/current/public>
AllowOverride all
Options -MultiViews
</Directory>
# MultiViews must be turned off.
Options -MultiViews
/usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- ruby_debug.so (LoadError)
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/debugger-1.2.0/lib/ruby-debug-base.rb:1:in `<top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `require'
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/local/rvm/gems/ruby-1.9.3-p286/gems/activesupport-3.2.7/lib/active_su
// adds commas to large numbers
function thousandsFormatter(nStr)
{
nStr += '';
x = nStr.split('.');
x1 = x[0];
x2 = x.length > 1 ? '.' + x[1] : '';
var rgx = /(\d+)(\d{3})/;
while (rgx.test(x1)) {
x1 = x1.replace(rgx, '$1' + ',' + '$2');
ActionView::Template::Error (invalid byte sequence in UTF-8):
18: - @report.grid.details.each do |field|
19: %tr
20: %td{style: "width: 30%;"}= field
21: %td= row[field]
22:
23: .pull-right
24: = will_paginate @report.data
app/views/reports/_grid.html.haml:21:in `block (2 levels) in _app_views_reports__grid_html_haml___506165555_86852150'
app/views/reports/_grid.html.haml:18:in `each'
@noel
noel / before_ssh
Created June 27, 2012 20:56
encoding in Cygwin
$ locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=
@noel
noel / gist:2870859
Created June 4, 2012 21:07
mod_rewrite
ErrorDocument 503 /system/maintenance.html
RewriteEngine On
RewriteCond %{REQUEST_URI} !.(css|gif|jpg|png)$
RewriteCond %{DOCUMENT_ROOT}/system/maintenance.html -f
RewriteCond %{SCRIPT_FILENAME} !maintenance.html
RewriteRule ^/([^/]+)(/|/.*)?$ /$1/system/maintenance.html [L]
# lib/ldap_auth/engine.rb
module LdapAuth
class Engine < Rails::Engine
# initialize "agmen_ldap_auth.load_app_instance_data" do |app|
# AmgenLdapAuth.setup do |config|
# config.app_root = app.root
# end
# end
# initialize "agmen_ldap_auth.load_static_assets" do |app|
~/development/supplier_app $ bundle exec rspec spec/models/supplier_spec.rb
.
Finished in 0.11917 seconds
1 example, 0 failures
~/development/supplier_app $ bundle exec rspec spec
F
Failures:
1) Supplier Validations: Country needs to be in list of Currencies
Failure/Error: good_country_supplier.should be_valid
expected valid? to return true, got false
~/development/supplier_app $ rails c test
Loading test environment (Rails 3.2.1)
irb(main):001:0> Currency.pluck :country
(0.3ms) SELECT country FROM "currencies"
=> ["US"]
irb(main):002:0> s = Supplier.new(:country => "US")
=> #<Supplier id: nil, company: nil, purchasing_org: "A001", account_group: "0001", name: nil, search_term_1: nil, count
ry: "US", language: "E", tax_number_1: "SSN for US OR GST for CA", tax_number_2: "EIN for US OR HST for CA", tax_type: n
il, vat: nil, tax_number: "QST for CA", bank_country: nil, bank_key: nil, bank_account: nil, bank_account_holder: nil, b
ank_type: "BNK1", recon_account: "200010", payment_terms: nil, check_double_inv: "X", payment_methods: nil, wh_tax_count