Skip to content

Instantly share code, notes, and snippets.

View mythmon's full-sized avatar

Michael Cooper mythmon

View GitHub Profile
@mythmon
mythmon / gist:9086593
Created February 19, 2014 05:36
Keybase.io proof
### Keybase proof
I hereby claim:
* I am mythmon on github.
* I am mythmon (https://keybase.io/mythmon) on keybase.
* I have the public key with fingerprint DAFE 0A2F 0B02 90B5 7AC3  5186 CD8D 37A4 6031 DC1C
To claim this, I am signing this object:
@mythmon
mythmon / netfox.sh
Created February 27, 2014 18:53
This is what I used when I was at the OSL to shut down Firefox on remote systems with a NFS homedir.
#!/bin/bash
HN=`hostname -f`
echo hostname set to $HN
if test -e ~/.mozilla/firefox/lock_host ; then
LM=`cat ~/.mozilla/firefox/lock_host`
echo Firefox has taken a lock out on the following machine:
cat ~/.mozilla/firefox/lock_host
if [ "$LM" = "$HN" ] ; then
echo Running a repeat firefox
@mythmon
mythmon / .XCompose
Created March 17, 2014 02:21
~/.XCompose
# Greek
<Multi_key> <g> <a> : "α" U03B1 # GREEK SMALL LETTER ALPHA
<Multi_key> <g> <A> : "Α" U0391 # GREEK CAPITAL LETTER ALPHA
<Multi_key> <g> <b> : "β" U03B2 # GREEK SMALL LETTER BETA
<Multi_key> <g> <B> : "Β" U0392 # GREEK CAPITAL LETTER BETA
<Multi_key> <g> <g> : "γ" U03B3 # GREEK SMALL LETTER GAMMA
<Multi_key> <g> <G> : "Γ" U0393 # GREEK CAPITAL LETTER GAMMA
<Multi_key> <g> <d> : "δ" U03B4 # GREEK SMALL LETTER DELTA
<Multi_key> <g> <D> : "Δ" U0394 # GREEK CAPITAL LETTER DELTA
import readline
import rlcompleter
readline.parse_and_bind("tab: complete")
@mythmon
mythmon / counter_tuples.ipynb
Last active August 29, 2015 13:58
Counters and Tuples in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mythmon
mythmon / callback.js
Last active August 29, 2015 14:00 — forked from nobane/callback.js
function display_obj(obj, category) {
var url = "/" + category + "/" + obj.val();
return new Promise(function(resolve, reject) {
$.get(url, function(resp) {
var rows = "";
for (var key in resp) {
console.log("Generating pairs[" + key + "]: " + resp[key]);
rows += generate_row(key, resp[key]);
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mythmon
mythmon / 01 main.mt
Last active August 29, 2015 14:00
This is some crazy ideas about Monte modules. I don't think you're going to like this. (the numbers are just to control the Gist's order)
# This is a file that doesn't define any modules, and has one thing that is a
# main function. Clearly this is meant to run in the IO scope, and the IO scope
# by default will execute a function named main in the file it executes.
fn main():
# addModules is a configuration step that is only available in IO scope.
# It could be in a separate configuration, or inline as it is here. It
# defines modules, the sums they should match (or the special value
# `M.linker.any`, which allows for any content), and the file path that
export AUTO_VENV_LAST_DIR=""
chpwd_auto_venv () {
dir=$(pwd)
last=""
while true; do
if [[ -f $dir/.venv ]]; then
if [[ $dir = $AUTO_VENV_LAST_DIR ]]; then
return 0
@mythmon
mythmon / 00_intro.md
Created May 2, 2014 20:32
My video screenshot scripts
  1. Install recordmydesktop. I found this in Arch's Community repo. There are GTK and QT versions, but neither of them were useful for me.
  2. Compile xrectsel.c and put it on your path. This is used to select a screen region to record.
  3. Get dropbox-cli. I found this in the AUR. This is how the script gets the URL to share.
  4. Run record.sh. It should let you select a region of your screen, and then it will immediately start recording.
  5. When you are done recording, press Ctrl+Alt+S. This is the default stop key for recordmydesktop. It is probably customizable, but I couldn't figure it out.
  6. The script will print the public sharable url of your recording to stdout, and also put it on your clipboard.
  7. The script will use notify-send to notify you that the URL is on your clipboard. This is useful if you run the script from a keybinding or a launcher (I use dmenu). I use notify-osd-customizable to get notifications from send-notify.

This generates .ogv files. Chrome and Firefox can both play this out