Skip to content

Instantly share code, notes, and snippets.

View sodejm's full-sized avatar

Justin Soderberg sodejm

View GitHub Profile
@sodejm
sodejm / countLoC.ps1
Created February 7, 2018 17:45
Basic Powershell script to count lines of code, this probably isn't 100% accurate but works for my basic purposes
# .\countLOC.ps1 -path "C:\code\MyProject" -outputFile "C:\code\loc.csv" -include "*.cs" -exclude "*.designer.cs"
param([string]$path, [string]$outputFile, [string]$include = "*.*", [string]$exclude = "")
Clear-Host
Get-ChildItem -re -in $include -ex $exclude $path |
Foreach-Object { Write-Host "Counting $_.FullName"
$fileStats = Get-Content $_.FullName | Measure-Object -line
$linesInFile = $fileStats.Lines
"$_,$linesInFile" } | Out-File $outputFile -encoding "UTF8"
Write-Host "Complete"
# Author: sodejm
# Add to bash_profile as a quick way to list your US EC2 instances
# requires the aws-cli
# use: listusec2
# List all EC2 Instances for US regions
function listec2(){
for region in `aws ec2 describe-regions --filters "Name=endpoint,Values=*us*" --output text |
cut -f3`
do
@sodejm
sodejm / darkify_slack.sh
Created January 23, 2019 18:44 — forked from ryanpcmcquen/darkify_slack.sh
Darkify your Slack.
#!/bin/sh
# Darkify Slack on Mac OS:
# curl https://gist.githubusercontent.com/ryanpcmcquen/8a7ddc72460eca0dc1f2dc389674dde1/raw/darkify_slack.sh | sh
SLACK_INTEROP_JS="/Applications/Slack.app/Contents/Resources/app.asar.unpacked/src/static/ssb-interop.js"
# Thanks to: https://gist.github.com/DrewML/0acd2e389492e7d9d6be63386d75dd99#gistcomment-2358430
if [ -z "`grep tt__customCss ${SLACK_INTEROP_JS}`" ]; then
# Backup original CSS for reverts:
@sodejm
sodejm / black.css
Last active January 24, 2019 21:52
slack dark css
@-moz-document regexp("https://[^./]*\\.slack\\.com/(?!pricing)(?!security).*") { body { background: #222; color: #e6e6e6; }
a { color: #949494; }
a:link, a:visited { color: #949494; }
a:hover, a:active, a:focus { color: #c7c7c7; }
hr { border-bottom: 1px solid #424242; border-top: 1px solid #222; }
h1, h2, h3, h4 { color: #e6e6e6; }
h1 a { color: #e6e6e6; }
h1 a:active, h1 a:hover, h1 a:link, h1 a:visited { color: #e6e6e6; }
.bordered { border: 1px solid #363636; }
.top_border { border-top: 1px solid #363636; }

Triumph decided not to do paper manual anymore so here is a not so straight forward way of downloading the manual for offline use. This could all be scripted but I only own 1 bike and downloaded it once.

Also, fyi search doesn't work right now as I have not bothered to correct that code yet. Will update when that happens.

  1. Sign in an get a subscription to tritun.net
  2. Export your browsers tritun.net cookies to a netscape cookie file
  3. Find the document root from the portal and use the number in the following command

The following is for a 2020 Triumph T120