Skip to content

Instantly share code, notes, and snippets.

@tusing
tusing / README.md
Created December 18, 2020 19:40 — forked from jamesmacfie/README.md
iTerm 2 - script to change theme depending on Mac OS dark mode

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@tusing
tusing / .vimrc
Created May 4, 2020 21:26
Dotfiles
" ========== INSTALLATION ==========
" 1. git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" 2. Move this file to ~/.vimrc
" 3. Run :PluginInstall from vim
" 4. Remember that /etc/vim/vimrc has priority!
" ----------------------------------
set laststatus=2 " Always show statusline
set t_Co=256 " 256 colors
@tusing
tusing / keybase.md
Created April 4, 2019 23:15
keybase.md

Keybase proof

I hereby claim:

  • I am tusing on github.
  • I am tusing (https://keybase.io/tusing) on keybase.
  • I have a public key ASCAb-us2xA-CQ3PHx1zRln-Yor5MKqk1HJejYTfJaPcSQo

To claim this, I am signing this object:

@tusing
tusing / random_mental.py
Last active March 30, 2018 19:06
Mental-math random number
"""
by tusing
MOTIVATION:
Wanted a fast way to come up with reasonably pseudo-random numbers mentally.
Humans have a bias when guessing numbers: we tend to guess 7 and 17 most often:
http://scienceblogs.com/cognitivedaily/2007/02/05/is-17-the-most-random-number/
ALGORITHM:
1. Start with a seed (1). The seed serves to "balance" our output distribution,
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@tusing
tusing / loop.py
Last active October 1, 2017 01:40
import moviepy.editor as mpy
from moviepy.video.tools.cuts import FramesMatches
import argparse
import dill
import glob
from multiprocessing import Process
def main():
parser = argparse.ArgumentParser(description='Find GIF loops in a video')
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDKTLsyylwwytA+b33+3jSF0abp6IXwrkAzNRhEY/UvVrsJqpFvUYR5i/U8Dmo/CSF4PorrhRq9W2IGZTq06WVOf+iPmZRNo4mkYuu0td/yaMnWllooE0oqqu3ky9XaUF9pnxGLTg//LpaSwsxeM7HP9DEYb0cvewGklG5eSGcNxlZSr9b7KNtjyTIdvwv8gpEFctievsJA/rtPSz5E5FY3rTOZm5aElaebXCjGCiMAMZXUDOLl0UdJhBqJGCytWALQgW1641ncdVA5P/SLamXGY+1mbzX5gOZ08Ue0N9RKUoSHIIud2El/h6DKk5MT6qJmLV4kEjR5PvIJdq0Hm3TD tusing
@tusing
tusing / .bashrc
Created September 23, 2017 11:28
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@tusing
tusing / loggingMain.go
Last active July 4, 2017 08:23
Go logging boilerplate
package main
import (
"flag"
"github.com/op/go-logging"
"os"
)
func makeLogger(name string, minLevel logging.Level) logging.Logger {
log := logging.MustGetLogger(name)
" WARNING: Remember that /etc/vim/vimrc has priority!
set laststatus=2 " Always show statusline
set t_Co=256 " 256 colors
" ======== VUNDLE SETTINGS =========
" ---------- VUNDLE START ----------
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim