Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
On fire

Dave Druska druska

🔥
On fire
View GitHub Profile
View gist:999ee3eff272e46c17ed
### Keybase proof
I hereby claim:
* I am druska on github.
* I am druska (https://keybase.io/druska) on keybase.
* I have a public key whose fingerprint is FDAE 69B4 B0BF B76B 1826 C25D 664E 3FD4 9701 1EBF
To claim this, I am signing this object:
@druska
druska / gosimplehttp.go
Created Oct 4, 2013
A simple HTTP server which serves static files in the working directory. By default serves on port 8080 or takes a port argument. Created as a fast replacement to Python's (python -m SimpleHTTPServer). Example usage: gosimplehttp 8000
View gosimplehttp.go
package main
import (
"flag"
"fmt"
"net/http"
"os"
)
func main() {
@druska
druska / engine.c
Created Sep 17, 2018
Quant Cup 1's winning order book implementation
View engine.c
/*****************************************************************************
* QuantCup 1: Price-Time Matching Engine
*
* Submitted by: voyager
*
* Design Overview:
* In this implementation, the limit order book is represented using
* a flat linear array (pricePoints), indexed by the numeric price value.
* Each entry in this array corresponds to a specific price point and holds
* an instance of struct pricePoint. This data structure maintains a list
@druska
druska / native_js_drag_and_drop_helper.js
Created Aug 26, 2015
Create the `simulateDragDrop` function which can be used to simulate clicking and dragging one DOM Node onto another
View native_js_drag_and_drop_helper.js
function simulateDragDrop(sourceNode, destinationNode) {
var EVENT_TYPES = {
DRAG_END: 'dragend',
DRAG_START: 'dragstart',
DROP: 'drop'
}
function createCustomEvent(type) {
var event = new CustomEvent("CustomEvent")
event.initCustomEvent(type, true, true, null)