Skip to content

Instantly share code, notes, and snippets.

View icub3d's full-sized avatar

Joshua Marsh icub3d

  • Optum
  • USA
View GitHub Profile
@icub3d
icub3d / main.rs
Created December 5, 2023 01:49
2023 Advent of Code - Day04
use std::collections::HashSet;
use nom::bytes::complete::tag;
use nom::character::complete::space1;
use nom::multi::separated_list0;
use nom::sequence::{separated_pair, tuple};
use nom::IResult;
#[derive(Debug)]
struct Card {
@icub3d
icub3d / main.rs
Created December 4, 2023 01:15
2023 Advent of Code - Day 03
fn main() {
let input = std::fs::read_to_string("input").unwrap();
let map: Vec<Vec<char>> = input.lines().map(|l| l.chars().collect()).collect();
// Scan through all the positions and see if we find a digit. If
// we do, look for a special character next to it (recursively
// looking right).
let mut p1 = 0;
for x in 0..map.len() {
let mut y = 0;
@icub3d
icub3d / day02.hs
Created December 4, 2023 01:13
Day 2 - Haskell w/ Parsec
import Data.List.Split (splitOn)
import qualified Text.Parsec as Parsec
data Round = Round {red :: Int, green :: Int, blue :: Int} deriving (Show)
data Game = Game {rounds :: [Round], id :: Int} deriving (Show)
parseColor :: Parsec.Parsec String () (Int, String)
parseColor = do
count <- Parsec.many1 Parsec.digit
@icub3d
icub3d / day02.hs
Created December 2, 2023 21:04
Advent of Code 2023 - Day 2 Solutions in Rust and Haskell
import Data.List.Split (splitOn)
data Round = Round {red :: Int, green :: Int, blue :: Int} deriving (Show)
data Game = Game {rounds :: [Round], id :: Int} deriving (Show)
parseColor :: String -> (Int, String)
parseColor s = (read (head parts) :: Int, last parts)
where
parts = words s
@icub3d
icub3d / day01.hs
Last active December 2, 2023 21:03
Advent of Code 2023 - Day 1
import Data.Char (isDigit)
import Data.List (concat, isPrefixOf)
import Data.Maybe (catMaybes)
main :: IO ()
main = do
input <- readFile "input"
let calibrations = lines input
putStrLn $ "p1: " ++ show (part1 calibrations (filter isDigit))
putStrLn $ "p2: " ++ show (part1 calibrations p2filter)
diff --git a/.SRCINFO b/.SRCINFO
index 314521a..93d49ee 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = istio-bin
pkgdesc = An open platform to connect, manage, and secure microservices
- pkgver = 1.7.4
+ pkgver = 1.8.0
pkgrel = 1
@icub3d
icub3d / main.go
Last active August 10, 2018 23:38
Lights Out Solver Algorithm
package main
import (
"bytes"
"fmt"
"os"
)
func main() {
if len(os.Args) < 2 || len(os.Args[1]) != 25 {
@icub3d
icub3d / publish.go
Created October 2, 2015 02:14 — forked from sdomino/publish.go
package main
import (
"archive/tar"
"compress/gzip"
"crypto/md5"
"fmt"
"io"
"log"
"os"
@icub3d
icub3d / designer.html
Created December 18, 2014 19:39
designer
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/iconsets/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
<style>
:host {