Skip to content

Instantly share code, notes, and snippets.

View StuartFarmer's full-sized avatar
🏹
take the shot

Stuart Farmer StuartFarmer

🏹
take the shot
  • Lisbon, Portugal
View GitHub Profile
@dabeaz
dabeaz / README.txt
Created October 15, 2019 20:10
PyCon India 2019, Code from Keynote Presentation by @dabeaz
Code from PyCon India 2019 Keynote Talk
David Beazley (https://www.dabeaz.com)
======================================
This code is presented "as is" and represents what was live-coded
during my closing keynote presentation at PyCon India, Chennai,
October 13, 2009. I have made no changes to the files.
Requires: Python 3.6+, numpy, pygame
@sebjai
sebjai / OrderFlow.ipynb
Created September 26, 2019 21:39
Optimal trading with order-flow and short-term alpha
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kangchihlun
kangchihlun / 101Alpha_code_1.py
Last active June 13, 2024 08:47
101Alpha_code_1.py
import numpy as np
import pandas as pd
from numpy import abs
from numpy import log
from numpy import sign
from scipy.stats import rankdata
# region Auxiliary functions
def ts_sum(df, window=10):
"""
from btgym import BTgymEnv
import IPython.display as Display
import PIL.Image as Image
from gym import spaces
import gym
import numpy as np
import random
@jackzampolin
jackzampolin / README.md
Last active January 30, 2023 18:36
Insight API Queries for Explorer

GET

Transactions by block and address

This endpoint returns full transaction data for blocks and Addresses

NOTE: there is an undocumented param to paginate, didn't go digging

@eevee
eevee / perlin.py
Last active June 20, 2024 01:58
Perlin noise in Python
"""Perlin noise implementation."""
# Licensed under ISC
from itertools import product
import math
import random
def smoothstep(t):
"""Smooth curve with a zero derivative at 0 and 1, making it useful for
interpolating.
@f0rki
f0rki / tapebagel.rs
Last active May 31, 2018 02:23
Interpreter for the TapeBagel esoteric language
/*
* ----------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <contact@f0rki.at> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return.
* ----------------------------------------------------------------------------
*/
/// Interpreter for the TapeBagel esoteric language
@SpotlightKid
SpotlightKid / getdocstrings.py
Created September 1, 2014 09:22
Parse Python source code and get or print docstrings.
# -*- coding: utf-8 -*-
"""Parse Python source code and get or print docstrings."""
__all__ = ('get_docstrings', 'print_docstrings')
import ast
from itertools import groupby
from os.path import basename, splitext
@1wErt3r
1wErt3r / SMBDIS.ASM
Created November 9, 2012 22:27
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger (doppelheathen@gmail.com)
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@dfm
dfm / _chi2.c
Created August 3, 2012 13:41
How to wrap C code in Python
#include <Python.h>
#include <numpy/arrayobject.h>
#include "chi2.h"
/* Docstrings */
static char module_docstring[] =
"This module provides an interface for calculating chi-squared using C.";
static char chi2_docstring[] =
"Calculate the chi-squared of some data given a model.";