This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " 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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nnoremap <left> :vertical resize +5<cr> | |
| nnoremap <right> :vertical resize -5<cr> | |
| nnoremap <up> :resize +5<cr> | |
| nnoremap <down> :resize -5<cr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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' |
OlderNewer