Skip to content

Instantly share code, notes, and snippets.

@mgedmin
mgedmin / demo.txt
Created December 12, 2012 16:25
Fixing Mako tracebacks (version 2)
$ virtualenv /tmp/sandbox
...
$ /tmp/sandbox/bin/pip install mako
...
$ /tmp/sandbox/bin/python mako_tb.py
= Default traceback =
@whyrusleeping
whyrusleeping / archsetup.md
Last active May 11, 2019 17:15
arch linux setup guide for samsung chromebook 2

Arch Linux Chromebook 2 Setup

First, follow the instructions on this page up until it tells you to unmount root: http://archlinuxarm.org/platforms/armv7/samsung/samsung-chromebook-2

Dont unmount root yet. you need to run cp /lib/firmware/mrvl/* root/lib/firmware/mrvl

This copies the proper wireless drivers to your new installation (otherwise wireless will NOT work)

Now you can umount root and sync and reboot.

After rebooting, press Ctrl + u at the boot screen to boot to your SD card.

@bjodah
bjodah / .gitignore
Last active August 4, 2020 20:04
Script to compile symengine with memory sanitizer enabled.
mount_*/
environment_*/
output.log
@jalavik
jalavik / unicode_to_latex.py
Created May 17, 2011 11:04 — forked from beniwohli/unicode_to_latex.py
Map to convert unicode characters to their respective LaTeX representation
# original XML at http://www.w3.org/Math/characters/unicode.xml
# XSL for conversion: https://gist.github.com/798546
unicode_to_latex = {
u"\u0020": "\\space ",
u"\u0023": "\\#",
u"\u0024": "\\textdollar ",
u"\u0025": "\\%",
u"\u0026": "\\&",
@twlz0ne
twlz0ne / test-lsp-jdtls-installation.el
Created May 11, 2020 03:55
Test jdtls installation #Emacs #LSP
;;; test-lsp-jdtls-installation.el --- Test lsp jdtls installation -*- lexical-binding: t; -*-
;;; Date: 2020-05-11_09.12.50
;;; Usage:
;; ┌────
;; │ $ emacs -nw -Q -l \
;; │ --eval '(setq with-proxy-http-server "127.0.0.1:XXXX")' \
;; │ /path/to/test-lsp-jdtls-installation.el
;; └────
(toggle-debug-on-error)
(setq user-emacs-directory (format "~/.emacs.d/%s/%s/" (file-name-base load-file-name) emacs-version))
@piyushrpt
piyushrpt / customfeedstock.md
Last active October 21, 2021 20:17
Setting up custom conda feedstock
@karlrohe
karlrohe / PCA_on_handwritten_2s.R
Created January 7, 2022 22:48
PCA on mnist handwritten 2's
# PCA on n=6990 images of handwritten 2's, each with d = 784 pixels.
# install.packages("remotes")
# remotes::install_github("jlmelville/snedata")
# thank you jlmelville for making this data so easy to access!
library(snedata)
library(magrittr)
library(Matrix)
library(rARPACK)
@bjodah
bjodah / gist:bf554c4eb6d75837c00b4ec01991da05
Last active April 11, 2022 11:48
Using emacs under windows
1. Install msys2 from msys2.org
2. run msys2.exe: pacman -Syu, restart, pacman -Su
3. run mingw64.exe: pamcan -S mingw-w64-x86_64-emacs
4. create C:\msys2_64\runemacs_patched_path.bat:
cmd /C "set PATH=C:\msys2_64\mingw64\bin;C:\msys2_64\usr\bin;%PATH% && C:\msys2_64\mingw64\bin\runemacs.exe --daemon"
5. Super-R shell:startup [RET]
6. Create shortcut to runemacs_patched_path.bat, call it e.g. "emacs-daemon"
7. Create a short-cut in Start menu:
C:\msys2_64\mingw64\bin\emacsclientw.exe -c -n -a "C:\msys2_64\mingw64\bin\runemacs.exe"
// Commented version of https://twitter.com/zozuar/status/1441384708441456651
// Google-translated (with some editing) from @gam0022's version
float i, // Ray marching loop counter
e, // Volume density (the smaller the value, the higher the density)
s, // FBM scale (and loop counter)
g, // Ray's distance (also used for tunnel twirl and camera prespective)
k = .01; // Handy constant
// Ray marching loop
@dhermes
dhermes / .gitignore
Last active December 12, 2022 06:38
Remez Algorithm for log(x)
*.pyc
*.aux
*.log
*.out