Skip to content

Instantly share code, notes, and snippets.

AllCops:
Exclude:
- 'vendor/**/*'
- 'spec/fixtures/**/*'
- 'db/schema.rb'
Style/TrailingBlankLines:
Enabled: false
Style/AsciiIdentifiers:

Docker Cheat Sheet

Why

Why Should I Care (For Developers)

"Docker interests me because it allows simple environment isolation and repeatability. I can create a run-time environment once, package it up, then run it again on any other machine. Furthermore, everything that runs in that environment is isolated from the underlying host (much like a virtual machine). And best of all, everything is fast and simple."

TL;DR, I just want a dev environment

# see http://stackoverflow.com/questions/5880962/how-to-destroy-jobs-enqueued-by-resque-workers - old version
# see https://github.com/defunkt/resque/issues/49
# see http://redis.io/commands - new commands
namespace :resque do
desc "Clear pending tasks"
task :clear => :environment do
queues = Resque.queues
queues.each do |queue_name|
puts "Clearing #{queue_name}..."
@dsaveliev
dsaveliev / gbrt
Created September 15, 2013 20:49 — forked from Houdini/gbrt
#!/usr/bin/env ruby
def format_commit_info timestamp, time_desc, commit_id, message, ref_name
[
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}",
"(#{time_desc})",
commit_id,
message,
ref_name
]

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой OS, эти термины практически везде одинаковые и здесь они изложены в понятной для начинающих форме.

http://www.qnx.com/developers/docs/6.4.1/neutrino/getting_started/s1_procs.html

Прочесть нужно треть главы до подраздела "Starting a process", если С не пугает, читайте полностью. После прочтения вы будете понимать, что такое process, thread, mutex, priorites, semaphores, scheduler, contex-switch, kernel states.

Ruby

(function() {
var __indexOf = Array.prototype.indexOf || function(item) {
for (var i = 0, l = this.length; i < l; i++) {
if (this[i] === item) return i;
}
return -1;
};
window.onload = function() {
var generateWorld, getDistance, getRange;
Crafty.cfg = {
@dsaveliev
dsaveliev / gist:1230000
Created September 20, 2011 19:04
табы разметка
<div id="page_customer" class="button" onclick="javascript:pageCustomer();">
<div id="page_payment" class="button" onclick="javascript:pagePayment();">
<div id="page_shipping" class="button" onclick="javascript:pageShipping();">
<script language="javascript">
function hideAllTabs() {
document.getElementById('content_customer').style.display = 'none';
document.getElementById('content_payment').style.display = 'none';
document.getElementById('content_shipping').style.display = 'none';
};
function pageCustomer() {
hideAllTabs();
document.getElementById('content_customer').style.display = 'block';
};