start new:
tmux
start new with session name:
tmux new -s myname
>> load './RUNME-demo_of_async_fibers.rb' | |
/Users/flip/ics/backend/son_of_a_batch/RUNME-demo_of_async_fibers.rb:4: warning: already initialized constant FIBER_IDXS | |
814e5e90 0 f_0 beg main top level | |
814e5e90 1 f_0 beg em setup this block sets up the eventmachine execution, but no execution-order shenanigans yet | |
814e5e90 2 f_0 beg fiber stp the end-the-reactor block won't be called for 1.5s, so we get here immediately. | |
814e5e90 3 f_0 end fiber stp nothing from inside the Fiber.new{} block has run yet. | |
814e5e90 4 f_0 end fiber stp kick off the fiber... | |
80d829a0 5 f_1 beg fiber when my_fiber.resume is called, this runs. Now in a new fiber | |
80d829a0 6 f_1 beg get_result get_result is called from within fiber_1 | |
80d829a0 7 f_1 setup callback set up some code to run 1.5s from now |
require 'logger' | |
$logger = Logger.new(STDOUT) | |
require 'active_support/cache' | |
$cache = ActiveSupport::Cache.lookup_store(:memory_store) | |
$cache.logger = $logger | |
$cache.clear | |
class EtagMiddleware |
# Git pre-commit hook to check all staged Ruby (*.rb/haml/coffee) files | |
# for Pry binding references | |
# | |
# Installation | |
# | |
# ln -s /path/to/pre-commit.sh /path/to/project/.git/hooks/pre-commit | |
# | |
# Based on | |
# | |
# http://codeinthehole.com/writing/tips-for-using-a-git-pre-commit-hook/ |
module Mongoid | |
module Document | |
def instantiate(attrs = nil, criteria_instance_id = nil) | |
attributes = attrs || {} | |
doc = allocate | |
doc.criteria_instance_id = criteria_instance_id | |
doc.instance_variable_set(:@attributes, attributes) | |
doc.apply_defaults | |
IdentityMap.set(doc) if identity_map_set_possible?(criteria_instance_id) | |
doc.run_callbacks(:initialize) unless doc._initialize_callbacks.empty? |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
--- Actions --- | |
$Copy <M-C> | |
$Cut <M-X> <S-Del> | |
$Delete <Del> <BS> <M-BS> | |
$LRU | |
$Paste <M-V> | |
$Redo <M-S-Z> <A-S-BS> | |
$SearchWeb <A-S-G> | |
$SelectAll <M-A> | |
$Undo <M-Z> |
These are for the combined vim-sexp
(https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people
(https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp
is neat on its own but Tim Pope makes common stuff much easier.
Note that some vim-sexp
functionality depends on <LocalLeader>
mappings. This is a different leader key than the global leader, and is the variable maplocalleader
(instead of mapleader
). To see if you have this set, use :echo maplocalleader
; if it errors out you'll need to set it, otherwise it will echo the key. If you want to set your LocalLeader
to <Space>
, you'll need two commands in your .vimrc
, since by default <Space>
is bound to <Right>
in normal mode:
nnoremap <Space> <Nop>
let maplocalleader=" "
It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.