Skip to content

Instantly share code, notes, and snippets.

@durango
durango / Price-Time Matching Engine.c
Created December 15, 2018 04:50 — forked from Jud/Price-Time Matching Engine.c
Price-Time Matching Engine
/*****************************************************************************
* 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
@durango
durango / zigzag-encoding.README
Created December 12, 2018 22:36 — forked from mfuerstenau/zigzag-encoding.README
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@durango
durango / Math-UTF8.md
Created December 1, 2018 16:04 — forked from stanislaw/Math-UTF8.md
Common Math Symbols in Unicode, my cheatsheet for writing notes.
@durango
durango / fully-typed-context.ts
Created December 1, 2018 15:55 — forked from icanhasjonas/fully-typed-context.ts
Fully Type Checked and Filtered configuration context for components
type PropertyNames<T> = keyof T
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>
type Filtered<T, C> = { [K in keyof T]: T[K] extends C ? K : never }[keyof T]
class ConfigurationPageContext<T> {
addTextSetting<K extends PropertyNames<T>>(
field: Extract<K, Filtered<T, string>>,
title: string,
defaultValue: string = null
): ConfigurationPageContext<Omit<T, K>> {
@durango
durango / .eslintrc
Created September 7, 2018 13:35 — forked from alefteris/.eslintrc
ESLint default config in YAML format
---
parser: espree
env:
amd: false
browser: false
es6: false
jasmine: false
jquery: false
meteor: false
mocha: false
@durango
durango / disable.sh
Created May 10, 2018 02:55
Disable bunch of #$!@ in Sierra (Version 2.1)
#!/bin/bash
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
# Agents to disable
TODISABLE=('com.apple.security.keychainsyncingoveridsproxy' 'com.apple.personad' 'com.apple.passd' 'com.apple.screensharing.MessagesAgent' 'com.apple.CommCenter-osx' 'com.apple.Maps.mapspushd' 'com.apple.Maps.pushdaemon' 'com.apple.photoanalysisd' 'com.apple.telephonyutilities.callservicesd' 'com.apple.AirPlayUIAgent' 'com.apple.AirPortBaseStationAgent' 'com.apple.CalendarAgent' 'com.apple.DictationIM' 'com.apple.iCloudUserNotifications' 'com.apple.familycircled' 'com.apple.familycontrols.useragent' 'com.apple.familynotificationd' 'com.apple.gamed' 'com.apple.icloud.findmydeviced.findmydevi
@durango
durango / compiling_building_c_cpp_notes.md
Created January 20, 2018 21:15 — forked from gubatron/compiling_building_c_cpp_notes.md
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015.

Include Paths

On the compilation phase, you will usually need to specify the different include paths so that the interfaces (.h, .hpp) which define structs, classes, constans, and functions can be found.

With gcc and llvm include paths are passed with -I/path/to/includes, you can pass as many -I as you need.

In Windows, cl.exe takes include paths with the following syntax: /I"c:\path\to\includes\ you can also pass as many as you need.

@durango
durango / main.go
Created January 8, 2018 15:58 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@durango
durango / and_select.rs
Created December 24, 2017 14:46 — forked from alex-shapiro/and_select.rs
An "AND" version of the futures stream combinator
//! An adapter for merging the output of two streams, where
//! the stream resolves as soon either stream resolves.
use futures::{Poll, Async};
use futures::stream::{Stream, Fuse};
pub struct AndSelect<S1, S2> {
stream1: Fuse<S1>,
stream2: Fuse<S2>,
flag: bool,
@durango
durango / channels.rs
Created December 23, 2017 02:42 — forked from jakejscott/channels.rs
rust channels and threads
use std::thread;
use std::sync::mpsc::channel;
use std::sync::mpsc::sync_channel;
// Create a simple streaming channel
fn example1() {
// (tx for transmission)
// (rx for receiving)
let (tx, rx) = channel();