Skip to content

Instantly share code, notes, and snippets.

View merriam's full-sized avatar

Charles Merriam merriam

View GitHub Profile
@merriam
merriam / day8samp.txt
Created January 11, 2024 20:41
Rust two outputs, the input file
LR
11A = (11B, XXX)
11B = (XXX, 11Z)
11Z = (11B, XXX)
22A = (22B, XXX)
22B = (22C, 22C)
22C = (22Z, 22Z)
22Z = (22B, 22B)
XXX = (XXX, XXX)
@merriam
merriam / main.rs
Created January 11, 2024 20:40
Rust creating two outputs
extern crate regex;
use regex::Regex;
use std::collections::HashMap;
type NodeList = HashMap<String, (String, String)>;
fn parse_input(input_filename: &str) -> (String, NodeList) {
let contents = std::fs::read_to_string(input_filename).unwrap();
@merriam
merriam / as.gd
Last active February 23, 2021 03:59
Godot utililty routines for printing numbers
extends Resource
class_name As
static func demo_usage():
print("These are booleans: %s %s"
% [tf(true), tf(false)])
print("These are numbers: %s %s"
% [comma_int(1234), comma(1234.567, 2)])
print("This is scientific: %s %s"
% [scientific(0.000123), scientific(1234.56)])
import collections
class Solution:
def findLadders(self, beginWord, endWord, wordList):
"""
:type beginWord: str
:type endWord: str
:type wordList: List[str]
:rtype: List[List[str]]
@merriam
merriam / gist:17d1fff98419d796fc6145aea35ff26c
Created August 14, 2018 06:53
CSS before draws over body
<style>
.heart {
position: absolute;
margin: auto;
top: 0;
right: 0;
bottom: 0;
left: 0;
background-color: pink;
height: 50px;
@merriam
merriam / SensorFusion Emerging LIDAR.md
Created July 29, 2018 00:04
Sensor Fusion Meeting: Emerging LIDAR concepts and Sensor Technologies for AV
@merriam
merriam / gist:7669828
Created November 27, 2013 02:36
A small routine to recursively dump structure into HTML. This routine uses the Flask framework, but should work in anything. Added a couple comments to help.
from flask import g
from werkzeug import escape # so "<sqlInstance ... >" isn't taken as a tag.
@app.route("/show_user_data")
def show_user_data():
""" show the user date, i.e., the flask.g data """
## The dump_val() function is what you might want to reuse.
def dump_val(key, value):
""" return an html snippet with lists for dictionaries. . """
echo "1. ====== Throw a copy of everything into git "
git add .
git commit -m "MAKING LEDGER"
@merriam
merriam / timestamp.py
Last active December 19, 2015 02:19 — forked from reima/timestamp.py
# -*- coding: utf-8 -*-
from datetime import datetime
import sublime_plugin
# Adding too much documentation:
# 1. The original Gist had %M instead of %m in the strftime() class. %M means minute,
# while %m means month as a decimal.
# 2. To install this:
# Sublime's menu Tools -> New Plugin...,
@merriam
merriam / filelist.md
Created December 20, 2012 01:36
filelist for craftyjs.github.com
layout title
default
File List

A note on viewing the files

The website stores most pages in MarkDown format. The server runs these pages through the jekyll preprocessor and the pygments syntax highlighter. Also, the webserver remaps certain directories such as /images to ~/images.

The Filelist of crafyjs.github.com: