Skip to content

Instantly share code, notes, and snippets.

Don't recap or summarize things that you've stated in the same turn of a conversation unless explicitly asked for a summary.
If there is something about my thinking, code or writing that could be improved, tell me bluntly. I can take direct criticism.
Don't be unnecessarily wordy. I like direct, succinct communication.
When telling me how to do something, list out all the prerequisites or expected starting conditions rather than assuming anything.
Don't assume very brief or misspelled queries mean I'm stupid or lazy. Often I'm just in a rush, but respond to all queries as if they were written by an intelligent, careful person. Ask for clarification if the query is unclear.
@garymm
garymm / asana_to_todoist.py
Created June 16, 2024 03:20
Convert an asana exported CSV to a format that can be imported by Todoist
import csv
import os
import sys
assignee_first_name_to_id = {
# You can get this by following the instructions
# in Todoist's help article on CSV import
# https://todoist.com/help/articles/format-a-csv-file-to-import-into-todoist-UVUXTmm6
}
```
2024-06-11T21:59:12Z INFO Update strategy set to: {"updateStrategy": "immediate"}
2024-06-11T21:59:12Z INFO AutoscalingListener logging parameters changed {"LogLevel": "debug", "LogFormat": "text"}
2024-06-11T21:59:12Z INFO Registering scale set metrics
2024-06-11T21:59:12Z INFO starting manager {"version": "0.9.2"}
2024-06-11T21:59:12Z INFO Starting EventSource {"controller": "autoscalingrunnerset", "controllerGroup": "actions.github.com", "controllerKind": "AutoscalingRunnerSet", "source": "kind source: *v1alpha1.AutoscalingRunnerSet"}
2024-06-11T21:59:12Z INFO Starting EventSource {"controller": "autoscalingrunnerset", "controllerGroup": "actions.github.com", "controllerKind": "AutoscalingRunnerSet", "source": "kind source: *v1alpha1.EphemeralRunnerSet"}
2024-06-11T21:59:12Z INFO Starting EventSource {"controller": "autoscalingrunnerset", "controllerGroup": "actions.github.com", "controllerKind": "AutoscalingRunnerSet", "source": "kind source:
@garymm
garymm / count_lines_of_code.py
Created May 1, 2023 22:35
python script to graph lines of code across git commits
import os
import sys
import click
import git
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
@garymm
garymm / set-up-julia.sh
Last active May 2, 2023 23:54
Steps to get julia working with conda on MacOS ARM64
# Note once https://github.com/conda-forge/julia-feedstock/issues/226 is really fixed,
# can just replace this all with mamba install -c conda-forge julia
mamba install -c conda-forge juliaup
ln -s julialauncher ${CONDA_PREFIX}/bin/julia
juliaup add release
# Tell direnv to activate a julia environment for current working dir
echo "layout julia" >> .envrc
direnv allow
@garymm
garymm / serialize_deserialize_thrift.go
Created August 12, 2022 18:53
Example of how to serialize and deserialize arbitrary Thrift structs
package main
import (
"context"
"github.com/apache/thrift/lib/go/thrift"
)
func TStructToBytes(obj thrift.TStruct) []byte {
transport := thrift.NewTMemoryBuffer()
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Gary Miguel",
"label": "software engineer and manager",
"image": "https://media-exp1.licdn.com/dms/image/C5603AQHYBCIryEnWDQ/profile-displayphoto-shrink_800_800/0/1589651499542?e=1648080000&v=beta&t=0dpk7IJnhCTmWQSkYbjp_RRnZmIUZ0UjYl2eKR7uOtQ",
"email": "garymm@garymm.org",
"website": "https://garymm.org",
"summary": "Looking for opportunities to do real good with my skills.\nSee <https://80000hours.org/key-ideas/>",
"location": {
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Architecture set to: x86_64-unknown-linux-gnu.
(lldb) bt
* thread #1, name = 'repl_swift', stop reason = signal SIGSTOP
  * frame #0: 0x00007f5951c4a9f3 libpthread.so.0`__pthread_cond_wait + 579
    frame #1: 0x00007f5934c76a09 libFoundationNetworking.so`FoundationNetworking._NSNonfileURLContentLoader.contentsOf(url: Foundation.URL) throws -> (result: Foundation.NSData, textEncodingNameIfAvailable: Swift.Optional<Swift.String>) + 505
    frame #2: 0x00007f5934c77548 libFoundationNetworking.so`protocol witness for Foundation._NSNonfileURLContentLoading.contentsOf(url: Foundation.URL) throws -> (result: Foundation.NSData, textEncodingNameIfAvailable: Swift.Optional<Swift.String>) in conformance FoundationNetworking._NSNonfileURLContentLoader : Foundation._NSNonfileURLContentLoading in FoundationNetworking + 8
    frame #3: 0x00007f594b9edad0 libFoundation.so`function signature specialization <Arg[2] = Dead> of static Foundation.NSData.contentsOf(url: Foundation.URL, options: Foundation.NSData.ReadingOptions) th
@garymm
garymm / router.rsc
Last active November 22, 2020 04:05
# mar/31/2020 09:09:09 by RouterOS 6.45.7
# software id = V76F-PB93
#
# model = RB750Gr3
# serial number = 8B000A516329
/interface bridge
add name=BR1 protocol-mode=none vlan-filtering=yes
/interface vlan
add interface=BR1 name=BASE_VLAN vlan-id=99
add interface=BR1 name=BLUE_VLAN vlan-id=10