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
| # Often times we need to send emails on a delayed basis. We could make this really easy on the client | |
| # side by automatically mounting an endpoint with rack middleware, and firing the mailer with the | |
| # arguments supplied. | |
| # | |
| # Under the hood, this would use the same architecture as an abstract job, where a webhook is hit | |
| # at the specified time, but by focusing on the email / action mailer use case the client doesn't need | |
| # to write any boilerplate code. | |
| Tick::EmailJob.create!( | |
| :at => appointment.start_time - 1.hour, | |
| :message => "Don't forget, your appointment starts in 1 hour!", |
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
| CREATE TABLE IF NOT EXISTS Timelines( | |
| name text, | |
| parent_id text, | |
| event_id uuid, | |
| PRIMARY KEY((parent_id, name), event_id) | |
| ) WITH CLUSTERING ORDER BY (event_id DESC) |
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 UserDecorator < Draper::Decorator | |
| delegate_all | |
| def display_name | |
| "#{first_name} #{last_name}" | |
| end | |
| end | |
| # app/controllers/users_controller.rb | |
| class UsersController < ApplicationController |
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
| .. container:: tab-content | |
| .. container:: tab-pane active | |
| :name: tokenize-js | |
| .. code-block:: javascript | |
| var callback = function(response) { | |
| switch (response.status) { | |
| case 201: |
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/overview/conf.py b/overview/conf.py | |
| index dedd5d5..0fffc9b 100644 | |
| --- a/overview/conf.py | |
| +++ b/overview/conf.py | |
| @@ -235,7 +235,10 @@ htmlhelp_basename = 'Balanceddoc' | |
| # How to display URL addresses: 'footnote', 'no', or 'inline'. | |
| #texinfo_show_urls = 'footnote' | |
| +import pygments.lexers.jvm | |
| import pygments.lexers.web |
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
| $ ./configure --cc=/usr/bin/llvm-gcc-4.2 --prefix=~/rbx/ | |
| ... | |
| $ rake install | |
| GEN vm/gen/config_variables.h | |
| /Users/ajsharp/.rvm/rubies/ruby-1.9.3-p392/bin/ruby vm/codegen/config_vars.rb vm/gen/config_variables.h | |
| mkdir -p /Users/ajsharp/code/rubinius/staging//lib/encoding/converter | |
| /Users/ajsharp/.rvm/rubies/ruby-1.9.3-p392/bin/ruby vm/codegen/field_extract.rb vm/builtin/basic_object.hpp vm/builtin/object.hpp vm/builtin/integer.hpp vm/builtin/fixnum.hpp vm/builtin/array.hpp vm/builtin/bignum.hpp vm/builtin/executable.hpp vm/builtin/access_variable.hpp vm/builtin/alias.hpp vm/builtin/block_environment.hpp vm/builtin/block_as_method.hpp vm/builtin/byte_array.hpp vm/builtin/io.hpp vm/builtin/channel.hpp vm/builtin/module.hpp vm/builtin/constant_table.hpp vm/builtin/class.hpp vm/builtin/compiled_code.hpp vm/builtin/data.hpp vm/builtin/dir.hpp vm/builtin/exception.hpp vm/builtin/float.hpp vm/builtin/immediates.hpp vm/builtin/iseq.hpp vm/builtin/list.hpp vm/builtin/lookup_table.hpp vm/builtin/ffi_pointer.hpp vm/bui |
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
| checking for gcc... /usr/bin/gcc-4.2 | |
| checking whether the C compiler works... no | |
| configure: error: in `/Users/ajsharp/code/rubinius/vendor/libffi': | |
| configure: error: C compiler cannot create executables | |
| See `config.log' for more details | |
| make: *** [config.status] Error 77 | |
| Error: make |
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
| Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p open) | |
| read-kbd-macro(open) | |
| #[(keys) "\301^H!\207" [keys read-kbd-macro] 2 1648419](open) | |
| (kbd open) | |
| (define-key js2-mode-map (kbd open) (ilam (js2r--self-insert-wrapping open close semicolonp))) | |
| js2r--setup-wrapping-pair("(" ")" js2r--needs-semi) | |
| eval-buffer(#<buffer *load*> nil "/Users/ajsharp/.emacs.d/setup-js2-mode.el" nil t) ; Reading at buffer position 3604 | |
| load-with-code-conversion("/Users/ajsharp/.emacs.d/setup-js2-mode.el" "/Users/ajsharp/.emacs.d/setup-js2-mode.el" nil t) | |
| require(setup-js2-mode) | |
| (lambda nil (require (quote setup-js2-mode)))() |
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
| namespace :db do | |
| namespace :migrate do | |
| desc "Re-run a migration that's already been run" | |
| task :rerun => [:environment, :load_config] do | |
| class ActiveRecord::Migrator | |
| def rerun | |
| target = migrations.detect { |m| m.version == @target_version } | |
| raise UnknownMigrationVersionError.new(@target_version) if target.nil? | |
| target.migrate(:up) | |
| 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
| def object_report(type = nil) | |
| if type | |
| puts "number of (#{type}) objects in memory = #{ObjectSpace.each_object(type).count}" | |
| else | |
| puts "number of objects in memory = #{ObjectSpace.each_object.count}" | |
| end | |
| end | |
| def full_report | |
| ObjectSpace.each_object.to_a.inject(Hash.new(0)) do |h,o| |