Skip to content

Instantly share code, notes, and snippets.

@rsimd
rsimd / pyproject.toml
Created July 23, 2023 07:13
`pyproject.toml` for `rye` to install `pytorch` that can use `cuda` (wip)
[project]
name = "dsbook"
version = "0.1.0"
description = "Add a short description here"
dependencies = [
"numpy>=1.24.4",
"scipy>=1.10.1",
"pandas>=2.0.3",
"matplotlib>=3.7.2",
"plotly>=5.15.0",
using CairoMakie
using Cairo
using Poppler_jll
@recipe(PDF) do scene
Attributes(
bbox = BBox(0, 100, 0, 100)
)
end
@karthink
karthink / fast-latex-input.el
Last active November 12, 2024 08:47
Configuration for super-fast Latex input using AucTeX, CDLatex and a bit of YaSnippet. See https://karthinks.com/software/latex-input-for-impatient-scholars
;; This elisp code uses use-package, a macro to simplify configuration. It will
;; install it if it's not available, so please edit the following code as
;; appropriate before running it.
;; Note that this file does not define any auto-expanding YaSnippets.
;; Install use-package
(package-install 'use-package)
;; AucTeX settings - almost no changes
@StefanKarpinski
StefanKarpinski / definitions.jl
Last active July 19, 2019 15:10
method vs lambda
f(x::Int) = "$x is an integer"
f(x::String) = "$x is a string"
g = x::Int -> "$x is an integer"
g = x::String -> "$x is a string"
@doapp-ryanp
doapp-ryanp / gist:4595068
Created January 22, 2013 14:34
configure spotify for linux shortcut keys
#@see rynop.com for details
sudo apt-get install xbindkeys
####now put the following in ~/.xbindkeysrc:
#KeyboardPlay
"dbus-send --print-reply --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause"
XF86AudioPlay
#KeyboardStop
@matsen
matsen / svg2tiff
Created December 12, 2012 01:05
A script to convert SVG to a TIFF acceptable to PLOS
#!/bin/sh
# Convert all arguments (assumed SVG) to a TIFF acceptable to PLOS
# Requires Inkscape and ImageMagick 6.8 (doesn't work with 6.6.9)
for i in $@; do
BN=$(basename $i .svg)
inkscape --without-gui --export-png="$BN.png" --export-dpi 300 $i
convert -compress LZW -alpha remove $BN.png $BN.tiff
mogrify -alpha off $BN.tiff