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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
function! SuperTab() | |
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$') | |
return "\<Tab>" | |
else | |
return "\<C-n>" | |
endif | |
endfunction | |
function! SuperShiftTab() | |
if (strpart(getline('.'),col('.')-2,1)=~'^\W\?$') | |
return "\<S-Tab>" |
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/bash | |
# rly dum markov | |
# db file | |
db=~/.smirnoff.db | |
# min length of chain to learn | |
min=3 | |
function help { | |
echo "$(basename $0) [ -init | -cram | -help ]" |
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/perl | |
use POSIX; | |
use IO::Socket; | |
use utf8; | |
use Encode; | |
#fork && exit; | |
setsid; |
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
# ssh/scp through NAT, as long as $outer has nc | |
# ssh v5.4+ should allow ssh -oProxyCommand="ssh -W $inner:%p" $outer $* | |
# hosts could also be defined in .ssh/config: | |
# Host foo | |
# hostname inner | |
# ProxyCommand ssh outer nc -w 1 %h %p | |
sshh() { | |
[ "$1" = "-h" ] && { | |
echo "sshh [opts] outer inner [cmd]" | |
return |
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
Hitchhiker's Guide To The Galaxy 1-5 | |
summarized with Open Text Summarizer at ratio of 1% | |
http://libots.sourceforge.net/ | |
------------------------------------------------------------------------------- | |
I | |
Mr Prosser's mouth opened and closed a couple of times while his mind was for a |
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/perl | |
use POSIX; | |
use IO::Socket; | |
#fork && exit; | |
setsid; | |
$nick = "CAPSLOCKENFORCEMENTBOT"; |
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
z is the new j | |
First, there was [j](http://github.com/rupa/j/). | |
Then, there was [j2](http://github.com/rupa/j2/), with some python added. Made | |
it easier to experiment with some stuff I'd been thinking about. | |
Now there's this, where I rewrote j2 back in bash. I like it. Sorry about all | |
the repos , but it kind of grew this way. |
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
# change part of pwd path, and cd to it | |
# example: | |
# /usr/lib/foo$ cx lib src | |
# /usr/src/foo$ | |
# slashes need double escaping: \\/ | |
# surprisingly, most everything else doesn't | |
cx() { | |
local cd="$PWD" | |
while [ $1 ]; do | |
cd="$(echo $cd | sed "s/$1/$2/")" |
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
function rat { | |
# change part of pwd path, and cd to it | |
# example: | |
# /usr/lib/foo$ rat li src | |
# /usr/src/foo$ | |
local cd=$(echo $PWD | awk -v q="$*" -F\/ ' | |
BEGIN { l = split(q,a," ") } | |
{ | |
for( i=1;i<=NF;i++ ) { | |
for( j=1;j<=l;j=j+2 ) { |