Skip to content

Instantly share code, notes, and snippets.

View auxiliary's full-sized avatar

Mohammad (Moa) Raji auxiliary

View GitHub Profile
@auxiliary
auxiliary / .bashrc-for-tmux
Created July 29, 2019 15:53
Always connect to same tmux session
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
tmux attach-session -t $(hostname) || tmux new-session -s $(hostname)
fi
@auxiliary
auxiliary / .tmux.conf
Last active February 5, 2020 20:36
My tmux configurations
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind \ split-window -h
bind - split-window -v
unbind '"'
unbind %
@auxiliary
auxiliary / video.json
Created August 10, 2018 14:49
Tapestry Hypervideo
{
"keyframe0": {
"rotation": [
0.2955272102560261,
0.28095008733329574,
0.9130885589173175,
0.31921172384826174,
0.8718056325413622,
-0.37156266554509537,
-0.9004263120078797,
@auxiliary
auxiliary / browser.py
Last active July 23, 2018 04:22
Simple headless browser test for Tapestry
#!/usr/bin/env python3
import sys
import json
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
if __name__ == '__main__':
options = webdriver.ChromeOptions()
options.add_argument('--no-sandbox')
@auxiliary
auxiliary / what_is_going_on.py
Last active June 21, 2018 15:51
Get a dependency graph of the scripts in a directory
#!/usr/bin/env python3
import os
import sys
import networkx as nx
from networkx.drawing.nx_pydot import write_dot
filename = sys.argv[1] if len(sys.argv) > 1 else "output.dot"
FILE_SIZE_LIMIT = 5 * 1024 * 1024 # bytes
@auxiliary
auxiliary / rename.sh
Last active February 28, 2018 16:05
Rename all files sequentially to numbers
#!/bin/bash
if [[ "$#" -ne 1 ]]; then
echo "Usage: ./rename.sh .<extension>";
echo "Example: ./rename.sh .png";
exit
fi
# Set file extension from outside
extension=$1
SAVEIFS=$IFS
@auxiliary
auxiliary / video.json
Created February 20, 2018 18:49
Tapestry Hypervideo
{
"keyframe0": {
"rotation": [
0.7695927139035983,
0.012795847710104183,
-0.6384068616390914,
-0.18616210729443372,
0.9608611041412123,
-0.20515752083759037,
0.6107951575726431,
@auxiliary
auxiliary / IEEEtran.cls
Last active February 6, 2018 16:54
IEEEtran.cls with support for listing's belowcaptionskip
%%
%% IEEEtran.cls 2015/08/26 version V1.8b
%%
%% This is the IEEEtran LaTeX class for authors of the Institute of
%% Electrical and Electronics Engineers (IEEE) Transactions journals and
%% conferences.
%%
%% Support sites:
%% http://www.michaelshell.org/tex/ieeetran/
%% http://www.ctan.org/pkg/ieeetran
@auxiliary
auxiliary / debug.py
Last active December 9, 2017 04:23
Catch exceptions anywhere and open the bpython interpreter
import os
import sys
import traceback
import code
import bpython
def print_banner():
message = "Select a frame to view using the select(<frame #>) command"
print '\n\x1b[0;34;40m' + message + '\x1b[0m'
message = "Reload the script using the reload() command"
@auxiliary
auxiliary / mdiff.sh
Created September 9, 2017 22:32
Better diff for comparing directories (compares file dates)
#!/bin/bash
# Better diff for directories
if [ "$#" -ne 2 ]; then
echo -e "Usage:\t./mdiff.sh <dir1> <dir2>";
exit -1;
fi;
dir1=$1