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 / colorize.sh
Last active August 29, 2015 13:57 — forked from anonymous/colorize.sh
Automatically change the colors of glyphicons.
#!/bin/bash
while read NAME HEX; do
for i in `find -name "*-white.svg"`; do
FILENAME=`echo $i | sed -e "s/white/$NAME/g"`
sed -e "s/#FFFFFF/$HEX/g" $i >$FILENAME
PNG=`echo $FILENAME | sed -e "s/svg/png/g"`
convert $FILENAME -transparent white $PNG
done
for i in "" "filetypes" "halflings" "social"; do
WHERE="_$i"
<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 {
@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;
@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 / 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 {
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 / 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)
@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 / 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 / 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;