(C-x means ctrl+x, M-x means alt+x)
The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf
:
> - In ruby 1.8.x, what is the functional difference between rb_thread_schedule and rb_thread_select? | |
rb_thread_schedule() is the guts of the thread scheduler, it traverses | |
over the linked list of threads (several times) to find the next one | |
to switch into. The function is long (250 lines) and messy, and covers | |
all the combinations of thread status (RUNNABLE, TO_KILL, STOPPED, | |
KILLED) and wait state (FD, SELECT, TIME, JOIN, PID). | |
If there are no threads doing i/o or waiting on a timeout, | |
rb_thread_schedule() picks another thread from the list (considering |
class Tests | |
SUBTESTS = %w(Abstract Decision Quantitative Verbal) | |
end | |
describe Tests do | |
describe "before assigning @ - " do | |
describe "this doesn't work because the loops are all at the same describe level (the befores override one another)" do | |
Tests::SUBTESTS.each do |test| | |
before(:each) do |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Constant lookup in Ruby can happen lexically or through the ancestry tree of the receiver(a class or module). You can identify which lookup rules are being applied by the context you're in or by the syntax being used to define a class or module.
A class body that is defined as class A::B::C; …; end
will lookup
constants through the ancestry tree when a constant is evaluated in
its class body. Anytime you see A::B::C
being used as syntax to
define a class or lookup the value of a constant the ancestry tree
is being used for the lookup.
#include <GL/glew.h> | |
#include <GLFW/glfw3.h> | |
#include <vector> | |
#include <cmath> | |
#include <cstdio> | |
#include <limits> | |
#include <chrono> | |
#include <thread> | |
#include <mutex> |
File.expand_path(File.dirname(__FILE__)) | |
# If you want to require some files in different directory, in ruby 1.9, you may want to use: | |
require_relative "../xxxlib" |
cpanm -l local https://github.com/<user_name>/<repo_name>/tarball/<branch_name> | |
e.g. | |
cpanm -l local https://github.com/issm/p5-Amon2-Plugin-Model/tarball/master |
#!/bin/bash | |
MAIL_LOG=${LOG_DIR:-/var/log}/mails.log | |
echo '== [' $(date +%Y-%m-%d_%H-%M-%S) '] ==' >> $MAIL_LOG | |
perl -MMIME::QuotedPrint -pe '$_=MIME::QuotedPrint::decode($_);' | tee -a $MAIL_LOG > /dev/null |