Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
require 'digest/md5' | |
def gfm(text) | |
# Extract pre blocks | |
extractions = {} | |
text.gsub!(%r{<pre>.*?</pre>}m) do |match| | |
md5 = Digest::MD5.hexdigest(match) | |
extractions[md5] = match | |
"{gfm-extraction-#{md5}}" | |
end |
mid_range <- function(x) mean(range(x, na.rm = TRUE)) | |
centres <- ddply(county_df, c("state", "county"), summarise, | |
lat = mid_range(lat), | |
long = mid_range(long) | |
) | |
bubbles <- merge(centres, unemp, by = c("state", "county")) | |
ggplot(bubbles, aes(long, lat)) + | |
geom_polygon(aes(group = group), data = state_df, | |
colour = "white", fill = NA) + |
plot.heat <- function(tmp,state.map,z,title=NULL,breaks=NULL,cex.legend=1,bw=.2,col.vec=NULL,main=NULL,plot.legend=TRUE, ...) { | |
tmp@data$zCat <- cut(tmp@data[,z],breaks,include.lowest=TRUE) | |
cutpoints <- levels(tmp@data$zCat) | |
if (is.null(col.vec)) col.vec <- heat.colors(length(levels(tmp@data$zCat))) | |
cutpointsColors <- col.vec | |
levels(tmp@data$zCat) <- cutpointsColors | |
cols <- as.character(tmp$zCat) | |
##cols <- "white" | |
plot(tmp,border=cols, lwd=bw,axes = FALSE, las = 1,col=as.character(tmp@data$zCat),main="A", ...) | |
if (!is.null(state.map)) { |
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |
Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down
One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.
Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o
// $('img.photo',this).imagesLoaded(myFunction) | |
// execute a callback when all images have loaded. | |
// needed because .load() doesn't work on cached images | |
// Modified with a two-pass approach to changing image | |
// src. First, the proxy imagedata is set, which leads | |
// to the first callback being triggered, which resets | |
// imagedata to the original src, which fires the final, | |
// user defined callback. |
1password - Password mangager | |
3hub - Amazon s3 file manager | |
Adium - Instant messenger | |
Arq - Amazon s3 backup | |
Air Server - Send your iPhone/iPad screen to your mac screen for demos | |
Alfred - Launch bar app (must have) | |
Base - Sqlite db viewer | |
Caffeine - Keeps computer awake | |
Charles - Web debugging proxy | |
Cornerstone - SVN client |
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html