Skip to content

Instantly share code, notes, and snippets.

View ananthp's full-sized avatar

Ananth Pattabiraman ananthp

View GitHub Profile
@ananthp
ananthp / midi-note-frequency.md
Last active January 12, 2021 15:26
midi-note-frequency
Midi Note    Frequency
  0. C -1        8.18 Hz
  1. C#-1        8.66 Hz
  2. D -1        9.18 Hz
  3. D#-1        9.72 Hz
  4. E -1       10.30 Hz
  5. F -1       10.91 Hz
  6. F#-1       11.56 Hz
  7. G -1       12.25 Hz
@ananthp
ananthp / letter-spacing.svg
Created September 8, 2019 13:17
SVG Letter Spacing
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ananthp
ananthp / multiple_match.rs
Created September 6, 2018 15:37
Rust Experiments
fn main() {
let a = 12;
let message = match a { // what if multiple arms can be matched?
0 => "zero",
1...5 => "one to five",
x if x > 10 => ">10",
x if x < 20 => "<20",
_ =>"n/a"
};
@ananthp
ananthp / ubuntu_18_04_input_devices_dont_work_after_logout.log
Created June 12, 2018 16:25
Ubuntu 18.04 LTS bug: Input devices stop working after logout or switch-user
# HP-G42 laptop
# Ubuntu 18.04 LTS
# kernel: 4.15.0-23-lowlatency #25-Ubuntu SMP PREEMPT Wed May 23 20:39:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
#
# excerpts from `journalctl`
Jun 12 20:39:00 hp_g42 /usr/lib/gdm3/gdm-x-session[1164]: (WW) modeset(0): flip queue failed: Permission denied
Jun 12 20:39:00 hp_g42 /usr/lib/gdm3/gdm-x-session[1164]: (WW) modeset(0): Page flip failed: Permission denied
Jun 12 20:39:00 hp_g42 /usr/lib/gdm3/gdm-x-session[1164]: (EE) modeset(0): present flip failed
-------------------------------------------------- after clicking logout --------------------------------------------------
conda update --all

WARNING conda.core.link:run_script(516): pre-unlink script failed for package conda-forge::widgetsnbextension-3.0.8-py36_0 consider notifying the package maintainer

@ananthp
ananthp / symbols_expr.py
Last active November 28, 2017 12:23
sympy: Symbols and their expressions
# using a symbol and associated expression in sympy
from sympy import *
init_printing()
i, L = symbols('i, L')
s_beta = symbols('beta')
e_beta = i * pi / L
Eq(s_beta, e_beta)
@ananthp
ananthp / sympy_rich_symbols.py
Last active November 28, 2017 11:43
sympy: Creating rich symbols
# Creating rich symbols with sympy
# Run this code on Sympy Live: http://bit.ly/rich-symbols
from sympy import *
init_printing()
# sympy.abc defines all greek alphabets.
# Even otherwise, when we create a symbol like alpha, beta etc,
# we get a nice greek alphabet representation with init_printing
alpha = symbols('alpha')
@ananthp
ananthp / gist:8a1f33c49b256b3c069f
Last active August 29, 2015 14:03
Stuff on top of windows

Basics

  • Firefox. Sync
  • Chrome. Sync
  • MSOffice / LibreOffice
  • GVim / Notepad++

Audio

  • Reaper
@ananthp
ananthp / stuff_on_top_of_ubuntu.markdown
Last active August 29, 2018 17:17 — forked from rpattabi/stuff_on_top_of_ubuntu.md
Stuff On Top of Ubuntu

Stuff to install or setup on top of default ubuntu installation

Launcher Shortcuts

Remove libre office. Add ..

  • Update Manager
  • System Monitor
  • Terminal
@ananthp
ananthp / gist:3411789
Created August 21, 2012 05:00
All about "Su(r)li"