Skip to content

Instantly share code, notes, and snippets.

# from http://fredkschott.com/post/2014/02/git-log-is-so-2005/
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit"
@uri
uri / uri-hack-1.rb
Created June 11, 2014 17:27
Uri's Mini hack challenge: 1
# Take an array [221,222,223,224] and turn it into {221 => 1, 222 => 1, 223 => 1, 224 => 1}
start = [221,222,223,224]
# My almost illegible implementation
result = Hash[*start.map(&:id).zip([1] * start.count)]
@uri
uri / rben cron
Created June 26, 2013 15:56
Run a crontab with rbenv
*/1 * * * * PATH=$PATH:/usr/local/bin && bash -lc "ruby ~/bin/gitapi"
*/1 * * * * PATH=$PATH:/usr/local/bin && bash -lc "ruby /Users/ugorelik/bin/test"
@uri
uri / enable_LTE_n4.sh
Last active December 18, 2015 13:59
Android LTE feather script
#!/system/bin/sh
iptables -A bw_FORWARD -i !lo+
iptables -A natctrl_FORWARD -j RETURN -i rmnet+ -o wlan0 -m state --state RELATED,ESTABLISHED
iptables -A natctrl_FORWARD -j DROP -i wlan0 -o rmnet+ -m state --state INVALID
iptables -A natctrl_FORWARD -j RETURN -i wlan0 -o rmnet+
iptables -A natctrl_FORWARD -j DROP
iptables -A natctrl_nat_POSTROUTING -t nat -o rmnet+ -j MASQUERADE
str=gets
unless str.nil? && str != ""
puts str
else
puts "gets produced nil or didn't ask for input."
end
a
about
above
across
act
active
activity
add
afraid
after
@uri
uri / bitbucket-import.rb
Created June 25, 2012 23:02
Import public repos from Bitbucket to Github
require 'httparty'
class Github
include HTTParty
base_uri "https://api.github.com"
BaseDirectory = "/Users/ugorelik/programming/repos"
def initialize(u, p)
@auth = { username: u, password: p}
load_bitbucket_repos