Skip to content

Instantly share code, notes, and snippets.

function svg2png(svgContent, width, height, callback) {
// svgContent should be in base64
let svgData = svgContent;
let canvas = document.createElement("canvas");
let context = canvas.getContext("2d");
canvas.width = width;
canvas.height = height;
let image = new Image();
@ssrihari
ssrihari / clojure-learning-list.md
Last active April 17, 2025 15:56
An opinionated list of excellent Clojure learning materials

An opinionated list of excellent Clojure learning materials

These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.

  • 🔴 Mandatory (for both beginners and intermediates)
  • 🟩 For beginners
  • 🟨 For intermediates

Table of contents

  1. Getting into the language
@madebyollin
madebyollin / stable_diffusion_m1.py
Last active February 10, 2024 02:25
Stable Diffusion on Apple Silicon GPUs via CoreML; 2s / step on M1 Pro
# ------------------------------------------------------------------
# EDIT: I eventually found a faster way to run SD on macOS, via MPSGraph (~0.8s / step on M1 Pro):
# https://github.com/madebyollin/maple-diffusion
# The original CoreML-related code & discussion is preserved below :)
# ------------------------------------------------------------------
# you too can run stable diffusion on the apple silicon GPU (no ANE sadly)
#
# quick test portraits (each took 50 steps x 2s / step ~= 100s on my M1 Pro):
# * https://i.imgur.com/5ywISvm.png
@aerdely
aerdely / ArturoCovid.jl
Created June 21, 2022 17:12
Procesar datos COVID-19
### Procesar datos SSalud para modelo compartimental
using CSV, DataFrames, Dates
## Cargar datos
@time begin
fechaDate = Date(2022,6,16)
archivo = "220616COVID19MEXICO.csv"
@dienhoa
dienhoa / docment-notes.md
Last active February 19, 2022 05:20
It's my note about useful commands I use during the docment sprint https://github.com/muellerzr/fastai-docment-sprint

Run 3 commands below when you prepare your PR

nbdev_build_lib 

nbdev_build_docs —fname {path the to file}

nbdev_clean_nbs
@sts10
sts10 / rust-command-line-utilities.markdown
Last active April 19, 2025 22:06
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
JJNEERCFKNBUUR2SINDESU2DJJGEESSUJVHEWRKKIZDVMTKOINEUSNBSIRDVKMSOJFMVURKHJZBFKSKSJFCTEVKTKZFTKQSVLFLEGRKKLEZFMT2VLJLUYSSHIZFVIU2DJNLEYVKPK5FU2SSWIRDE2VSLJBEU4TKUI5KEGT2JLJGUKT2UGJGUUUSFIU3FMU2WJM2UKVSVKNJU6SSWINLE6V2DKZFUCWSVJFKFEVSHJJGUKQ2NLJKEUNKFIZGVEU2HJFDEWVKFKZJUQSS2IVCUSVKKGVEFKNSRHU6T2PI=
@sarthakpranesh
sarthakpranesh / cleanMacVMs.sh
Last active April 12, 2025 21:58
Debloat Mac OS ( use at your own risk )
# I use MacOS VMs from github for iOS development.
# By no suprise they are a bit slow and have a lot of things I don't use
# Hence this script for lighter and better VM for my iOS development and builds
# GUI and animation related things to tweak
defaults write NSGlobalDomain NSAutomaticWindowAnimationsEnabled -bool false
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
defaults write -g QLPanelAnimationDuration -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
defaults write com.apple.dock launchanim -bool false
sudo sysctl debug.lowpri_throttle_enabled=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shawwn
shawwn / since2010.md
Created May 11, 2021 09:46
"What happened after 2010?"

This was a response to a Hacker News comment asking me what I've been up to since 2010. I'm posting it here since HN rejects it with "that comment is too long." I suppose that's fair, since this ended up being something of an autobiography.

--

What happened after 2010?