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
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"
#!/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
@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
@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>
This data was provided to SBS by the Australian Shark Attack file in 2015, for the former 20 years.
This is not the same data as on the file, as incidents need to meet certain criteria to be included there.
2015 data - https://taronga.org.au/conservation/conservation-science-research/australian-shark-attack-file/2015
Day,Month,Year,Recovery Status,State,Location,Shark Common Name,Provoked,# of Sharks,Sex,Time of Attack,Victims Activity,Wounds Sustained,Provocative Act
1,2,1995,UNINJURED,VIC,"SEAL ROCKS, PHILLIP ISLAND",Sevengill Shark,Provoked,1,M,730,SCUBA DIVER,UNINJURED,COLECTING CRAYFISH
27,2,1995,INJURED,SA,"BOOMER BEACH, PORT ELLIOT",Wobbegong,Unprovoked,1,M,,SURFING ON BOARD,MINOR TEETH MARKS,
11,3,1995,INJURED,SA,CACTUS BEACH,White Shark,Unprovoked,1,M,730,SURFING ON BOARD,MINOR INJURY - STITCHES,
21,3,1995,UNINJURED,NSW,"CLARK ISLAND, SYDNEY HARBOUR",Bull Shark,Unprovoked,1,F,700,BOAT - SURF SKI,UNINJURED,
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