Skip to content

Instantly share code, notes, and snippets.

View RyanParsley's full-sized avatar

Ryan Parsley RyanParsley

View GitHub Profile
@RyanParsley
RyanParsley / daily.nu
Last active April 9, 2024 13:45
A nushell script to create a daily markdown note in a set directory. The full directory structure may not exist before running.
#!/usr/bin/env nu
# Set this to the root of your notes.
# Something like: "/Users/username/notes"
let note_dir = ""
let daily_dir = "journal/daily"
let current_year = (date now | format date "%Y")
let month_dir = (date now | format date "%m-%B")
let filename = (date now | format date "%Y-%m-%d.md")
@RyanParsley
RyanParsley / complete.rs
Created March 1, 2024 18:35
A small rust script to parse markdown and set a yaml property to true.
use color_eyre::Result;
use gray_matter::engine::YAML;
use gray_matter::{Matter, Pod};
use std::env::args;
use std::fs::{create_dir_all, write, File};
use std::io::prelude::*;
fn main() -> Result<()> {
color_eyre::install()?;
{
"env": {},
"globals": {},
"parser": "/Users/ryan/Projects/lint-macguffin-2-electric-boogaloo/node_modules/@typescript-eslint/parser/dist/index.js",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
@RyanParsley
RyanParsley / .eslintrc.json
Last active September 29, 2022 14:48
Opinionated Angular Config Overrides
{
...
"plugins": ["functional", "unused-imports" ],
"overrides": [
{
"files": ["*.spec.ts", "*.ts"],
"rules": {
"no-console": ["error", { "allow": ["error"] }],
"unused-imports/no-unused-imports": "error"
}
@RyanParsley
RyanParsley / angularNotes.md
Created July 3, 2020 02:40
A few notes on angular to help devs navigate unfamiliar waters.

Angular notes

When you generate a fresh angular app, you get over 300MB of supporting characters. Feels heavy for a hello world. What’s it all do? Looking in the project there are 8 json files for configuring node, the typescript compiler, the linter and the Angular CLI itself. There’s a node_modules folder for holding all your third party dependencies, an e2e folder to house all of your end to end tests and the src folder where the magic happens. In the src folder, you’ll find 3 more folders and some files you’re not super likely to want to edit.

A brief introduction to the generated files

index.html

The index.html file is less interesting than you’re probably expecting. It’s got a weird app-root tag, but doesn’t have a single script tag. This is because this file is essentially a template that webpack will follow to generate an index.html file when you build your project. That file will be adorned with all the angular goodness you need and placed in the dist folder when you run `ng b

@RyanParsley
RyanParsley / stormtrooper_bear.p8
Created April 30, 2020 12:34
Stubbing out a game per the specs of my 4 year old.
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
--stormtrooper bear
--ryan parsley
function _init()
t = 0
game_win=false
game_over=false
  • brew install vim (neovim?)
  • install powerline fonts from https://github.com/powerline/fonts
  • Configure iTerm2 to use one of the powerline fonts
  • install a python neovim package to smooth over differences between vim8 and neovim pip3 install neovim
function cURL(cURL)
{
var params =
{
cVerb: "GET",
cURL: cURL,
oHandler:
{
response: function(msg, uri, e)
{
@RyanParsley
RyanParsley / lights.py
Last active April 10, 2018 21:18
IOT thing with MicroPython
import time
from machine import Pin
from neopixel import NeoPixel
import uos
import math
p = Pin(2, Pin.OUT)
np = NeoPixel(p, 12)
def colorWipe(color, delay=0.01):