Skip to content

Instantly share code, notes, and snippets.

use std::error::Error;
#[derive(PartialEq)]
enum MyGameResult {
Win,
Lose,
Tie,
}
#[derive(Debug, PartialEq, Clone, Copy)]
use std::error::Error;
#[derive(PartialEq)]
enum MyGameResult {
Win,
Lose,
Tie
}
#[derive(Debug, PartialEq, Clone, Copy)]
use std::fs::File;
use std::error::Error;
use std::io::{ self, BufRead };
use std::collections::BinaryHeap;
use std::cmp::Reverse;
// https://doc.rust-lang.org/stable/std/collections/struct.BinaryHeap.html#min-heap
struct SortedTopK<T: Ord> {
k: usize,
heap: BinaryHeap<Reverse<T>>
@AlJohri
AlJohri / Red Alert 3 Setup.md
Last active November 27, 2023 05:59
Instructions to set up optimal Red Alert 3 playing experience

Red Alert 3 Setup

This is a highly opinionated guide helping you set up the "optimal" Red Alert 3 gaming experience. This install will allow you to:

  1. Play the game online using C&C:Online (Revora).
  2. Play the game over LAN using Hamachi VPN (LogMeIn).
  3. Enable use of a second monitor while playing instead of a black screen.
  4. Allow Zoom video chat overlay on top of the game.

Setup

# Source: https://stackoverflow.com/questions/50003378/automatically-set-listenerrule-priority-in-cloudformation-template
import random
import uuid
import traceback
import boto3
# Member must have value less than or equal to 50000
ALB_RULE_PRIORITY_RANGE = 1, 50000
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AlJohri
AlJohri / # pup - 2020-04-13_12-31-39.txt
Created April 13, 2020 16:39
pup on Ubuntu 18.04.2 LTS - Homebrew build logs
Homebrew build logs for pup on Ubuntu 18.04.2 LTS
Build date: 2020-04-13 12:31:39
#!/usr/bin/osascript -l JavaScript
/*
Usage: ./extract.jxa
Outlook Object Model: https://docs.microsoft.com/en-us/office/vba/api/overview/outlook/object-model
*/
ObjC.import("stdlib");
SystemEvents = Application("System Events");
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -e
REPOSITORY=$(basename $(realpath $(dirname "$0")))
VCPUS=16
MEMORY=$(expr 1024 \* 32)
COMMAND='[]'
JOB_QUEUE=default