Skip to content

Instantly share code, notes, and snippets.

View magiconair's full-sized avatar

Frank Schröder magiconair

View GitHub Profile
package util
import (
"bytes"
"compress/gzip"
"io"
)
func Gunzip(src []byte) (dst []byte, err error) {
if src == nil {
@magiconair
magiconair / gist:1099065
Created July 22, 2011 08:09
Base class definition
define(function() {
// class variable
var id = 0;
// class method
function nextId() {
return ++id;
}
@magiconair
magiconair / node-long-poll-1.js
Created February 1, 2011 15:27
Long polling server skeleton
/**
* Module import
*/
var express = require('express');
/**
* Port the server listens on
*/
var port = 3000;