Skip to content

Instantly share code, notes, and snippets.

Avatar

Blake Kus kus

  • Google
  • Sydney, Australia
View GitHub Profile
@kus
kus / steam-games-hours-played.js
Last active Nov 1, 2019
Find out Steam games hour played grouped
View steam-games-hours-played.js
// Open https://steamcommunity.com/my/games/?tab=all and make sure you are logged in to Steam.
// Open your browsers console (Ctrl + Shift + J on Chrome or Ctrl + Shift + K on Firefox)
// and paste all of this code (select all) in the text box (bottom) and hit enter
// If you get an error from the script you likely aren't running a modern browser
// you can paste the code here https://babeljs.io/repl and copy the output and run that.
(() => {
const SHOW_TOP_GAMES = 5;
const RE_HOURS = /^[0-9.,]+/;
const RE_CLEAN_HOURS = /[^0-9.]+/g;
let totalHours = 0;
@kus
kus / steam-csgo-key-history.js
Last active Jun 10, 2020
Find out how much you have spent on CS:GO keys
View steam-csgo-key-history.js
// Open https://store.steampowered.com/account/history and make sure you are logged in to Steam.
// Scroll to the bottom and load all history.
// Open your browsers console (Ctrl + Shift + J on Chrome or Ctrl + Shift + K on Firefox)
// and paste all of this code (select all) in the text box (bottom) and hit enter
// If you get an error from the script you likely aren't running a modern browser
// you can paste the code here https://babeljs.io/repl and copy the output and run that.
(() => {
const HISTORY_URL = 'https://store.steampowered.com/account/history';
// English and Cyrillic alphabet
const CURRENCY_REGEXP = /([A-Za-z\u0400-\u04FF]+)?([^0-9]{1})?([0-9.]+)([A-Za-z€¥\$£\u0400-\u04FF\.]+)?/;
@kus
kus / practice.cfg
Last active Jan 15, 2019
CS:GO grenade/recoil practice on a remote server with rcon
View practice.cfg
// Setup server
rcon sv_cheats 1 // Enable cheats
rcon mp_limitteams 0 // Allow team stacking
rcon mp_autoteambalance 0 // Disable auto team balance
rcon mp_roundtime 60 // Set round time to 60 minutes
rcon mp_roundtime_defuse 60 // Set defuse time to 60 minutes
rcon mp_maxmoney 60000 // Set maximum money to be $60,000
rcon mp_startmoney 60000 // Start with $60,000 money
rcon mp_freezetime 0 // No freezetime
rcon mp_buytime 9999 // Unlimited buytime
@kus
kus / windows-setup.md
Last active Jun 10, 2020
Get a clean Windows up and running as a gaming and developer PC.
View windows-setup.md

Install Chocolatey

Open Command Prompt as Administrator (right click > Run as administrator)

Paste into Command Prompt and hit enter:

@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

When complete, install packages:

choco install -y chocolateygui dropbox googlechrome adobereader jre8 python2 7zip geforce-experience vlc ccleaner malwarebytes dropbox steam epicgameslauncher origin battle.net discord spotify slack whatsapp evernote beyondcompare handbrake sourcetree vscode nodejs yarn git mongodb ffmpeg imagemagick blender

@kus
kus / osx-setup.md
Last active Jul 4, 2019
Get a clean Mac OSX up and running as a developer machine.
View osx-setup.md

Install Xcode:

(To get around certain build tools that actually require Xcode and not the cli tools)

From the App Store

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -license
@kus
kus / comp.cfg
Last active Oct 15, 2020
CS:GO Private Competitive Game with death cam and GOTV demo
View comp.cfg
// Kus' CS:GO Private Competitive Game with death cam and GOTV demo config
// Source: https://gist.github.com/kus/d4bf1d28dc832d6fb98a047aedb9fb4c
// Copy to C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg
// To record GOTV demo 'tv_record name' and it will be saved to C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\name.dem
// Which you can watch by opening console anywhere in CS:GO and type 'playdemo name' and hit enter
echo "How to host a CS:GO Private Competitive Game:"
echo " - Make a private casual lobby and invite everyone
echo " - BEFORE you start the game open console and run 'exec comp' to enable GOTV for death cam and recording the game"
@kus
kus / localhost-https.md
Last active Sep 18, 2019
Local HTTPS server, generate SSL certificate
View localhost-https.md

Chrome has decided that what they deem powerful web platform features such as Geolocation, Device motion / orientation, getUserMedia etc can no longer run on "Insecure Origins", HTTP (non-HTTPS) being one of them. Read more

So if you want to use these features in development and you are testing on a mobile via the IP of your computer, you now need to be serving the content over HTTPS for it to work.

Generate local SSL certificate

First check if you need to install openssl with which openssl. If nothing comes up run brew install openssl to install openssl with Brew.

openssl genrsa -des3 -passout pass:x -out localhost.pass.key 2048
openssl rsa -passin pass:x -in localhost.pass.key -out localhost.key
View kodi-android-setup.txt
Connect to network
Open Kodi
Let it download updates (first time)
Select SYSTEM > File Manager > Add Source
Select <None> and enter "http://fusion.tvaddons.ag" (without quotes) and select Done
Highlight the box at the bottom and enter "Fusion" (without quotes) and select Done
Select OK
Go back to Kodi Home Screen
Select SYSTEM > Add-ons > Install from zip file > Fusion > kodi-repos > english
Scroll down and select repository.exodus-x.x.x.zip
@kus
kus / autoexec.cfg
Last active Apr 29, 2020
Kus CS:GO Config
View autoexec.cfg
// Place in C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive\csgo\cfg\autoexec.cfg
// To get your existing binds find your config at C:\Program Files (x86)\Steam\userdata\<steamID3>\730\local\cfg\config.cfg
// Launch options
// https://steamcommunity.com/sharedfiles/filedetails/?id=379782151
// -novid -tickrate 128 -high -nojoy +exec autoexec
con_enable "1" // Enable console
// Buy script
@kus
kus / convert-video.sh
Last active Dec 14, 2020
Convert any video (i.e.: AVI, MOV, MP4) to MP4 or WEBM with FFmpeg. Has option to export MP4 with YUV planar color space so it works with QuickTime and Safari.
View convert-video.sh
#!/bin/bash
# Version 1.0 2016-06-03 https://gist.github.com/kus/318f21b840df0b7a6377563ce717c184
# MIT license
# Prerequisites:
# Homebrew: http://brew.sh/
# Install FFmpeg via Homebrew: brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvpx --with-theora --with-libogg --with-libvorbis --with-opus --with-x265
# Make the script executable: sudo chmod u+x convert-video.sh
# Run: ./convert-video.sh