This file contains 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
# becoming root within vim | |
cmap w!! %!sudo tee > /dev/null % |
This file contains 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
## From the server | |
# Untar at destination | |
tar -czf - /some/file | ssh host.name tar -xzf - -C /destination | |
# Save as tarball | |
tar -czpv /path/to/stuff/that/we/backup | ssh [email protected] "dd of=/path/to/where/my/backup/goes/on/the/server/backup.tar.gz" | |
## From Remote | |
ssh [email protected] "tar cvpz /path/to/backup" > ./remoteclient-backup.tar.gz |
This file contains 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
# get headers | |
curl -D - -o /dev/null http://example.net/ | |
This file contains 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 make_bitly_url($url, $login, $appkey, $format='xml', $history=1, $version='2.0.1') | |
{ | |
//create the URL | |
$bitly = 'http://api.bit.ly/shorten'; | |
$param = 'version='.$version.'&longUrl='.urlencode($url).'&login=' | |
.$login.'&apiKey='.$appkey.'&format='.$format.'&history='.$history; | |
//get the url | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $bitly . "?" . $param); |
This file contains 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
## some dummy data | |
x <- seq(as.Date("2008-01-01"), as.Date("2009-10-31"), by = "day") | |
set.seed(1234) | |
y <- cumsum(rnorm(length(x))) | |
## plot, but suppress axes | |
plot(y ~ x, type = "l", axes = FALSE) | |
## add in axis on side 2 | |
axis(2) |
This file contains 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
require 'rubygems' | |
require 'twitter' | |
auth = Twitter::HTTPAuth.new('username', 'password') | |
base = Twitter::Base.new(auth) | |
guilty = base.friend_ids - base.follower_ids | |
puts "There are #{guilty.size} People you follow who do not follow you" | |
guilty.each do |user_id| |
This file contains 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
/* | |
* Twita@talinkahashifyer | |
* http://www.dustindiaz.com | |
* http://www.dustindiaz.com/basement/ify.html | |
* | |
* Copyright (c) 2009 Dustin Diaz | |
* licensed under public BSD | |
*/ | |
var ify = function() { | |
return { |
This file contains 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
# SUPER DARING APP TEMPLATE 1.0 | |
# By Peter Cooper | |
# Link to local copy of edge rails | |
inside('vendor') { run 'ln -s ~/dev/rails/rails rails' } | |
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" |
This file contains 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
# Delete unnecessary files | |
run "rm README" | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm public/robots.txt" | |
run "rm -f public/javascripts/*" | |
gitignoreItems = %w( | |
.DS_Store | |
log/*.log |
This file contains 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
export TERM=xterm-color | |
export LSCOLORS=dxfxcxdxbxegedabagacad | |
alias ls='ls -G' | |
alias ll='ls -l' | |
alias l='ls -la' | |
alias la='ls -a' | |
alias gs='git status' | |
# tweak bash tab completion |
NewerOlder