Skip to content

Instantly share code, notes, and snippets.

View xonecas's full-sized avatar

Sean Caetano Martin xonecas

  • Employed
  • San Francisco
View GitHub Profile
@xonecas
xonecas / PJAX Q&A
Created November 7, 2013 20:30
PJAX
Global callback for all pjax?
pjax success
Easy way to re-instate JS bindings?
None so far, maybe using the global callback mentioned above.
Leaking old handlers for removed dom?
@xonecas
xonecas / PJAX
Created November 7, 2013 20:28
Welcome document
<p>Global callback for all pjax?</p>
<pre><code>pjax success
</code></pre>
<p>Easy way to re-instate JS bindings?</p>
<pre><code>None so far, maybe using the global callback mentioned above.
</code></pre>
# Start indices on correct side of keyboard
set-option -g base-index 1
# Easier splits
unbind-key '"'
unbind-key %
bind-key | split-window -h
bind-key _ split-window -v
# Resize and navigate splits
@xonecas
xonecas / debug-node.js
Created August 19, 2011 22:39
node.js debug function
var _i = require('util').inspect;
function debug () {
Array.prototype.forEach.call(arguments, function (arg) {
console.log("DEBUG: "+ _i(arg));
});
};
@xonecas
xonecas / githubFollow.html
Created May 5, 2011 19:05
Github follow me icon/badge/button
<!-- Just replace **USERNAME** by your github username :-) -->
<style>
#followGithub {
color: #121516;
text-shadow: 0 1px 1px #ccc;
padding: 0.2em 0.4em;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
border-radius: 5px;
@xonecas
xonecas / wget
Created January 22, 2011 21:17
simple wget for node.js
require('http');
function wget (host, path, https, callback) {
var port = (https)? 443: 80,
client = http.createClient(port, host, https),
request = client.request('get', path, { 'host': host }),
response_body = '';
request.end();
request.on('response', function (response) {