Skip to content

Instantly share code, notes, and snippets.

View firebug-lite-debug.js
This file has been truncated, but you can view the full file.
* Firebug Lite 1.4.0a1
* Copyright (c) 2007, Parakey Inc.
* Released under BSD license.
* More information:
View mpv-build-err.log
../osdep/win32-console-wrapper.c:22:6: warning: no previous prototype for 'cr_perror' [-Wmissing-prototypes]
void cr_perror(const wchar_t *prefix)
../osdep/win32-console-wrapper.c:37:5: warning: no previous prototype for 'cr_runproc' [-Wmissing-prototypes]
int cr_runproc(wchar_t *name, wchar_t *cmdline)
../osdep/win32-console-wrapper.c:73:5: warning: no previous prototype for 'wmain' [-Wmissing-prototypes]
int wmain(int argc, wchar_t **argv, wchar_t **envp)
chowey /
Last active Sep 6, 2018
Bidirectional stream copy

This implementation of bidirectional stream copy has the right behavior for closing streams. The first stream to return io.EOF as a reader triggers a close on the second stream, and then the bidirectional copy may be considered done. The close on the second stream should trigger an error (e.g. io.EOF) on the read of the first stream, closing that stream too.

chowey / multilock.go
Last active Jun 14, 2018
Pattern for allowing controlled concurrency.
View multilock.go
package multilock
import (
// Resource represents a pool that, when drained, locks until a corresponding
// unlock is called.
type Resource struct {
c chan struct{}
chowey / channelreader.go
Created Jun 8, 2017
Like io.MultiReader, but using a channel (unknown number of input readers)
View channelreader.go
package main
import "io"
type channelReader struct {
c chan []byte
b []byte
func NewChannelReader(c chan []byte) io.Reader {
View exitgroup.go
package main
import "sync"
type ExitGroup struct {
wg sync.WaitGroup
cl []func()
lk sync.Mutex
chowey /
Last active Sep 30, 2015
Movie Countdown with Greensock

Simple countdown using Greensock. You could add an "onComplete" to the Tweenlite to trigger an event when the countdown ends.

chowey / minisrv.go
Created Aug 9, 2015
Simplest Web Server
View minisrv.go
package main
import (
func main() {
addr := ":8081"
if len(os.Args) > 1 {
chowey / fs_stub.go
Created May 15, 2015
In-Memory implementation for http.FileSystem
View fs_stub.go
// http.FileSystem in-memory test stub
type TestOpener interface {
OpenAs(name string) http.File
type TestFileSystem TestDir
func (fs TestFileSystem) Open(name string) (http.File, error) {
chowey / dllmain.cpp
Created Nov 27, 2014
Volume monitoring and control DLL
View dllmain.cpp
// dllmain.cpp : Defines the entry point for the DLL application.
#include "volumemonitor.h"
// We use a worker thread for all COM calls, since CoInitialize is not
// otherwise safe to execute in a DLL.
HANDLE worker_thread_;
// There is one global VolumeMonitor that is lazy-loaded. This helps us
// report errors on initialization, and will also re-attempt initialization
// at the next call.