Skip to content

Instantly share code, notes, and snippets.

View druska's full-sized avatar
🎯
Focusing

Dave Druska druska

🎯
Focusing
View GitHub Profile
@druska
druska / gosimplehttp.go
Created October 4, 2013 00:17
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
package main
import (
"flag"
"fmt"
"net/http"
"os"
)
func main() {
### 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 / native_js_drag_and_drop_helper.js
Created August 26, 2015 03:56
Create the `simulateDragDrop` function which can be used to simulate clicking and dragging one DOM Node onto another
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)
0x6aaB6A407235A30Bc30Bbd84D12E42a9599EaC4d
0x652e8c0270b3f02e54734d8eed6db58376758506
@druska
druska / engine.c
Created September 17, 2018 15:18
Quant Cup 1's winning order book implementation
/*****************************************************************************
* 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