Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
#!/bin/bash | |
if [ ! $(whoami) = 'root' ]; then | |
echo "This script should be run as root." > /dev/stderr | |
exit 1 | |
fi | |
spinner() | |
{ | |
local pid=$! |
Hi there!
The docker cheat sheet has moved to a Github project under https://github.com/wsargent/docker-cheat-sheet.
Please click on the link above to go to the cheat sheet.
(use-modules (srfi srfi-1) (ice-9 receiver)) | |
(define (gen-xfix-list str generator) | |
(let lp((ret '()) (n (1- (string-length str)))) | |
(if (zero? n) ret (lp (cons (generator str n) ret) (1- n))))) | |
(define (gen-prefix-list str) | |
(gen-xfix-list str (lambda (str n) (substring str 0 n)))) | |
(define (gen-suffix-list str) |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
Fibur is a library that allows concurrency during Ruby I/O operations without needing to make use of callback systems. Traditionally in Ruby, to achieve concurrency during blocking I/O operations, programmers would make use of Fibers and callbacks. Fibur eliminates the need for wrapping your I/O calls with Fibers and a callback. It allows you to write your blocking I/O calls the way you normally would, and still have concurrent execution during those I/O calls.
Say you have a method that fetches data from a network resource:
#!/usr/bin/env ruby | |
# List all keys stored in memcache. | |
# Credit to Graham King at http://www.darkcoding.net/software/memcached-list-all-keys/ for the original article on how to get the data from memcache in the first place. | |
require 'net/telnet' | |
headings = %w(id expires bytes cache_key) | |
rows = [] |
$ ./miniruby -e 'class T; end; a = 1..1; b = "hi"; c = []; d = Hash.new; e = T.new; p GC.dump_heap' | |
0x00154750 allocated @ -e:1 is an OBJECT of type: T | |
0x0015476c allocated @ -e:1 is a HASH which has data | |
0x00154788 allocated @ -e:1 is an ARRAY of len: 0. | |
0x001547c0 allocated @ -e:1 is a STRING (ELTS_SHARED) which has len: 2 and val: hi | |
0x001547dc allocated @ -e:1 is a STRING which has len: 1 and val: T | |
0x001547f8 allocated @ -e:1 which is a CLASS no name - maybe anon class? | |
0x00154814 allocated @ -e:1 which is a CLASS named: T inherits from Object | |
0x00154a98 allocated @ -e:1 is a STRING which has len: 2 and val: hi | |
0x00154b40 allocated @ -e:1 is an OBJECT of type: Range |