Skip to content

Instantly share code, notes, and snippets.

View ParzivalWins's full-sized avatar
💭
Know Thyself

Parzival ParzivalWins

💭
Know Thyself
View GitHub Profile
@ParzivalWins
ParzivalWins / pandoc-docx-md.bat
Created June 5, 2022 21:57 — forked from arthurattwell/pandoc-docx-md.bat
Script to convert docx to markdown with Pandoc
:: pandoc-docx-md.bat
::
:: Don't show these commands to the user
@ECHO off
:: Set the title of the window
TITLE Convert docx to markdown with Pandoc
:: Select file marker
:selectfile
:: Clear any preexisting filename variables
SET filename=
@ParzivalWins
ParzivalWins / kaggle_download.py
Created April 9, 2020 19:38 — forked from jayspeidell/kaggle_download.py
Sample script to download Kaggle files
# Info on how to get your api key (kaggle.json) here: https://github.com/Kaggle/kaggle-api#api-credentials
!pip install kaggle
api_token = {"username":"USERNAME","key":"API_KEY"}
import json
import zipfile
import os
with open('/content/.kaggle/kaggle.json', 'w') as file:
json.dump(api_token, file)
!chmod 600 /content/.kaggle/kaggle.json
!kaggle config path -p /content
@ParzivalWins
ParzivalWins / jupyterlab_shortcuts.md
Created April 2, 2020 17:39 — forked from discdiver/jupyterlab_shortcuts.md
Common Jupyter Lab Keyboard Shortcuts

Note, if you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cells

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

  • Ctrl + B toggles hide/show left sidebar

@ParzivalWins
ParzivalWins / ConvertAppleHealthXMLtoCSV.py
Created August 24, 2019 00:50 — forked from xiantail/ConvertAppleHealthXMLtoCSV.py
Import XML file from Apple Health then convert to CSV file
import xml.etree.ElementTree as ET
import csv
import datetime
def convert_xml_to_csv(file_path):
with open(file_path, 'rb') as fd:
root = ET.parse(fd).getroot()
records = []
@ParzivalWins
ParzivalWins / bitcoin-cash.sql
Created February 23, 2019 18:53 — forked from allenday/bitcoin-cash.sql
What are the current balances of a random set of 1000 addresses on blockchain X?
WITH double_entry_book AS (
-- debits
SELECT
ARRAY_TO_STRING(inputs.addresses, ",") AS address
, inputs.type
, -inputs.value AS value
FROM `bigquery-public-data.crypto_bitcoin_cash.transactions` JOIN UNNEST(inputs) AS inputs
WHERE block_timestamp_month = '2019-01-01'
UNION ALL
@ParzivalWins
ParzivalWins / zero-fee-bitcoin-tx.sql
Created February 23, 2019 18:52 — forked from allenday/zero-fee-bitcoin-tx.sql
Find zero-fee Bitcoin transactions
SELECT
ROUND((input_value - output_value)/ size, 0) AS fees_per_byte,
COUNT(*) AS txn_cnt
FROM
`bigquery-public-data.crypto_bitcoin.transactions`
WHERE TRUE
AND block_timestamp >= '2018-01-01'
AND is_coinbase IS FALSE
GROUP BY 1