A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
// NOTE: only escapes a " if it's not already escaped | |
function escapeDoubleQuotes(str) { | |
return str.replace(/\\([\s\S])|(")/g,"\\$1$2"); // thanks @slevithan! | |
} | |
escapeDoubleQuotes(`ab`); // ab => ab (nothing escaped) | |
escapeDoubleQuotes(`a"b`); // a"b => a\"b | |
escapeDoubleQuotes(`a\\"b`); // a\"b => a\"b (nothing escaped) | |
escapeDoubleQuotes(`a\\\\"b`); // a\\"b => a\\\"b | |
escapeDoubleQuotes(`a\\\\\\"b`); // a\\\"b => a\\\"b (nothing escaped) |
//PhantomJS http://phantomjs.org/ based web crawler Anton Ivanov anton.al.ivanov@gmail.com 2012 | |
//UPDATE: This gist has been made into a Node.js module and now can be installed with "npm install js-crawler" | |
//the Node.js version does not use Phantom.JS, but the API available to the client is similar to the present gist | |
(function(host) { | |
function Crawler() { | |
this.visitedURLs = {}; | |
}; | |
license: gpl-3.0 | |
redirect: https://beta.observablehq.com/@mbostock/d3-multi-line-chart |
" Search Dash for word under cursor | |
function! SearchDash() | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") | |
let s:url = "dash://".s:wordUnderCursor | |
let s:cmd ="silent ! " . s:browser . " " . s:url | |
execute s:cmd | |
redraw! | |
endfunction | |
map <leader>d :call SearchDash()<CR> |
Either copy the aliases from the .gitconfig
or run the commands in add-pr-alias.sh
Easily checkout local copies of pull requests from remotes:
git pr 4
- creates local branch pr/4
from the github upstream
(if it exists) or origin
remote and checks it outgit pr 4 someremote
- creates local branch pr/4
from someremote
remote and checks it out// Assumptions | |
// Boomerang makes beacon call to port :8080 | |
// StatsD is running on same server (localhost) | |
// The following NodeJS modules are installed: | |
// https://github.com/tobie/ua-parser | |
// https://github.com/bluesmoon/node-geoip | |
// Boomerang is configured to send custom parameters for "domain", "page_type", "user_status", "ip" and "user_agent". | |
// http://lognormal.github.io/boomerang/doc/howtos/howto-5.html |
# usage: ./create_table.rb tsdb 255 | |
include Java | |
import org.apache.hadoop.hbase.HBaseConfiguration | |
import org.apache.hadoop.hbase.HTableDescriptor | |
import org.apache.hadoop.hbase.client.HBaseAdmin | |
import org.apache.hadoop.hbase.HColumnDescriptor | |
conf = HBaseConfiguration.create | |
conf.set("zookeeper.znode.parent", "/hbase-unsecure"); |
### | |
It's incredibly easy to set-up a complex, SEO-friendly routing system using | |
the powerful CoffeeScript regular expressions and destructuring assignment syntax (to parse/name route parameters). | |
For instance, the code snippet below will respond to routes like: | |
/offers/category-automobiles | |
/offers/category-automobiles/make-alfa-romeo | |
/offers/category-automobiles/make-alfa-romeo/model-159 |