Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
// everyone's new favorite closure pattern: | |
(function(window,document,undefined){ ... })(this,this.document); | |
// when minified: | |
(function(w,d,u){ ... })(this,this.document); | |
// which means all uses of window/document/undefined inside the closure | |
// will be single-lettered, so big gains in minification. | |
// it also will speed up scope chain traversal a tiny tiny little bit. |
/* | |
* Fabrizio Calderan, twitter @fcalderan, 2010.11.02 | |
* I had an idea: could Inception movie be explained by a few javascript closures | |
* and variable resolution scope (just for fun)? | |
* | |
* Activate javascript console =) | |
*/ | |
<script> | |
console.group("inception movie"); |
<?php | |
/* | |
Plugin Name: Kill Trackbacks | |
Plugin URI: http://pmg.co/category/wordpress | |
Description: Kill all trackbacks on WordPress | |
Version: 1.0 | |
Author: Christopher Davis | |
Author URI: http://pmg.co/people/chris | |
*/ |
//BSD Licensed | |
var YourGlobal = { | |
namespace: function(ns){ | |
var parts = ns.split("."), | |
object = this, | |
i, len; | |
for (i=0, len=parts.length; i < len; i++) { | |
if (!object[parts[i]]) { |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Copy, with line wrapping!
If you've been trying to copy/paste text from a multi-pane tmux
session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.
The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.
Disclaimer
Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux
, the same still applies but obviously the default key bindings will differ alot from what I show below.
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | |
<%-- setup --%> | |
<% pageContext.setAttribute("carriageReturn", "\r"); %> | |
<% pageContext.setAttribute("newLine", "\n"); %> | |
<c:set var="singleQuotes">'</c:set> | |
<c:set var="singleQuotesReplace">\'</c:set> | |
<c:set var="doubleQuotes">"</c:set> | |
<c:set var="doubleQuotesReplace">\"</c:set> |
// http://www.w3.org/TR/dom/ | |
// http://updates.html5rocks.com/2012/02/Detect-DOM-changes-with-Mutation-Observers | |
// https://developer.mozilla.org/en-US/docs/DOM/MutationObserver | |
var MutationObserver = (function () { | |
var prefixes = ['WebKit', 'Moz', 'O', 'Ms', ''] | |
for(var i=0; i < prefixes.length; i++) { | |
if(prefixes[i] + 'MutationObserver' in window) { | |
return window[prefixes[i] + 'MutationObserver']; | |
} | |
} |
#!/usr/bin/env python | |
import sys, os | |
info = sys.stdin.read().strip().split(" ") | |
range = "" | |
if info: | |
range = "{}..{}".format(info[3], info[1]) | |
sys.stdin = open('/dev/tty') |