Skip to content

Instantly share code, notes, and snippets.

View allomov's full-sized avatar

Aliaksandr Lomau allomov

View GitHub Profile
irb(main):004:0> x = RubyVM::InstructionSequence.new('puts "hello #{foo}"')
=> <RubyVM::InstructionSequence:<compiled>@<compiled>>
irb(main):005:0> puts x.disasm
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putself
0003 putobject "hello "
0005 putself
0006 opt_send_simple <callinfo!mid:foo, argc:0, FCALL|VCALL|ARGS_SKIP>
0008 tostring
@gramos
gramos / installing-cf-warden-on-debian.md
Last active December 19, 2015 15:38
Installing Cloud Foundry Warden on Debian

How warden installation works

First, lets try to understand what the rake setup does, it creates a basic linux system under /tmp/warden directory using 2 basic tools: debootstrap and chroot. Deboostrap is a tool that setup a basic debian OS, ubuntu is based on debian so that's the reason why we can use debootstrap to create ubuntu systems too, basically you run: debootstrap [OPTION...] SUITE TARGET [MIRROR [SCRIPT]] see (man deboostrap). After the installation you can use that system with chroot command to run commands or interactive shell with a special root directory (see man chroot).

@joerayme
joerayme / LICENSE
Created July 5, 2013 13:33
Very simple Graphite widget for Dashing
Copyright (c) 2013 Couller Ltd. and Joseph Ray
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@somebody32
somebody32 / gist:5232120
Last active October 4, 2022 08:19
Список литературы для ознакомления с concurrent programming и реализацией этих принципов и подходов на ruby. Огромное спасибо @brainopia за составление.

Введение

Начать стоит отсюда. Не пугайтесь то, что это книга по незнакомой 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

@jpmens
jpmens / graphite-req.txt
Last active October 12, 2015 19:08
Ansible playbook for installing Graphite in virtualenv on Lucid
Django==1.3
Flask==0.9
graphite-web
carbon==0.9.10
whisper
uwsgi
simplejson
django-tagging
@dnishimura
dnishimura / Makefile.golang
Created June 20, 2012 17:51 — forked from yanatan16/Makefile.golang
Makefile for Golang projects
# Makefile for a go project
#
# Author: Jon Eisen
# site: joneisen.me
#
# Targets:
# all: Builds the code
# build: Builds the code
# fmt: Formats the source files
# clean: cleans the code
@joelmoss
joelmoss / gist:2470666
Created April 23, 2012 12:37
Capistrano recipe for Puma start/stop/restarts
set :shared_children, shared_children << 'tmp/sockets'
namespace :deploy do
desc "Start the application"
task :start, :roles => :app, :except => { :no_release => true } do
run "cd #{current_path} && RAILS_ENV=#{stage} bundle exec puma -b 'unix://#{shared_path}/sockets/puma.sock' -S #{shared_path}/sockets/puma.state --control 'unix://#{shared_path}/sockets/pumactl.sock' >> #{shared_path}/log/puma-#{stage}.log 2>&1 &", :pty => false
end
desc "Stop the application"
task :stop, :roles => :app, :except => { :no_release => true } do
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@thijsc
thijsc / gist:1391107
Created November 24, 2011 11:08
Select item from chosen js select with Capybara and Selenium
def select_from_chosen(item_text, options)
field = find_field(options[:from])
option_value = page.evaluate_script("$(\"##{field[:id]} option:contains('#{item_text}')\").val()")
page.execute_script("$('##{field[:id]}').val('#{option_value}')")
end
@jrob00
jrob00 / gist:1350507
Created November 9, 2011 05:29
Installing RVM, Ruby, Heroku, Homebrew, Node.js, NPM
http://devcenter.heroku.com/articles/quickstart
http://martinciu.com/2011/11/deploying-hubot-to-heroku-like-a-boss.html
1. install RVM: https://rvm.beginrescueend.com/
2. install Ruby: rvm install 1.9.2 && rvm use 1.9.2 --default
3. install Heroku: sudo gem install heroku
4. install Homebrew: https://github.com/mxcl/homebrew/wiki/Installation