Skip to content

Instantly share code, notes, and snippets.

View sminez's full-sized avatar

Innes Anderson-Morrison sminez

View GitHub Profile
@sminez
sminez / loggly_query.py
Created August 22, 2016 14:28
Query loggly from the command line: (argparser seems to cause 500s for some reason but calling from a repl works fine!)
import requests
import argparse
def print_dict(d, level=0):
'''
Convert a python dict to a pretty-print string.
Supports strings, nested dicts and lists as values.
'''
new_level = level + 1
@sminez
sminez / .vimrc
Created October 21, 2016 15:00
My Current .vimrc
"============================================================================
" .: I.D.A-M .vimrc :.
" --------------------
" I've tried to keep this in some sort of sane order with similar functionality
" being grouped together and a _lot_ of comments to explain what everything
" does!
" I'm also using my .vimrc as a place to keep notes on useful tips and tricks
" as and when I find them. (http://www.vimbits.com & http://vimawesome.com ftw!)
"
@sminez
sminez / datools.py
Created October 11, 2017 13:47
Data manipulation tools
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
DEFAULT_CMAP = 'RdYlBu_r'
def show_missing_data(df, cmap=DEFAULT_CMAP):
'''
@sminez
sminez / dots
Last active November 4, 2017 19:44
Dotfile manager script
#! /bin/bash
# ----------
# Initialise and manage your dotfiles using a ~/.dots repo
# restore using `git clone --bare <remote-repo>`
dot_dir=".dots"
dot_dot_file=".my-dots"
_dots="git --git-dir=$HOME/$dot_dir/ --work-tree=$HOME"
extra_args=""
add_remote=false
@sminez
sminez / bootstrap.sh
Last active January 26, 2018 22:33
Bootstrap new environments
#! /bin/bash
# ----------
# Bootstrap a new environment using my preferred packages
# curl -L curl -L https://gist.githubusercontent.com/sminez/2a0bce386ad106f33d2ebf9a003dce75/raw/044cbc55779f1013a111fc42cfb4b76fb638aed4/bootstrap.sh
echo "Bootstrapping the environment"
echo "Anything and everything that can be apt-get installed!"
sudo apt-get install -y software-properties-common
echo "NeoVim official PPA"
sudo add-apt-repository ppa:neovim-ppa/stable
@sminez
sminez / keybase.md
Created November 7, 2018 11:42
keybase.md

Keybase proof

I hereby claim:

  • I am sminez on github.
  • I am idam (https://keybase.io/idam) on keybase.
  • I have a public key ASAKykKLjc8yWMY51k2SnCGRpSpQytrLXqQEWyogLTQMUwo

To claim this, I am signing this object:

@sminez
sminez / get_ippsec_details.py
Last active June 5, 2024 12:10
Find examples of pen testing methods and tools in videos by Ippsec (as of 22nd January 2020)
#!/usr/bin/env python3
"""
Script used to pull down the current video descriptions from ippsec's youtube channel.
The raw output still has a few HTML tags that need to be manually removed and there
also seem to be multiple duplicates of videos that have been removed in the output
saved as ippsec-details.txt
"""
import re
import sys
@sminez
sminez / simple-prompt.zsh
Created July 8, 2019 21:19
My simple ZSH prompt
#!/usr/bin/env zsh
GIT_AHEAD="⇡"
GIT_BEHIND="⇣"
PROMPT_CHAR="$"
SEPARATOR=" "
# Specific color vars
COLOR=003
COLOR_SUDO=005
@sminez
sminez / inverse_fours.rs
Last active April 14, 2020 08:21
checking inverses with arthroprod
//! See https://github.com/sminez/arthroprod for the main library
//! This program was written at the following hash: 05237efac5f49abb935a0dd62cbbd88b31759c5d
//! No further crates are required
#[macro_use]
extern crate arthroprod;
use std::collections::HashSet;
use arthroprod::algebra::operations::{full, AR};
use arthroprod::algebra::types::{Form, MultiVector};
'''
Checking alternative dice probabilities for Ironsworn
'''
from collections import defaultdict
import json
MODIFIERS = [0, 1, 2, 3, 4]
STRONG = "strong hit"
WEAK = "weak hit"
MISS = "miss"