Skip to content

Instantly share code, notes, and snippets.

@dkendrick
dkendrick / powershell-bg-task
Created November 4, 2014 03:25
Run tasks in the background with powershell. This was inspired by the "&" functionality of bash.
function bg()
{
if ($args.length -lt 0)
{
Write-Output "No parameters specified";
return;
}
if ($args.length -gt 1)
{
@dkendrick
dkendrick / CSVPrinter.js
Last active September 7, 2019 16:30
Print mongo result to CSV
/*globals db*/
db.system.js.save({
_id : 'CSVPrinter',
value : function CSVPrinter() {
var firstRun = true;
function checkFirstRun(record){
if (firstRun) {
firstRun = false;
@dkendrick
dkendrick / hedge_twapper.py
Created August 20, 2022 00:29
Python script to assist algo by twapping down a Bybit hedged position, one is a futures and one a perp. Requires the new bybit python library pybit.
import logging
from asyncio import BaseEventLoop, gather, get_event_loop, sleep, Task
from functools import partial
from os import environ
from pybit import inverse_futures, inverse_perpetual
"""
env variables - please make sure these are set (i.e `export BYBIT_API_KEY=abc1234`)
BYBIT_API_KEY=