Skip to content

Instantly share code, notes, and snippets.

View beatgammit's full-sized avatar

Jameson Little beatgammit

View GitHub Profile
@beatgammit
beatgammit / appender.go
Created May 3, 2012 07:29
UTOS- Introduction to Go
package main
import "fmt"
type Appender struct {
data []byte
}
func (a *Appender) Write(p []byte) (int, error) {
newArr := append(a.data, p...)
@beatgammit
beatgammit / gist:1871760
Created February 20, 2012 21:57
Vows breaks on nested topics
(function () {
'use strict';
var vows = require('vows'),
assert = require('assert');
vows.describe('some test').addBatch({
'test level 1': {
topic: function () {
this.callback(null, 1);
@beatgammit
beatgammit / index.js
Created September 12, 2011 16:43
NPM bug when using outdated function as systemd service
#!/usr/bin/env node
(function () {
'use strict';
var npm = require('npm'),
fs = require('fs'),
updateTimeout,
seconds = 10;
function update(fd) {
@beatgammit
beatgammit / gist:1205053
Created September 8, 2011 23:14
Reqwest timeout bug
function bug() {
window.reqwest({
'url': 'http://thisdoesntexisthahahaha.com',
'timeout': 1000 * 5,
'type': 'html',
'success': function () {
alert('http://thisdoesntexisthahahaha.com exists??');
},
'error': function () {
console.error('Error, trying again');
@beatgammit
beatgammit / upload.js
Created June 7, 2011 19:58
Webkit: XHR push files
function upload(url, uint8Data) {
var xhr,
formData = new FormData(),
blobBuilder = new WebKitBlobBuilder(),
blob;
blobBuilder.append(uint8Data);
blob = blobBuilder.getBlob();
@beatgammit
beatgammit / channelIssue.go
Created April 20, 2011 23:25
Issue using channels with os.File.Read in Go
package main
import (
"web"
"os"
"fmt"
"container/vector"
"time"
)