Skip to content

Instantly share code, notes, and snippets.

View adragomir's full-sized avatar

Andrei Dragomir adragomir

View GitHub Profile
@adragomir
adragomir / latency.markdown
Created August 3, 2012 10:34 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@adragomir
adragomir / rails-backbone-test-setup.md
Created August 3, 2012 10:46 — forked from smakman/rails-backbone-test-setup.md
Setting up a Rails backbone project with Jasmine, RSpec, Capybara, Guard and Spork

Rails backbone test setup

This gist describes how to setup a rails backbone project with testing frameworks.

Gemfile

Example Gemfile to start with.

@adragomir
adragomir / _vimrc.vim
Created August 9, 2012 09:01
Taverius' _vimrc
" _vimrc @ (c) Leonardo Valeri Manera, 2010, 2011
" Contains code from Ciaran McCreesh's .vimrc
" Contains code from amix the lucky stiff's .vimrc
" Contains code from Dominique Pelle's .vimrc
" Contains code from Henning Hasemann's .vimrc
" Contains code from Matthew Woznisky's .vimrc
cd $HOME
let g:skip_loading_mswin = 1
@adragomir
adragomir / get-your-vim-on.md
Created August 31, 2012 12:36 — forked from codelahoma/get-your-vim-on.md
Get Your Vim On
@adragomir
adragomir / get-your-vim-on.md
Created August 31, 2012 12:36 — forked from codelahoma/get-your-vim-on.md
Get Your Vim On
@adragomir
adragomir / cowstat.rb
Created November 29, 2012 21:41 — forked from johnl/cowstat.rb
Display info about ram shared between Linux processes
#!/usr/bin/env ruby
require 'ostruct'
class LinuxProcess < OpenStruct
def initialize(args)
super
read_status!
end
/**
* To compile:
* scalac -optimize ByteBufferPerf.scala
*
* JAVA_OPTS="-Xmx2g" scala IntArrayPerf 10
* 49 62 48 45 48 45 48 50 47 45
*
* JAVA_OPTS="-Xmx2g" scala ByteBufferPerf 10
* 479 491 484 480 484 481 477 477 472 473
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
/**
* This file is licensed to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.