Skip to content

Instantly share code, notes, and snippets.

@notionparallax
notionparallax / a.json
Last active July 2, 2020 00:51
This is how I'd read a folder full of json files and turn them into a dataframe. There's probably a more efficient way that Pandas can do, but this gives a good level of fine control.
{
"name": "A",
"chats": [
{
"dt":"2020-07-02 10:32:54.876422",
"from":"me",
"message":"yo"
},{
"dt":"2020-07-02 10:35:54.876422",
"from":"them",
@notionparallax
notionparallax / luluBookSizes.css
Created June 26, 2020 03:20
I wanted to pay around with the lulu page sizes for printing, so I made some css variables out of their product page: https://xpress.lulu.com/our-products
:root {
/* Lulu Book Sizes */
--US-Trade: 6in 9in; /* The most common size for trade paperbacks and hardcovers, used primarily for fiction but well suited for a variety of book designs. */
--US-Letter: 8.5in 11in; /* Used for hardcover books, manuals, and other large size works, US letter is a great option for image-heavy books. */
--Digest: 5.5in 8.5in; /* A smaller trade size, digest is one of the most commonly used sizes for fiction and nonfiction works. */
--Executive: 7in 10in; /* Executive size fits between US trade and US letter and is commonly used for journals and graphic novels. */
--A5: 5.83in 8.27in; /* Standard size for international trade paperbacks and hardcovers. Similar to US trade size but slightly smaller. */
--A4: 8.27in 11.69in; /* A4 is the standard size used for many magazines and catalogs. */
--Royal: 6.14in 9.21in; /* Royal is sligh
import io, sys
book_of_counts = [
{
"expect": """let's get ready to rumble 8
let's get ready to rumble 7
let's get ready to rumble 6
let's get ready to rumble 5
let's get ready to rumble 4
let's get ready to rumble 3
@notionparallax
notionparallax / fake_camera.py
Created May 1, 2019 00:29
A nicer way to view the output from a GridEye in the terminal. Useful for headless debugging.
import random
import math
import time
low = 19.0
high = 25.0
def randInRange():
spread = high - low
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.plannerTask)",
"@odata.count": 23,
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/planner/tasks?$skiptoken=1%2523J%2b22F531F5699E58EE%2b-b4ULH-doEuXT7-8NB9_fGUAD4LA",
"value": [
{
"@odata.etag": "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\"",
"planId": "IlGTfsb-PEWl5EYIx97I5WUAB8ni",
"bucketId": "fno1rNw2Vk2x7XwLQib9aWUAC2YS",
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('48d31887-5fad-4d73-a9f5-3c356e68a038')/calendarView",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/calendarview?startdatetime=2019-05-3T03%3a08%3a19.120Z&enddatetime=2019-05-10T03%3a08%3a19.120Z&$skip=10",
"value": [
{
"@odata.etag": "W/\"IiLKjG2I7E+Xv0+ys6MD0wABbkWMRg==\"",
"id": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAFRAAgI1tG1yFgAAEYAAAAAIkPFveuwe0ygY4Mfa1RFEQcAIiLKjG2I7E_Xv0_ys6MD0wAAAAABDQAAIiLKjG2I7E_Xv0_ys6MD0wAAGvlisgAAEA==",
"createdDateTime": "2017-09-08T06:00:28.0922072Z",
"lastModifiedDateTime": "2019-02-05T07:57:17.5023461Z",
@notionparallax
notionparallax / basic_techtree.js
Last active June 6, 2018 01:56 — forked from magjac/index.html
d3-graphviz Basic Example
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="https://d3js.org/d3.v4.min.js"></script>
<script src="https://unpkg.com/viz.js@1.8.0/viz.js" type="javascript/worker"></script>
<script src="https://unpkg.com/d3-graphviz@1.4.0/build/d3-graphviz.min.js"></script>
<div id="graph" style="text-align: center;"></div>
<script>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@notionparallax
notionparallax / dot_ripper.py
Created May 9, 2017 02:32
Describes the topology of a grasshopper file
"""Describe the topology of the current document."""
ghdoc = ghenv.Component.OnPingDocument()
o = ghdoc.Objects
nodes = ""
connections = ""
lookup = {}
EDGE = ' {} -> {};\n'
NODE = ' {name}_{id} [shape=box,label="{name}"];\n'