This file contains 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
mod day1; | |
mod day2; | |
use clap::Parser; | |
mod aoc_error; | |
#[derive(Parser, Debug)] | |
#[command(author, version, about, long_about = None)] | |
struct Args { | |
#[arg(short, long, default_value_t = 1)] | |
day: u8, |
This file contains 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 tracing; | |
use std::fs; | |
use miette::Result; | |
use crate::aoc_error; | |
use std::cmp::max; | |
pub fn run() { | |
let contents = fs::read_to_string("2023-day-02-part2") | |
.expect("Should have been able to read the file"); | |
let result = calculate(contents); |
This file contains 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 tracing; | |
use std::fs; | |
use miette::Result; | |
use crate::aoc_error; | |
pub fn run() { | |
let contents = fs::read_to_string("2023-day-02-part1") | |
.expect("Should have been able to read the file"); | |
let result = calculate(contents, 12, 13, 14); | |
match result { |
This file contains 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 tracing; | |
use std::fs; | |
use miette::Result; | |
use crate::aoc_error; | |
pub fn main() { | |
let contents = fs::read_to_string("2023-day-01-part2") | |
.expect("Should have been able to read the file"); | |
let result = calculate(contents); //55172 | |
match result { |
This file contains 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 tracing; | |
use std::fs; | |
use miette::Result; | |
use crate::aoc_error; | |
pub fn main() { | |
let contents = fs::read_to_string("2023-day-01-part1") | |
.expect("Should have been able to read the file"); | |
let result = calculate(contents); //55172 | |
match result { |
This file contains 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
public class ReplaceGameObjectsWizard : ScriptableWizard | |
{ | |
private const string PrefsPath = "ReplaceGameObjects.PrefabPath"; | |
public GameObject Prefab; | |
[MenuItem("GameObject/Replace GameObjects",false,0)] | |
static void CreateWizard () | |
{ | |
UnityEngine.Object[] objectsOfTypeAll = Resources.FindObjectsOfTypeAll(typeof(ReplaceGameObjectsWizard)); | |
if (objectsOfTypeAll.Length == 0) |
This file contains 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
/// <summary>Only works on vertical scroll views</summary> | |
public class TableStickyRow : MonoBehaviour | |
{ | |
[SerializeField] | |
RectTransform stickyPrefab = null; | |
//Todo: Set this in another way | |
[SerializeField] | |
private int stickyIndex; |
This file contains 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
public static class RPGItemUtility | |
{ | |
private static readonly List<RPGItem> All = new List<RPGItem>(); | |
private static bool IsLoaded; | |
private static TaskCompletionSource<bool> IsLoadingComplete; | |
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] | |
private static void Load() | |
{ | |
IsLoadingComplete = new TaskCompletionSource<bool>(); |
This file contains 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
#!/bin/bash | |
path="$1" | |
if [ "$path" = "" ] ; then | |
path="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
fi | |
echo $path | |
appfile=`find "$path" -name "*.app" -exec basename {} \;` | |
echo $appfile | |
appDir=`find "$path" -name "*.app" -print` |
This file contains 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
static public int Max(int a, int b) { | |
a -= b; | |
a &= (~a) >> 31; | |
return a + b; | |
} | |
static public int Min(int a, int b) { | |
a -= b; | |
a &= a >> 31; | |
return a + b; | |
} |
NewerOlder