Skip to content

Instantly share code, notes, and snippets.

View TechNickAI's full-sized avatar
💭
Heart Centered Technology Leader

Nick Sullivan TechNickAI

💭
Heart Centered Technology Leader
View GitHub Profile
@pietjepuk2
pietjepuk2 / get_validator_duties.py
Last active August 6, 2023 16:21
Get validator duties (find largest gap in which to update for that $0.04 it will save/benefit you)
import json
import math
from datetime import datetime, timedelta
import requests
SLOTS_PER_EPOCH = 32
SECONDS_PER_SLOT = 12
@jmoz
jmoz / rsi.py
Created September 27, 2019 07:41
RSI calculation to match Tradingview
import pandas as pd
def rsi(ohlc: pd.DataFrame, period: int = 14) -> pd.Series:
"""See source https://github.com/peerchemist/finta
and fix https://www.tradingview.com/wiki/Talk:Relative_Strength_Index_(RSI)
Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements.
RSI oscillates between zero and 100. Traditionally, and according to Wilder, RSI is considered overbought when above 70 and oversold when below 30.
Signals can also be generated by looking for divergences, failure swings and centerline crossovers.
@mementum
mementum / vanktharp-coinflip.py
Created August 26, 2019 21:34
Beating The Random Entry
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
# Copyright (C) 2019 Daniel Rodriguez - MIT License
# - https://opensource.org/licenses/MIT
# - https://en.wikipedia.org/wiki/MIT_License
###############################################################################
import argparse
import random
@cmsimike
cmsimike / callable.py
Created April 11, 2012 07:39 — forked from durden/callable.py
Clever way to use Python __call__ and __getattr__ to create web APIs that can map directly (dynamically) to actual API
class MyCallable(object):
def __init__(self, urlparts, callable):
self.urlparts = urlparts
self.callable = callable
def __call__(self, **kwargs):
print kwargs
print self.urlparts
def __getattr__(self, name):
# Return a callable object of this same type so that you can just keep
# chaining together calls and just adding that missing attribute to the