Skip to content

Instantly share code, notes, and snippets.

View georghildebrand's full-sized avatar

ghildebrand georghildebrand

  • EU
View GitHub Profile
@georghildebrand
georghildebrand / gist:5caf70a2ad59d3a783e325aa30d781c0
Last active September 24, 2019 08:31
Using up some memory with python in a controlled way
# Eat up some memory until 30% of system total
import psutil, os
nb_process_id = os.getpid()
p = psutil.Process(nb_process_id)
from multiprocessing import Pool
import string
import random
@georghildebrand
georghildebrand / download.py
Last active January 13, 2019 22:17
Download cryptocurrency metrics from Kraken for last 12 hours in 1 min interval
#/usr/bin/python
import requests as r
import datetime as dt
def nxtime2datetime(nix_time):
return dt.datetime.fromtimestamp(nix_time)
#get time of server
url = 'https://api.kraken.com/0/public/Time'
@georghildebrand
georghildebrand / holtwinters.py
Created June 13, 2017 09:03 — forked from andrequeiroz/holtwinters.py
Implementation of Holt-Winters algorithms in Python 2
#The MIT License (MIT)
#
#Copyright (c) 2015 Andre Queiroz
#
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions: