Skip to content

Instantly share code, notes, and snippets.

Christos Zisopoulos christos

View GitHub Profile
View method_profiler.rb
require 'benchmark/ips'
require 'redis'
class MethodProfiler
def self.patch(klass, methods, name)
patches = do |method_name|
unless defined?(#{method_name}__mp_unpatched)
alias_method :#{method_name}__mp_unpatched, :#{method_name}
def #{method_name}(*args, &blk)
unless prof = Thread.current[:_method_profiler]
View database.yml
default: &default
adapter: mysql2
encoding: utf8mb4
username: root
host: localhost
View GistList!.md

##alt text GistList: TODO for coders alt text

christos /
Created Nov 27, 2015 — forked from wvengen/
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

christos /
Created Nov 13, 2015 — forked from brandonb927/
OSX for Hackers: Yosemite Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned. Also, please don't email me about this script, my poor inbox...
# Alot of these configs have been taken from the various places
# on the web, most from here
# Set the colours you can use
christos / irpf.rb
Last active Aug 29, 2015 — forked from fxn/irpf.rb
View irpf.rb
# Usage:
# ruby irpf.rb tax_base
# Example:
# ruby irpf.rb 65300
# 65300 €, 22722 €, 34.8%
# Where 22,722 € is the IRPF to pay, and 34.8% is the real rate, that is,
View haproxy.initd
# Provides: haproxy
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: fast and reliable load balancing reverse proxy
# Description: This file should be used to start and stop haproxy.
christos / gist:9616652
Last active Jun 20, 2018 — forked from samwgoldman/gist:9610193
Presigned S3 urls
View gist:9616652
access_key_id = ENV.fetch("APP_S3_ACCESS_KEY_ID")
secret_access_key = ENV.fetch("APP_S3_SECRET_ACCESS_KEY")
bucket_name = ENV.fetch("APP_S3_BUCKET")
s3 = access_key_id, secret_access_key: secret_access_key)
bucket = s3.buckets[bucket_name]
object = bucket.objects["whatever/you/want"]
presign =
presign.presign(:put, expires: 15.minutes.from_now.to_i)
# => #<URI::HTTP:0x007fcfcd97e1a0 URL:***stuff***>
View 2.1.0-railsexpress
build_package_reconfigure() {
test -f configure || autoconf
build_package_patch_ruby_railsexpress() {
fetch_git rvm-patchsets git:// master
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/01-current-2.1.1-fixes.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/02-zero-broken-tests.patch
patch -p1 < rvm-patchsets/patches/ruby/2.1.0/railsexpress/03-improve-gc-stats.patch
View distribution.rake
def build_path
def ipa_name
'"Today\'s Shirts.ipa"'
def dsym_name
'"Today\'s Shirts.dSYM"'
You can’t perform that action at this time.