Skip to content

Instantly share code, notes, and snippets.

@niklasschmitz
niklasschmitz / jaxpr_graph.py
Last active January 7, 2024 19:15 — forked from mattjj/grad_graph.py
visualizing jaxprs
import jax
from jax import core
from graphviz import Digraph
import itertools
styles = {
'const': dict(style='filled', color='goldenrod1'),
'invar': dict(color='mediumspringgreen', style='filled'),
'outvar': dict(style='filled,dashed', fillcolor='indianred1', color='black'),
@viking
viking / i3-shell.sh
Last active March 25, 2024 16:25
Bash script for i3 to run a terminal in the same working directory as the current focused application
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
CMD=xterm
CWD=''
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get PID of process whose window this is
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@wardbekker
wardbekker / .emacs
Created December 2, 2010 10:18
My configuration to open files in an ssh session and opening them in a local emacs with Tramp
(setq server-socket-dir "~/.emacs.d/server")
(server-start)
@mizutomo
mizutomo / msgpack_enum.cpp
Created June 7, 2010 06:34
MessagePackによるenum型のシリアライズ/デシリアライズ
#include <msgpack.hpp>
#include <vector>
#include <map>
#include <iostream>
#include <cstdio>
typedef enum {
CIRCLE = 0,
SQUARE = 1,
TRIANGLE = 2