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
x_clone() { | |
SRC_HOST=${${1#*@}%/*} | |
SRC_USER=${${1%@*}%:*} | |
SRC_PASS=${${1%@*}#*:} | |
SRC_DATA=${${1#*/}} | |
DEST_HOST=${${2#*@}%/*} | |
DEST_USER=${${2%@*}%:*} | |
DEST_PASS=${${2%@*}#*:} | |
DEST_DATA=${${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
conn() { | |
( | |
echo "host \t 22 \t 3306 \t 8010" | |
for host in "$@" | |
do | |
echo -en "\n$host \t" | |
nc -w 2 -z $host 22 && echo -n "Y" || echo -n "N" | |
echo -en "\t" | |
nc -w 2 -z $host 3306 2>&1 && echo -n "Y" || echo -n "N" | |
echo -en "\t" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<title>SCOPE API Demo</title> | |
<link rel="stylesheet" media="screen" href="css/style.css" /> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.1.0/backbone-min.js"></script> | |
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.5.1/moment.min.js"></script> | |
<script type="text/javascript" src="js/backbone.poller.min.js"></script> |
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 <Leader>p :CtrlPRoot<CR> | |
let g:ctrlp_root_markers = ['.ctrlp'] | |
let g:ctrlp_working_path_mode = 'ra' |
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
generate_diff() { | |
SCHEMES=(monokai manni rrt perldoc borland colorful default murphy vs trac tango fruity autumn bw emacs vim pastie friendly native) | |
MODULE=${1:="roster"} | |
BRANCH=${2:="HEAD"} | |
SCHEME=${3:=$SCHEMES[$RANDOM%$#SCHEMES+1]} | |
echo "Diffing $MODULE with $BRANCH ($SCHEME)" | lolcat | |
( | |
cd ~$MODULE |
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 node | |
sys = require 'util' | |
path = require 'path' | |
_ = require 'underscore' | |
fs = require 'fs' | |
colors = require 'colors' | |
emoji = require('emoji') | |
spotify = require 'spotify' |
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
vnoremap <silent> <Leader>Y "+y:let @+ = join(map(split(@+, '\n'), 'substitute(v:val, "^\\s\\+\\\|\\s\\+$", "", "g")'), ",")<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
#!/usr/bin/env perl | |
use strict; | |
use File::Find::Rule; | |
use Capture::Tiny qw(capture); | |
sub atomic { | |
my($file, @cmd) = @_; | |
capture { | |
system "atomicparsley", $file, @cmd; | |
}; |
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
return $('td[rel=tooltip]').live({ | |
mouseenter: function() { | |
var lat, lng, _ref, _ref2, | |
_this = this; | |
_ref = [$(this).data('lat'), $(this).data('lng')], lat = _ref[0], lng = _ref[1]; | |
if (!(lat && lng)) return false; | |
if (((_ref2 = $.jStorage.get('cached_geo')) != null ? _ref2["" + lat + "," + lng] : void 0) != null) { | |
return $(this).attr('data-original-title', $.jStorage.get('cached_geo')["" + lat + "," + lng]).tooltip('show'); | |
} | |
return new google.maps.Geocoder().geocode({ |
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
/* | |
* a smart poller for jquery. | |
* (by github) | |
* | |
* simple example: | |
* | |
* $.smartPoller(function(retry) { | |
* $.getJSON(url, function(data) { | |
* if (data) { | |
* doSomething(data) |