A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
See the original gist for more details.
#!/usr/bin/env bash | |
# Hacked out of https://github.com/xdissent/ievms/blob/master/ievms.sh | |
set -o nounset | |
set -o errtrace | |
set -o errexit | |
set -o pipefail | |
curl_opts=${CURL_OPTS:-""} |
A ZSH theme optimized for people who use:
See the original gist for more details.
This one-liner will create a git fix
alias in your ~/.gitconfig file.
When a git merge or rebase fails with conflicts, git fix
will open all the unmerged files in sublimetext.
Change subl -nw
to $EDITOR
or whatever you prefer if you don't use sublimetext.
javascript:void(function(){ | |
var _log = function() { | |
var args = $.makeArray(arguments).join(' '); | |
if(this.console) { | |
console.log(args); | |
} else { | |
alert(args); | |
} | |
}; | |
var _count_selectors = function(sheet) { |
Hopefully you never have to do this, but if e.g. you build a lot of stuff on top of a library like Bootstrap and then concatenate all your CSS for shipping you might find that you hit [IE<10's 4095-selectors-per-sheet limit][ielimit].
To guard against this we added the following to our [Cucumber][cucumber] tests which run in our CI build.
This works with [Poltergeist][poltergeist] which is a [Capybara][capybara] adapter that wraps [PhantomJS][phantomjs].
It's arguably an abuse of Cucumber because we're definitely not testing behaviour here, but it's handy to have non-functional stuff like CSS bloat tracked in a continuous build, especially when the consequences include dropping styles on the floor.
If you're building a Rails app, skip this and use something like [css_splitter][css_splitter] to circumvent the issue.
#!/usr/bin/env bash | |
cat 20* | grep solr/select | perl -MURI::Escape -ne 's/(\d+\.\d+\.\d+\.\d+)[\s\-]+\[([^\]]+)\] "GET \/solr\/select.*(&fq=([^&]*)?).*(&q=([^&]*)?).* 200 /\2\t\6\t\4\t/ && print uri_unescape($_)' - |
// Basic cons list. | |
// Elements are defined as functions so we can have lazy sequences. | |
function cons(x, xs) { | |
return { | |
head: function() { return x; }, | |
tail: typeof xs === 'function' ? xs : function() { return xs; } | |
}; | |
} | |
function isEmpty(xs) { return xs === undefined; } |
diff --git a/repl/repl.py b/repl/repl.py | |
index dfdfaf0..a3a37cb 100644 | |
--- a/repl/repl.py | |
+++ b/repl/repl.py | |
@@ -1,4 +1,5 @@ | |
import re | |
+from os import path | |
from functools import reduce | |
from . import PY3K |
<?php | |
function set() { | |
return new Set(func_get_args()); | |
} | |
class Set implements Countable, Iterator { | |
private $data = array(); | |
function __construct($data) { |
<?php | |
/** | |
* Decorate a function so it can be partially applied. | |
* | |
* If the resulting function is called with fewer than the required | |
* number of arguments a new function is returned with the supplied | |
* arguments applied. | |
* | |
* See examples below. |