Skip to content

Instantly share code, notes, and snippets.

View JasonThomasData's full-sized avatar
🐓
cluck cluck

Jason Thomas JasonThomasData

🐓
cluck cluck
View GitHub Profile
#!/usr/bin/env bash
# For proving you have issues with your ISP. You would see the packets stop at their IPaddress in that case.
# Use a crontab like:
# * * * * * /home/john/RECORD_TRACEROUTE.sh
# The above will save it every minute
PATH=/home/john/TRACEROUTE/
FILENAME=$(/bin/date +%A_%d_%m)
FILEPATH=$PATH$FILENAME
#!/usr/bin/env bash
############################################
## This program converts a directory of .NEF images to jpeg, png or TIFF format.
## It also resizes the images
##
## Examples:
## ./FILENAME FORMAT WIDTH_RESIZE
## ./batchConvertNEF.sh png 500
## ./batchConvertNEF.sh jpeg
@JasonThomasData
JasonThomasData / R_functions.R
Created August 4, 2020 01:46
Functions I will need in R
standardNegationInRange = function(selection) {
#x_{n}=x_{max}-x_{n}+x_{min}
return (max(selection) - selection + min(selection))
}
featureScale = function(selection) {
#x_{n}=\frac{x_{n}\text{−}x_{min}}{x_{max}\text{−}x_{min}}
return ((selection - min(selection))/(max(selection) - min(selection)))
}
OPTIONS=msg_window:reversed
OPTIONS=showexp,showscore,time,color
OPTIONS=suppress_alert:3.4.3
OPTIONS=disclose:+i +a -v -g +c +o
OPTIONS=lit_corridor
OPTIONS=IBMgraphics
#OPTIONS=autodig,fruit:slime mold,boulder:0
OPTIONS=autopickup
OPTIONS=pickup_types:$
@JasonThomasData
JasonThomasData / .config nvim init.vim
Created September 5, 2019 00:34
Config file for nvim, much smaller than a .vimrc with the same functionality
"////////////////////////////
"// Vim settings
"// No plugins needed ...
set number "Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
"set spell " Enable spell-checking
alias checkDNS="( nmcli dev list || nmcli dev show ) 2>/dev/null | grep DNS && echo 'Do this:' && echo 'nmcli con mod <devicename> ipv4.dns \"208.67.222.222 208.67.220.220\" && systemctl restart network-manager.service' && echo 'Do - \"nmcli c\" to get device name.'"
alias uuid="python3 -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)' | pbcopy && pbpaste && echo"
alias kp="keepass2 ~/keepass/passwords.kdbx"
alias clearTmp="sudo rm -r /tmp/*"
alias ls="ls -F --color=auto"
alias vim="vim -c :Vex"
alias nvim="nvim -c :Vex"
alias ct="ctags -R ."
alias brightness="xrandr --output eDP-1 --brightness"
alias hl="highlight --force"
@JasonThomasData
JasonThomasData / key_press.cpp
Last active February 9, 2018 11:13
Linux terminal program will let you enter keys without pressing `enter`
/* I took the code at www.flipcode.com/archives/_kbhit_for_linux.shtml and refactored it to suit my needs.
* Usually a terminal program will have an input buffer and will wait until it finds a carriage return (enter) to process the buffer.
* This code allows you to enter keys without pressing enter, and is useful for a robot project of mine (to give the robot instructions without pressing enter).
*
* This is tested and working on Linux (Arch, Mint) and Mac osx.
*
* g++ -std=c++14 key_press.cpp -o key_press
*/
#include <iostream>
@JasonThomasData
JasonThomasData / .vimrc
Last active April 30, 2019 04:54
My .vimrc - putting this here so it's easy to grab
"////////////////////////////
"// Vim settings
"// No plugins needed ...
set number "Show line numbers
set linebreak " Break lines at word (requires Wrap lines)
set showbreak=+++ " Wrap-broken line prefix
set textwidth=100 " Line wrap (number of cols)
set showmatch " Highlight matching brace
"set spell " Enable spell-checking
Homicide by gun deaths per 100,000 people
From this report - http://jama.jamanetwork.com/article.aspx?articleid=2530362
Date,Rate
1979-01-01,0.75
1980-01-01,0.65
1981-01-01,0.55
1982-01-01,0.73
1983-01-01,0.55
1984-01-01,0.77
This is the data used for SBS' article on gender diversity of candidates at the 2016 federal election
Women as a percentage of candidates in the House of Representatives, 1983 - 2016
Date,%female
1983-01-01,17
1984-01-01,17.4
1987-01-01,17.8
1990-01-01,17.8
1993-01-01,23.6
1996-01-01,27.9