Skip to content

Instantly share code, notes, and snippets.

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

Al Berez a-b

🎯
Focusing
  • Broadcom
  • 05:47 (UTC -07:00)
View GitHub Profile
signs_set = ('+' + '-' * 2 + ' ' * 5).split ''
signs_set.permutation(signs_set.length).to_a.uniq.each_with_index do |r,i|
str = (1..9).to_a.zip(r).flatten.join.gsub(' ','').to_s
eq_100 = eval(str).eql?(100)
puts [(i+1).to_s.rjust(3), '', str, '=', eval(str), eq_100 ? ' <---- !':'' ].join("\t")
end
#!/usr/bin/env ruby
# encoding: utf-8
FNAME = 'ff'
@lag_data = {}
File.open(FNAME).each do |line|
line.gsub!("\n",'')
time_area = line.split[2]
t1,t2,t3,t4,t5 = time_area.split("/").map(&:to_i)
[alias]
graphviz = "!f() { echo 'digraph git {' ; git log --pretty='format: %h -> { %p }' \"$@\" | sed 's/[0-9a-f][0-9a-f]*/\"&\"/g' ; echo '}'; }; f"
wc = whatchanged -p
f = fetch -v --all
s = status -sb
b = branch
ba = branch -a -v -v
bs = !git-branch-status
bsi = !git-branch-status -i
ci = commit
# 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
@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
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 / .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'
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 / .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
#!/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'