This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-AdventOfCodeInput { | |
| param( | |
| [Parameter(Mandatory)][string]$Year, | |
| [Parameter(Mandatory)][string]$Day, | |
| [Parameter(Mandatory)][string]$Session | |
| ) | |
| $S = [Microsoft.PowerShell.Commands.WebRequestSession]::new() | |
| $S.Cookies.Add([System.Net.Cookie]::new('session', $Session, '', 'adventofcode.com')) | |
| $Result = (Invoke-WebRequest https://adventofcode.com/$Year/day/$Day/input -WebSession $S) | |
| $Result.Content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # By AMathMonkey, 2022 | |
| # Depends on Tcl, Tk, Img, and ImageMagick! | |
| # Something really rough that I'm working on to practice GUI development. | |
| # A utility to look through a directory of images using the left and right arrow keys | |
| # then save any desired images to an output directory by pressing the space bar. | |
| # Takes 3 arguments - input directory, output directory, and optional index of image in input directory to open to (default is 0) | |
| # The title bar says the name of the current file and if it's saved to the output directory or not. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| =pod | |
| This is some boilerplate Perl code that I have been modifying and using to fix tags on my mp3s. | |
| In its current state, this code will take tracks that are titled like "[actual artist] - [title]" | |
| with the Artist field being Various Artists, and fix their Title and Artist fields, and set the | |
| Album Artist field to Various Artists. MP3::Tag doesn't support the Album Artist field by default, | |
| which is strange, so this file also adds this functionality to the library. | |
| =cut | |
| use strict; | |
| use warnings; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use text_io::read; | |
| use regex::Regex; | |
| use std::{io::{self, Write}, {fs::OpenOptions}, fmt}; | |
| const TRACKS: [&str; 6] = ["Coventry Cove", "Mount Mayhem", "Inferno Isle", "Sunset Sands", "Metro Madness", "Wicked Woods"]; | |
| const GREETING: &str = "BAR! Bonus Circuit IGT Calculator by AMathMonkey\n\ | |
| Input times in the format MSShh where M is minutes, SS is seconds and hh is hundredths\n\ | |
| Enter 'u' or 'undo' to undo\n"; | |
| struct Time { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/perl | |
| use v5.28.1; | |
| use strict; | |
| use warnings; | |
| use open qw/:std :utf8/; | |
| eval {require Win32::Console; Win32::Console::OutputCP(65001)}; | |
| my $CHAR_LIMIT = 2000; | |
| my $MESSAGE_DELIMITER = "-----------------\n\n"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| pieces = $1 | |
| height_in_units = $2 | |
| width_in_units = $3 | |
| area = height_in_units * width_in_units | |
| piece_area = area / pieces | |
| piece_side_length = sqrt(piece_area) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| BEGIN { | |
| tracks[1] = "Coventry Cove" | |
| tracks[2] = "Mount Mayhem" | |
| tracks[3] = "Inferno Isle" | |
| tracks[4] = "Sunset Sands" | |
| tracks[5] = "Metro Madness" | |
| tracks[6] = "Wicked Woods" | |
| print "BAR! Bonus Circuit IGT Calculator by AMathMonkey\n" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| from os import path, getcwd | |
| import sys | |
| CWD = getcwd() | |
| CHAR_LIMIT = 2000 # Discord char limit per message | |
| OUTPUT_FILE_NAME = "split-output.txt" | |
| MESSAGE_DELIMITER = "-----------------\n\n" | |
| filepath = "message.txt" # Default argument |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sets | |
| import algorithm | |
| import unicode | |
| var args = commandLineParams() | |
| assert(args.len == 1, "Provide exactly one jumbled word to unscramble.") | |
| var | |
| jumble: string = args[0].toUpper() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import std.stdio : writefln, File; | |
| import std.exception : enforce; | |
| import std.algorithm : map; | |
| import std.algorithm.iteration : permutations; | |
| import std.utf : byChar; | |
| import std.conv : to; | |
| import std.uni : toUpper; | |
| void main(string[] args) | |
| { |
NewerOlder