Skip to content

Instantly share code, notes, and snippets.

@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
@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",
FROM
<img
src="https://pantograph-punch.com/system/rich/rich_files/rich_files/000/005/042/m/mad-20-26-20thoughtful-3.jpg"
alt="The image that should be here isn't downloading 😥"
data-ref="ce14997b-4245-4712-b997-a72df10e2d14"
>
TO
<img
alt=""
data-rich-file-id="5042"
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>fp_Ben-Doherty</title>
ed_name source
0 edition_11 medium
1 edition_11 nytimes
2 edition_11 selfhacked
3 edition_11 medium
4 edition_11 forbes
5 edition_11 firstround
6 edition_11 nytimes
7 edition_11 medium
8 edition_11 medium
#%%
from numpy import NaN # NaN means not a number
import pandas as pd
#%%
price_df = pd.read_excel(
"price_history_checks_may2021.xlsx", parse_dates=["PriceUpdatedDate"]
)
price_df.head()
$logpath = "c:\Servicing\weblog.txt"
$dtfmt = 'yyyy-mm-dd HH:mm:ss.ff'
$trigerTime = [System.DateTime]::UtcNow.tostring($dtfmt) # Could be $(Get-Date -AsUTC -Format $dtfmt ) in never versions of PS
function gather {
$adapters = Get-WmiObject -class win32_networkadapterconfiguration | where-object { $null -ne $_.DefaultIPGateway } | Select DNSDomain, IPAddress, MACAddress, Description, DefaultIPGateway
$result = New-Object -TypeName psobject -Property @{
user = $env:username
triggeredat = $trigerTime
adapters = $adapters
digraph G {
// rankdir=LR; // Delete the slashes if you prefer this to run left to right
// Spread it out a bit
// size = "8.33,16.66!"; // 1200x600 at 72px/in, "!" to force
size = "9,20!"; // 1200x600 at 72px/in, "!" to force
ratio = "fill"; // see https://graphviz.gitlab.io/_pages/doc/info/attrs.html#d:ratio
// 8143: Master of Architecture
Name Width in characters Width in picas
Dolores Hidalgo Cuna de la Independencia Nacional 49 23.154
San Martin Texmelucan de Labastida 34 16.596
Santo Domingo de los Colorados 30 14.61
Tultitlan de Mariano Escobedo 29 13.566
Apatzingan de la Constitucion 29 13.308
Madinat as Sadis min Uktubar 28 13.278
Soledad de Graciano Sanchez 27 13.704
Zhangjiakou Shi Xuanhua Qu 26 13.116
@notionparallax
notionparallax / script.py
Created September 30, 2022 08:07
A pyRevit script that pulls all the branches of a repo of pyRevit tools
#! python3
"""
Update (pull) all branches.
This is unsafe/may fail if you've been developing locally, so you need to clean
up your local env, and commit all your changes before you press this button.
"""
imports_worked = False
module_not_found_error_message = ""