Skip to content

Instantly share code, notes, and snippets.

View BadgerCode's full-sized avatar
🦡

Michael Hawkins BadgerCode

🦡
View GitHub Profile
@BadgerCode
BadgerCode / 7zip-bzip2.ps1
Created May 7, 2020 18:45
Uses 7-zip CLI to compress files individually using BZIP2 on Windows
$path = "C:\Users\mike-\Downloads\stuff"
$7zipPath = "C:\Program Files\7-Zip\7z.exe"
$files = dir $path -Recurse -Include $mask | where {
($_.Length / 1KB) -gt 100
}
ForEach ($file in $files)
{
Write-Host "$($file.FullName).bz2"
@BadgerCode
BadgerCode / csv-reading-example.cs
Created May 6, 2020 08:51
Example of reading a CSV file in C# using the package CsvHelper
/* Install package CsvHelper */
public class Program
{
static async Task Main(string[] args)
{
var recipients = CSV.Read(@"C:\path\to\file.csv")
.Select(row =>
{
var name = row["Name"].ToString();
@BadgerCode
BadgerCode / playermodel_help_command.lua
Created April 10, 2020 01:23
Adds shortcuts for the player model selector
-- Allows players to press F3 or type !skin or !playermodel in chat to enter the player model selector
-- Where to put this file: garrysmod\addons\customscripts\lua\autorun\playermodel_help_command.lua
if SERVER then
AddCSLuaFile()
hook.Remove("PlayerSay", "PlayerModelHelpCommand")
hook.Add("PlayerSay", "PlayerModelHelpCommand", function(ply, text)
text = string.Trim(string.lower(text))
if(text != "!skin" and text != "!playermodel") then return end
@BadgerCode
BadgerCode / ttt_avalon_ttt.txt
Created April 10, 2020 00:40
Weapon spawns for ttt_avalon. Put this in your maps folder
# Trouble in Terrorist Town weapon/ammo placement overrides
# For map: ttt_avalon
# Exported by: Badger
setting: replacespawns 1
weapon_ttt_smokegrenade 330.175049 22.394024 1058.990356 0.271 0.922 5.115
weapon_ttt_smokegrenade 317.507202 23.520340 1059.205566 0.247 0.911 5.248
weapon_ttt_smokegrenade 330.451935 15.903018 1060.497437 23.486 22.608 92.846
weapon_ttt_smokegrenade 319.537628 -0.114263 1057.819824 -0.856 -0.399 5.146
weapon_ttt_smokegrenade 311.275513 2.415683 1058.006470 -1.376 -0.488 5.932
weapon_ttt_smokegrenade 298.350006 12.892310 1058.710938 -1.316 -0.461 5.786
@BadgerCode
BadgerCode / Twenty one pilots car radio virtual piano
Created April 4, 2020 16:30
Twenty one pilots car radio virtual piano
[qe] [qe] ||
[qe] [qe] [wr] [et] [et] [wr] [wr] ||
[qe] [qe] ||
[qe] [qe] [wr] [et] [et] [wr] [wr] u |
[qeu] [qeu] ||
[qeu] [qeu] [wru] [etu] [etu] [wru] [wru] y |
[qeu] [qeu] ||
[qeu] [qeu] [wru] [etu] [etu] [wru] [wru] y |
h G k f d h s a f p d ||
h G k f d h s a f p d |
d h d |
h G d |
G h d |
G h G f d fs |
G h G f d s ||
d
@BadgerCode
BadgerCode / minecraft c418 sweden virtualpiano
Last active April 4, 2020 15:18
The song Sweden by C418 from Minecraft for virtual piano. Repeat parts to your liking
[30w] $ [5ey] 7 [6e] 5 [2u] ||||
[30w] p a [5ey] 7 y u [6e] 5 I p [2u] ||||
[30wr] d a [5eyd] 7 G f [6e] 5 d S [2eup] ||||
[7ry] a p [30ru] u y [60e] y u [59wr] ||||
[7ry] a p [30ru] u f [60e] d G [59wr] ||||
@BadgerCode
BadgerCode / slack-themes
Last active April 2, 2020 14:00
Slack themes
Light theme
#ffffff,#d1faff,#e8e8e8,#000000,#e8e8e8,#000000,#000000,#00a0b5,#292929,#FFFFFF
Visual Studio Code dark theme
#252526,#d1faff,#094771,#FFFFFF,#2A2D2E,#CCCCCC,#007ACC,#BF0003,#333333,#CCCCCC
@BadgerCode
BadgerCode / webkit-gradient.html
Last active February 23, 2020 12:56
Example of using webkit's initial gradient property from 2008
<html>
<!-- https://webkit.org/blog/175/introducing-css-gradients/ -->
<!-- Example output- https://i.imgur.com/SKsn0Bo.png -->
<head>
<style>
.radial {
width: 150px;
height: 150px;
border: 2px solid black;
background: -webkit-gradient(radial, 45 45, 10, 52 50, 30, from(#A7D30C), to(rgba(1, 159, 98, 0)), color-stop(90%, #019F62)),
@BadgerCode
BadgerCode / ttt_force_role.lua
Last active August 24, 2019 23:02
Useful when developing Garry's Mod TTT addons. Allows anyone to force their TTT role.
-- Adds a console command "forcerole"
-- forcerole traitor your_name
-- forcerole detective your_name
-- forcerole innocent your_name
if CLIENT then
local function AutoComplete(cmd, stringargs)
local args = string.Split(stringargs, " ")
local suggestions = {}
local role = args[2]