Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.
(e.g. app/models/concerns/, app/models/products/)
| require 'ripper' | |
| def Object.const_missing(name) | |
| klass = const_set name, Class.new | |
| klass.class_eval do | |
| def method_missing name, *args | |
| file, line_num, _ = caller[0].split(':') | |
| file_contents = File.open(file).read |
| body { | |
| font-family: Helvetica, arial, sans-serif; | |
| font-size: 14px; | |
| line-height: 1.6; | |
| padding-top: 10px; | |
| padding-bottom: 10px; | |
| background-color: white; | |
| padding: 30px; } | |
| body > *:first-child { |
| #!/usr/bin/env ruby | |
| shared_secret = SecureRandom.random_number 1_000_000_000 | |
| server1_secret = SecureRandom.random_number 10_000_000_000_000 | |
| server2_secret = SecureRandom.random_number 10_000_000_000_000 | |
| server1_public_key = shared_secret ^ server1_secret | |
| server2_public_key = shared_secret ^ server2_secret |
| data = { | |
| "books" => [ | |
| { | |
| "title" => "Exceptional Ruby", | |
| "revisions" => [ | |
| {"date" => "2011-12-01"}, | |
| {"date" => "2012-06-15"} | |
| ] | |
| }, | |
| { |
| def compress(string) | |
| compressed = string.chars.inject([]) do |accu, char| | |
| if accu.empty? || accu.last.first != char | |
| accu << [char, 1] | |
| else | |
| accu[0...-1] << [char, accu.last.last + 1] | |
| end | |
| end.map(&:join).join | |
| [string, compressed].min_by(&:length) |
| #!/bin/bash | |
| OPENSSL_VERSION="1.0.1g" | |
| curl -O http://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz | |
| tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
| mv openssl-$OPENSSL_VERSION openssl_i386 | |
| tar -xvzf openssl-$OPENSSL_VERSION.tar.gz | |
| mv openssl-$OPENSSL_VERSION openssl_x86_64 | |
| cd openssl_i386 |
ledger comes with a built in budget system, but I wanted to get an “envelope”, or “YNAB” style budget working. While this was easy to do in theory, in practice it proved more difficult. The theory is pretty simple; enevelope budgeting merely requires you to create some new accounts to keep track of each “envelope” of money. But in practice, it requires a huge amount of duplicate data-entry, because even when using ledger’s automatic transactions, because each month’s budget is mostly the same but not necessarily exactly the same.The following
| (setq gnus-select-method '(nnnil)) | |
| (setq gnus-secondary-select-methods '((nntp "news.gwene.org"))) |