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 / cloud formation
Created February 15, 2017 04:09
From iPhone.
Infrastructure as Code
@ParzivalWins
ParzivalWins / test.tf
Created February 21, 2017 03:06
Sample from Git
{function: t2.micro
}
Verifying that "parzival.id" is my Blockstack ID. https://onename.com/parzival
@ParzivalWins
ParzivalWins / keybase.md
Created September 26, 2017 19:13
proof of identity

Keybase proof

I hereby claim:

  • I am parzivalwins on github.
  • I am parzival (https://keybase.io/parzival) on keybase.
  • I have a public key ASBy93CfTJs_09EpRT-YHeKQHaoM7bcYLY72GH4Lf_-j7wo

To claim this, I am signing this object:

@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
@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 / 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 / base.js
Created September 11, 2019 00:07
FrontEnd
console.log("Sanity Check: JS is working!");
$(document).ready(function(){
// code in here
});
## Comment GPG Commit
@ParzivalWins
ParzivalWins / Dockerfile
Created September 11, 2019 00:08
Dockerfile LAMP
#FROM ubuntu
#ADD . /app
#RUN apt-get update
#RUN apt-get upgrade -y
# we should remove ssh and mysql, and use
# separate container for database
#RUN apt-get install -y nodejs # ssh mysql
#RUN cd /app && npm install
#FROM ubuntu:16.04 #version of ubuntu
#RUN apt-get update && apt-get install -y nodejs
@ParzivalWins
ParzivalWins / pandas-gist-example.py
Last active March 10, 2020 03:03
Pandas-Import-CSV-Using-Requests-Create-DataFrame
import requests
download_url = "https://raw.githubusercontent.com/fivethirtyeight/data/master/nba-elo/nbaallelo.csv"
target_csv_path = "nba_all_elo.csv"
response = requests.get(download_url)
response.raise_for_status() # Check that the request was successful
with open(target_csv_path, "wb") as f:
f.write(response.content)
print("Download ready.")
import pandas as pd
nba = pd.read_csv("nba_all_elo.csv")