Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bliiir
bliiir / cli.md
Last active September 6, 2019 09:31
My CLI cheat-sheet

# Command Line cheatsheet

Commands

Cheat Sheets

Navigate

Command meaning example
pwd Print work directory
@bliiir
bliiir / traktor_html_playlist_to_csv.py
Created February 27, 2019 14:14
Native Instrument Traktor Playlist csv converter
#!/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')
@bliiir
bliiir / gist:34f3548448e95d7a5cb514870702c72b
Created February 26, 2019 12:24
Add git repo to your local machine
git init
git remote add origin https://github.com/bliiir/traktor_playlist.git
git pull origin master
@bliiir
bliiir / template.py
Created November 20, 2018 11:40
python .py template file
#!/usr/bin/python3
'''
------------------------------------------------------------------------
IMPORTS
------------------------------------------------------------------------
'''
# Standard library imports
@bliiir
bliiir / INSERT.sql
Created November 18, 2018 15:27
Postgres database: Merge two tables using composite key constraints and Insert statement in what is know as an UPSERT
INSERT INTO bucket(
market_id,
timeframe_id,
time_close,
price_open,
price_high,
price_low,
price_close,
volume)
SELECT
@bliiir
bliiir / bucket_temp.txt
Created November 18, 2018 15:22
Postgres table: bucket_temp
+---------+---------------+--------------+--------------+-------------+---------------+-----------+-------------+----------------+
| 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.txt
Created November 18, 2018 15:15
Postgres table: bucket
+---------+---------------+--------------+--------------+-------------+---------------+-----------+-------------+----------------+
| 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