Skip to content

Instantly share code, notes, and snippets.

// If you don't use underscore.js, use it (http://documentcloud.github.com/underscore/)
// Then, use underscore's mixin method to extend it with all your other utility methods
// like so:
_.mixin({
escapeHtml: function () {
return this.replace(/&/g,'&')
.replace(/>/g,'>')
.replace(/</g,'&lt;')
.replace(/"/g,'&quot;')
.replace(/'/g,'&#39;');
@cmarkle27
cmarkle27 / .tmux.clipboard
Created October 19, 2012 15:48 — forked from napcs/.tmux.clipboard
My tmux config
# configuration for osx clipboard support
set-option -g default-command "reattach-to-user-namespace -l sh"
@cmarkle27
cmarkle27 / .tmux.conf
Created October 22, 2012 12:48 — forked from wridgers/.tmux.conf
tmux config file
# Make it use C-a, similar to screen..
unbind C-b
unbind l
set -g prefix C-a
bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
set -g history-limit 1000
@cmarkle27
cmarkle27 / modernizr-tests.js
Created November 16, 2012 12:39 — forked from danott/modernizr-tests.js
Custom Modernizr tests that are useful.
/* modernizr-test.js
* Daniel Ott
* 3 March 2011
* Custom Tests using Modernizr's addTest API
*/
/* iOS
* There may be times when we need a quick way to reference whether iOS is in play or not.
* While a primative means, will be helpful for that.
*/
@cmarkle27
cmarkle27 / Modernizr conditional loading
Created November 16, 2012 12:40 — forked from nternetinspired/Modernizr conditional loading
Conditional resource loading, using Modernizr's yepnope tests, based on viewport size. Placed immediately before the closing head tag in index.php this can be used to load specific resources against reported viewport sizes
<!-- Something like this -->
<script>
Modernizr.load({
test: Modernizr.mq('(min-width:400px)'),
yep: '<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/not-small-screen-stuff.js">',
});
</script>
<!-- Or -->
<script>