Skip to content

Instantly share code, notes, and snippets.

View halilim's full-sized avatar

Halil Özgür halilim

View GitHub Profile
@jboner
jboner / latency.txt
Last active August 28, 2025 01:19
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@paracycle
paracycle / rails_admin.tr.yml
Created June 7, 2012 13:57
Rails Admin Turkish translation
tr:
admin:
home:
name: "Anasayfa"
pagination:
previous: "« Önceki"
next: "Sonraki »"
truncate: "…"
misc:
filter_date_format: "dd/mm/yy" # a combination of 'dd', 'mm' and 'yy' with any delimiter. No other interpolation will be done!
@chetan
chetan / fix_wget_ca.sh
Created June 12, 2012 14:37
How to fix wget certificate issues
wget --no-check-certificate https://raw.github.com/bagder/curl/master/lib/mk-ca-bundle.pl
perl mk-ca-bundle.pl && rm certdata.txt
mkdir -p ~/.ssl/ && mv ca-bundle.crt mk-ca-bundle.pl ~/.ssl
echo "ca_certificate = ~/.ssl/ca-bundle.crt" >> ~/.wgetrc
@jordelver
jordelver / gist:3073101
Created July 8, 2012 22:06
Set the Mac OS X SOCKS proxy on the command line

Set the Mac OS X SOCKS proxy on the command line

a.k.a. what to do when your ISP starts blocking sites :(

Set the SOCKS proxy to local SSH tunnel

networksetup -setsocksfirewallproxy "Ethernet" localhost 8080

To clear the domain and port

@rogal111
rogal111 / paperclip_transliterate.rb
Created July 10, 2012 10:28
Transliterate Paperclip file name to use in URLs
# put this file in config/initializers
#
# USAGE:
# in your paperclip model:
# has_attached_file :document
# before_post_process { |c| transliterate_file_name(:document) }
module TransliteratePaperclip
def transliterate_file_name(paperclip_file)
@1st8
1st8 / gist:3128135
Created July 17, 2012 08:47
God process monitoring + Upstart + rbenv
description "God Process Monitoring"
author "Christoph Geschwind <[email protected]>"
start on runlevel [2345]
stop on runlevel [!2345]
respawn # respawn the service if it dies
respawn limit 5 10 # stop respawning if it fails 5 times in 10 seconds
pre-start script
@andkerosine
andkerosine / raskell.rb
Created August 15, 2012 05:56
Haskell-like list comprehensions in Ruby
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << args.map { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
end
class Array
def +@
@nike-17
nike-17 / gist:4173162
Created November 30, 2012 01:33
LinkedIn Endorse all
//if you need to andorse all in linkedin just go in to your profil and enter in browser console
setInterval(function(){document.getElementsByClassName('endorse-all-btn')[0].click()}, 5000)
//an leave your tab for some time
@ck-on
ck-on / ocp.php
Last active July 24, 2025 05:10
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)#ocp #php #opcache #opcode #cache #zend #optimizerplus #optimizer+
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2015-09-01 regex fix for PHP7 phpinfo
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
@ngocphamm
ngocphamm / Homebrew Zsh on Mac
Last active May 20, 2025 13:42
Notes on using Homebrew Zsh as default login shell
1. Install Zsh with Homebrew
brew install zsh
2. Add "/usr/local/bin/zsh" to "/etc/shells" file
sudo vim /etc/shells
3. Change to default login shell
chsh -s /usr/local/bin/zsh $USER
4. Make sure new version of Zsh is in active