Skip to content

Instantly share code, notes, and snippets.

View indexzero's full-sized avatar
🌎
Always bet on Open Source

Charlie Robbins indexzero

🌎
Always bet on Open Source
View GitHub Profile
@endolith
endolith / Has weird right-to-left characters.txt
Last active July 17, 2024 12:41
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@isaacs
isaacs / comma-first-var.js
Created April 6, 2010 19:24
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@cowboy
cowboy / jquery-pluginization.js
Created July 12, 2010 17:36
jQuery Pluginization (see comment for slide order)
(function($){
// Store fetched long URLs here.
var cache = {};
$.longUrl = function( url, callback, options ) {
// Override defaults with specified options.
options = $.extend( {}, $.longUrl.options, options );
var params = {};
/** Testing sax push parsing
*
* The output file should have almost identical
* to the input file
*
* Known issues with this example output
*
* - Doesn't escape entities. You can do it
* manually on the character content.
* - Doesn't replicate self-closing tags.
#!/usr/bin/env ruby
# Aside from removing Ruby on Rails specific code this is taken verbatim from
# mislav's git-deploy (http://github.com/mislav/git-deploy) and it's awesome
# - Ryan Florence (http://ryanflorence.com)
#
# Install this hook to a remote repository with a working tree, when you push
# to it, this hook will reset the head so the files are updated
if ENV['GIT_DIR'] == '.'
#!/bin/bash
set -e
if test -z "$2" -o -n "$3"; then
echo "usage: $0 REPO BRANCHNAME" >&2
exit 1
fi
repo=$1
var b = new Buffer(256*256)
for (var i = 0 ; i < 256*256 ; i ++) {
b[i] = i % 256
}
var s = b.toString("binary")
var b2 = new Buffer(s, "binary")
for (var i = 0 ; i < 256*256 ; i ++) {
if (b2[i] !== i) console.error("error at 0x"+i.toString(16))
}
// Main controller for the journalist workspace. Orchestrates subviews.
dc.controllers.Workspace = Backbone.Controller.extend({
routes : {
'help/:page': 'help',
'help': 'help'
},
// Initializes the workspace, binding it to <body>.
initialize : function() {
@bdotdub
bdotdub / redis.markdown
Created November 24, 2010 22:18
Running redis using upstart on Ubuntu

Running redis using upstart on Ubuntu

I've been trying to understand how to setup systems from the ground up on Ubuntu. I just installed redis onto the box and here's how I did it and some things to look out for.

To install:

module.exports = chain
// steps, cb
// Each step is either:
// [fn, arg, arg, arg] or
// [obj, "method", arg, arg, arg]
// The eventual cb passed to chain is resolved with an array of
// all the results, and/or an error if one was returned.
function chain () /* step, step, ..., cb */ {