Skip to content

Instantly share code, notes, and snippets.

View r10r's full-sized avatar

Ruben Jenster r10r

  • Drachenfels GmbH
  • Pforzheim
View GitHub Profile
@wr0ngway
wr0ngway / gc-cow.rb
Created March 23, 2012 17:46
test to see if GC in ruby 2 is truly copy on write friendly
#!/usr/bin/env ruby
rss = '.+?Rss:\s+(\d+)'
share = '.+?Shared_Clean:\s+(\d+)'
share << '.+?Shared_Dirty:\s+(\d+)'
priv = '.+?Private_Clean:\s+(\d+)'
priv << '.+?Private_Dirty:\s+(\d+)'
MEM_REGEXP = /\[heap\]#{rss}#{share}#{priv}/m
def mem_usage_linux
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@r10r
r10r / backup_git_repos.sh
Created October 17, 2011 13:22
Github backup script
#!/usr/bin/env ruby
require 'json'
require 'open-uri'
require 'fileutils'
require 'net/smtp'
BACKUP_DIR='/home/git/github-backup'
USERNAME='my_username'
URL_REPOS="https://api.github.com/users/#{USERNAME}/repos"
@zaius
zaius / open_uri.rb
Created October 7, 2011 21:46
Allow open-uri to follow unsafe redirects (i.e. https to http)
# Allow open-uri to follow unsafe redirects (i.e. https to http).
# Relevant issue:
# http://redmine.ruby-lang.org/issues/3719
# Source here:
# https://github.com/ruby/ruby/blob/trunk/lib/open-uri.rb
module OpenURI
class <<self
alias_method :open_uri_original, :open_uri
alias_method :redirectable_cautious?, :redirectable?
@mre
mre / llvm_clang_eclipse.md
Last active February 28, 2020 08:03
LLVM, clang and clang++ under Eclipse

How to setup llvm and clang for eclipse

This guide is many years old is most likely outdated. I'll keep it here for reference; use at your own risk.

Tested on Mac OSX 10.6.7 with LLVM and CLANG version 2.9 Eclipse Helios Service Release 1 (Build 20100917-0705)

1) Installing LLVM and clang

@tokland
tokland / external-command.rb
Created August 18, 2010 18:01 — forked from careo/external-command.rb
Capture stderr data on EventMachine.popen
require 'rubygems'
require 'eventmachine'
$stdout.sync = true
$stderr.sync = true
EM.run {
EM.add_periodic_timer(0.1) {
$stdout.write "stdout\n"