Skip to content

Instantly share code, notes, and snippets.

@bliiir
bliiir / bucket.txt
Created Nov 18, 2018
Postgres table: bucket
View bucket.txt
+---------+---------------+--------------+--------------+-------------+---------------+-----------+-------------+----------------+
| index | time_close | price_open | price_high | price_low | price_close | volume | market_id | timeframe_id |
|---------+---------------+--------------+--------------+-------------+---------------+-----------+-------------+----------------|
| 0 | 1541808000000 | 6338.5 | 6344.0 | 6334.5 | 6341.5 | 19261715 | 1 | 4 |
| 1 | 1541811600000 | 6341.5 | 6342.0 | 6338.5 | 6342.0 | 8929477 | 1 | 4 |
| 2 | 1541815200000 | 6342.0 | 6346.0 | 6341.5 | 6341.5 | 13150688 | 1 | 4 |
| 3 | 1541818800000 | 6341.5 | 6342.0 | 6340.0 | 6340.0 | 9610798 | 1 | 4 |
| 4 | 1541822400000 | 6340.0 | 6364.0 | 6340.0 | 6360.0 | 52570621 | 1
@bliiir
bliiir / bucket_temp.txt
Created Nov 18, 2018
Postgres table: bucket_temp
View bucket_temp.txt
+---------+---------------+--------------+--------------+-------------+---------------+-----------+-------------+----------------+
| index | time_close | price_open | price_high | price_low | price_close | volume | market_id | timeframe_id |
|---------+---------------+--------------+--------------+-------------+---------------+-----------+-------------+----------------|
| 0 | 1541808000000 | 6338.5 | 6344.0 | 6334.5 | 6341.5 | 19261715 | 1 | 4 |
| 1 | 1541811600000 | 6341.5 | 6342.0 | 6338.5 | 6342.0 | 8929477 | 1 | 4 |
| 2 | 1541815200000 | 6342.0 | 6346.0 | 6341.5 | 6341.5 | 13150688 | 1 | 4 |
| 3 | 1541818800000 | 6341.5 | 6342.0 | 6340.0 | 6340.0 | 9610798 | 1 | 4 |
| 4 | 1541822400000 | 6340.0 | 6364.0 | 6340.0 | 6360.0 | 52570621 | 1
@bliiir
bliiir / INSERT.sql
Created Nov 18, 2018
Postgres database: Merge two tables using composite key constraints and Insert statement in what is know as an UPSERT
View INSERT.sql
INSERT INTO bucket(
market_id,
timeframe_id,
time_close,
price_open,
price_high,
price_low,
price_close,
volume)
SELECT
@bliiir
bliiir / template.py
Created Nov 20, 2018
python .py template file
View template.py
#!/usr/bin/python3
'''
------------------------------------------------------------------------
IMPORTS
------------------------------------------------------------------------
'''
# Standard library imports
@bliiir
bliiir / cli.md
Last active Sep 6, 2019
My CLI cheat-sheet
View cli.md

# Command Line cheatsheet

Commands

Cheat Sheets

Navigate

Command meaning example
pwd Print work directory
@bliiir
bliiir / gist:34f3548448e95d7a5cb514870702c72b
Created Feb 26, 2019
Add git repo to your local machine
View gist:34f3548448e95d7a5cb514870702c72b
git init
git remote add origin https://github.com/bliiir/traktor_playlist.git
git pull origin master
@bliiir
bliiir / traktor_html_playlist_to_csv.py
Created Feb 27, 2019
Native Instrument Traktor Playlist csv converter
View traktor_html_playlist_to_csv.py
#!/usr/bin/env python3
# coding: utf-8
import pandas as pd
import lxml
import html5lib
import bs4
# Get filename and path from user
print('Filepath and name')