Skip to content

Instantly share code, notes, and snippets.

View naneau's full-sized avatar

Maurice Fonk naneau

View GitHub Profile

Keybase proof

I hereby claim:

  • I am naneau on github.
  • I am naneau (https://keybase.io/naneau) on keybase.
  • I have a public key whose fingerprint is ACAA 8558 1896 A3BA C6BB 3F35 0229 0F8E C26B 7995

To claim this, I am signing this object:

@naneau
naneau / pygments.less
Last active December 27, 2015 19:09
Pygments highlighting in a properly formatted LESS file
// Pygments highlighting
.highlight {
font-size: .9em;
// Comment
.c {
color: #586E75;
}
@naneau
naneau / naive sort.coffee
Created July 18, 2013 18:32
Naive item sort in CoffeeScript/BackBone When the rendered element is stored in `item[@elementKey]`
# Naive Sort
@model.bind 'sort', () => @$el.append item for item in (item[@elementKey].detach() for item in @model.toArray())
@naneau
naneau / gist:4511085
Created January 11, 2013 14:34
linked in error message.
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction: DELETE FROM {semaphore} WHERE (name = :db_condition_placeholder_0) AND (value = :db_condition_placeholder_1) AND (expire <= :db_condition_placeholder_2) ; Array ( [:db_condition_placeholder_0] => variable_init [:db_condition_placeholder_1] => 23147238050f0228a691f76.38886810 [:db_condition_placeholder_2] => 1357914772.4661 ) in lock_may_be_available() (line 181 of /export/content/data/dlc/shared/www/developer/includes/lock.inc).
@naneau
naneau / font.coffee
Created May 7, 2011 15:56
Load google web fonts, in CoffeeScript! :)
# Export Google WebFont Config
window.WebFontConfig =
# Load some fonts from google
google:
families: ['Inconsolata', 'Pacifico', 'Droid Sans', 'Droid Serif']
# ... you can do something here if you'd like
active: () ->
# Create script tag matching protocol
document.observe ->
# initially hide all containers for tab content
($ 'div.tabcontent').invoke 'hide'
, "dom:loaded"
@naneau
naneau / gocoffeescript.js
Created April 4, 2011 18:08
Yeah, I don't think I could've written this without coffeescript...
(function() {
var a,
b,
c = Object.prototype.hasOwnProperty,
d = function(a, b) {
function e() {
this.constructor = a
}
for (var d in b) c.call(b, d) && (a[d] = b[d]);
e.prototype = b.prototype,
var host, http, ping, port, util;
http = require('http');
util = require('util');
host = '127.0.0.1';
port = 10000;
ping = function() {
var request;
console.log("making request");
request = http.request({
host: host,
var host, http, port, server;
http = require('http');
host = '127.0.0.1';
port = 10000;
server = http.createServer(function(request, response) {
var body;
request.setEncoding('utf8');
body = '';
request.on('data', function(chunk) {
return body += chunk;
http = require 'http'
util = require 'util'
host = '127.0.0.1'
port = 10000
# Ping
ping = () ->
console.log "making request"