Skip to content

Instantly share code, notes, and snippets.

@rrichardsonv
rrichardsonv / udon_noodle_stir_fry.md
Created October 26, 2020 16:20
Tasty veggie udon noodles

Udon Noodle Stir-Fry

(Makes 4-5 servings)

Ingredients

Noodles

  • 1/2 lb Mushrooms (The larger grocery container)
  • Fresh Udon noodles (Not dried, See Sourcing)
  • 3 Tbs Roughly chopped peanuts (optional)
  • 1/2 lb Red Cabbage (little less than half a cabbage)
@rrichardsonv
rrichardsonv / compile_speed_test.exs
Created August 11, 2020 21:18
Compilation tracer generating compilation times, number of aliases, imports, requires, and more!
defmodule CompileSpeedTest do
use Mix.Task
@recursive
@ets_table :compile_test
@header_row "FILE,START,IMPORTS,ALIASES,REQUIRES,USES,DURATION\n"
@impl Mix.Task
def run(args \\ []) do
@rrichardsonv
rrichardsonv / shunt_on_em.ex
Created May 8, 2020 17:25
Shunting yard elixir implementation for keyword list tokens
defmodule ShuntOnEm do
@moduledoc """
Shunting yard algorithm as explained at https://en.wikipedia.org/wiki/Shunting-yard_algorithm
Refactored and repurposed from https://gist.github.com/pixyj/73bebd14be17ce680e9219f642044964
For use, primarily in traversing tokens produced by the wonderful nimbleparsec
## Examples
```
@rrichardsonv
rrichardsonv / ntest.ex
Created March 18, 2020 16:56 — forked from cblavier/ntest.ex
Parallel test runner
defmodule Mix.Tasks.NTest do
use Mix.Task
@wildcard "apps/*/test/**/*_test.exs"
def run([i, n | args]) do
{i, _} = Integer.parse(i)
{n, _} = Integer.parse(n)
test_paths =
defmodule GoIntumerables do
@doc """
## Example
take_into(%Bar{id: 1}, [:id], [])
# => [id: 1]
opts = [open: true, secret: "foo", source_id: "2"]
opts
@rrichardsonv
rrichardsonv / stream.js
Created January 15, 2020 15:42
elixir style stream
class Stream {
constructor (collection) {
this.collection = collection
this.transformations = []
this.acc = []
}
run () {
let acc = this.acc
let i = -1
@rrichardsonv
rrichardsonv / bad_identation patter
Created July 17, 2019 15:19
match_2spaces_regex
// (preceded by beginning of line or beginning of line followed by 2 or more spaces)
// a group of 2 spaces
// (followed by any number of spaces and ending with <)
(^|(?<=^\s{2,}))(\s{2})(?=\s*<)
git clone https://github.com/nodenv/nodenv.git ~/.nodenv
ln -s "$SYSTEM_REPO/Dotfiles/config/nodenv/default-packages" ~/.nodenv/
( mkdir ~/.nodenv/plugins && cd ~/.nodenv/plugins && \
for PLUGIN in node-build node-build-update-defs nodenv-aliases \
nodenv-default-packages nodenv-each nodenv-package-rehash; do
git clone "https://github.com/nodenv/$PLUGIN.git"
done )
nodenv update-version-defs
@rrichardsonv
rrichardsonv / append_crappy_css.sh
Last active June 23, 2022 21:42
script for bad css prank
#!/bin/bash
set -e
CRAPPY_CSS_REQUESTER=$(cat <<-END
// ----------------------- PRANK COOOODE ---------------------------
// CSS Hell stylesheet appender. Makes a request on load and appends a terrifyingly bad stylesheet
document.addEventListener('DOMContentLoaded', function () {
\$.ajax({
url: 'https://gist.githubusercontent.com/rrichardsonv/09df45442428da954f6e62f4f1ce8f05/raw/16b20d0025ef961fce46bf2ad13798fc67368c6f/classic_bad_css.css',
success: function (css) {
.c-virtual_list__scroll_container {
background: linear-gradient(to right, red, orange, yellow, green, blue, indigo, violet) !important;
}
p, span, h1, h2, h3, h4, h5, div, section, article, body {
font-family: "Comic Sans MS", cursive, sans-serif !important;
}
.member_image{
-webkit-animation: spinToWin 5s infinite; /* Safari 4.0 - 8.0 */
animation: spinToWin 5s infinite;