Skip to content

Instantly share code, notes, and snippets.

View a-b's full-sized avatar
🎯
Focusing

Al Berez a-b

🎯
Focusing
  • Broadcom
  • 05:13 (UTC -07:00)
View GitHub Profile
@a-b
a-b / docker.json
Created November 17, 2015 19:50 — forked from hitsujiwool/docker.json
docker + docker-compose on Amazon Linux
{
"variables": {
"aws_access_key": "{{env `AWS_ACCESS_KEY`}}",
"aws_secret_key": "{{env `AWS_SECRET_KEY`}}"
},
"builders": [
{
"type": "amazon-ebs",
"ssh_pty": true,
"access_key": "{{user `aws_access_key`}}",
@a-b
a-b / latency.txt
Created November 6, 2015 18:43 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD* 150,000 ns 0.15 ms
SELECT
trim(line_number) AS line_number,
trim(colname) AS colname,
trim(type) AS type,
trim(col_length) AS col_length,
trim(position) AS position,
trim(raw_field_value) AS raw_field_value,
trim(err_code) AS err_code,
trim(err_reason) AS err_reason
FROM stl_load_errors sl, stv_tbl_perm sp
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@a-b
a-b / .vimrc
Last active August 29, 2015 14:07
"Pig syntax
augroup filetypedetect
au BufNewFile,BufRead *.pig set filetype=pig syntax=pig
"Hive syntax
au BufNewFile,BufRead *.hql set filetype=sql syntax=sql
au BufNewFile,BufRead *.gradle set filetype=groovy syntax=groovy
augroup END
au BufRead,BufNewFile *.json set filetype=json foldmethod=syntax
nnoremap <left> :vertical resize +5<cr>
nnoremap <right> :vertical resize -5<cr>
nnoremap <up> :resize +5<cr>
nnoremap <down> :resize -5<cr>
@a-b
a-b / .nvimrc
Created August 3, 2014 02:49
my NeoVim rc file
" vim:fdm=marker
"NeoBundle begin" {{{
if has('vim_starting')
set nocompatible
set runtimepath+=~/.nvim/bundle/neobundle.vim/
endif
call neobundle#begin(expand('~/.nvim/bundle/'))
NeoBundleFetch 'Shougo/neobundle.vim'
RSpec.configure do |config|
config.filter_run_excluding :show_me_the_pages unless ENV["SHOW_ME_THE_PAGES"]
end
class Screenshots
include Capybara::DSL
attr_accessor :resolutions
attr_accessor :output_path
@a-b
a-b / .zshrc
Created December 3, 2013 05:14 — forked from SlexAxton/.zshrc
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else
# coding=UTF-8
from __future__ import division
import nltk
from collections import Counter
# This is a simple tool for adding automatic hashtags into an article title
# Created by Shlomi Babluki
# Sep, 2013