Skip to content

Instantly share code, notes, and snippets.

@ixxra
ixxra / configure-touchpad.py
Created January 12, 2019 15:20
Enable tapping without a desktop environment
#!/usr/bin/env python
import subprocess
import re
XINPUT = "xinput list"
ID_RE = "id=([0-9]+)"
TAPPING_ENABLE_COMMAND = "libinput Tapping Enabled"
@ixxra
ixxra / auctex-synctex-evince.el
Created September 15, 2018 21:14 — forked from dandrake/auctex-synctex-evince.el
Make AUCTeX do forward and inverse search with SyncTeX and Evince
;; This is originally from
;; http://ubuntuforums.org/showthread.php?s=618526e60dfcf25e6413439603fa08ad&t=1716268&page=2.
;; Thanks to user "florenzen". I've included the fixes for Ubuntu 11.10
;; and wrapped buffer-file-name in a call to file-truename because
;; kpathsea/SyncTeX follow symlinks; see
;; http://tex.stackexchange.com/questions/25578/why-is-synctex-in-tl-2011-so-fussy-about-filenames.
;; Forward/inverse search with evince using D-bus.
(if (require 'dbus "dbus" t)
(progn
@ixxra
ixxra / sogood-mid.sh
Created September 10, 2018 11:58
Listen to So Good - Mérida México radio station
#!/bin/bash
# Listen to So Good 92.1 FM Merida Mexico
# http://gruporivas.com.mx/sogood/
exec mpv --no-ytdl http://s4.mexside.net:8090
@ixxra
ixxra / volume.sh
Created July 29, 2018 17:59 — forked from sebastiencs/volume.sh
Script to get volume notification with dunst http://imgur.com/a/qWgAw
#!/bin/bash
# You can call this script like this:
# $./volume.sh up
# $./volume.sh down
# $./volume.sh mute
function get_volume {
amixer get Master | grep '%' | head -n 1 | cut -d '[' -f 2 | cut -d '%' -f 1
}
@ixxra
ixxra / HUD.py
Created July 20, 2018 23:59 — forked from snippins/HUD.py
HUD Menu
#!/usr/bin/env python3
import gi
gi.require_version("Gtk", "3.0")
import dbus
import psutil
import subprocess
from Xlib import display, protocol, X
import time
@ixxra
ixxra / latex-custom-match-command.el
Created June 13, 2018 00:17
How to highlight a custom command in emacs with auctex
;; Reference: https://www.flannaghan.com/2013/01/09/command-highlight
;;This option will hightlight the content inside the parens
(setq font-latex-user-keyword-classes
'(("my-warning-commands"
(("fixme" "{"))
(:background "red" :foreground "black")
command)))
@ixxra
ixxra / mpvctl
Created May 10, 2018 15:07 — forked from dwgill/mpvctl
A small script for controlling mpv via the JSON IPC. Intended to resemble playerctl.
#!/usr/bin/env bash
# This script requires:
# - that the directory $HOME/.mpv exist
# - that the program socat be installed
# - that you start mpv with the unix socket feature pointing at that directory
# I recommend an alias in your .bashrc or equivalent file:
# alias mpv="mpv --input-unix-socket=$HOME/.mpv/socket"
socket="$HOME/.mpv/socket"
@ixxra
ixxra / calendar.css
Created August 27, 2017 00:54 — forked from evaldas-raisutis/calendar.css
Responsive html calendar with javascript
#calendar {
margin-top:5em;
width: 100%;
}
#month {
text-align:center;
text-transform:uppercase;
}
@ixxra
ixxra / finite-differences.py
Created December 5, 2014 18:33
Finite differences ode
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 5 11:48:36 2014
@author: isra
"""
from __future__ import division
from scipy import sparse
from scipy.sparse.linalg import spsolve
import numpy as np
@ixxra
ixxra / denoising.py
Created December 5, 2014 17:08
See "Nonlinear total variation based noise removal algorithms" by Rudin, Osherand, Fatemi
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 5 07:49:22 2014
@author: isra
"""
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt