Skip to content

Instantly share code, notes, and snippets.

View cmrfrd's full-sized avatar
Just doing the beep boop

Alexander Comerford cmrfrd

Just doing the beep boop
View GitHub Profile
function test(a){
console.log(a);
}
@cmrfrd
cmrfrd / ascii_interact.org
Last active October 18, 2019 21:11
ascii_interact.org

org is super kool

This is a really cool and simple org document to be able to interactively compute ascii results from an isolated installation of easygraph && graphviz within docker using org mode SRC blocks.

The point of this is much broader though because any text based output tool like plantuml, easygraph, or other can be used interactively in org without installing either tool and purely using docker for isolation

@cmrfrd
cmrfrd / switchcase-presentation.org
Last active December 5, 2019 10:29
switchcase-presentation.org

Implementing switch-case in python

@cmrfrd
cmrfrd / async.pysc
Created December 5, 2019 16:21
async.pysc
import asyncio
import random
async def p(q,n):
for x in range(n):
print("p: ",x)
await asyncio.sleep(random.random())
await q.put(str(x))
async def c(q):
@cmrfrd
cmrfrd / org_include_file_ref.org
Created December 6, 2019 01:41
org_include_file_ref.org
(org-babel-do-load-languages
  'org-babel-load-languages
  '((shell . t)
    (go . t))))
@cmrfrd
cmrfrd / snake_string.py
Last active February 28, 2020 22:34
snake string
"""S is a snake string
The goal of snake string to easily generate paramaterized strings from
attributes, args, and kwargs.
Examples:
S.asdf -> asdf
S.hey.how.are.you -> hey.how.are.you
S.wow.s("this").is.cool -> wow.this.is.cool
@cmrfrd
cmrfrd / snake_string2.py
Last active March 3, 2020 23:10
snake_string2.py
import _collections_abc
from operator import itemgetter as _itemgetter, eq as _eq
from keyword import iskeyword as _iskeyword
import sys as _sys
from functools import wraps
MAX_DEPTH = 1024
class SnakeString(_collections_abc.Sequence):
"""
@cmrfrd
cmrfrd / bloob
Created March 9, 2020 21:28
bloop
import time
import asyncio
import operator
from functools import wraps
from itertools import repeat, count
from aioitertools import iter as aiter
from aioitertools import islice
from peewee import *
from peewee import Expression
@cmrfrd
cmrfrd / bloop_use
Last active March 9, 2020 21:41
bloop_use
import time
import asyncio
import operator
from functools import wraps
from itertools import repeat, count
from aioitertools import iter as aiter
from aioitertools import islice
from peewee import *
from peewee import Expression
@cmrfrd
cmrfrd / gist:fe8f61da076f8a4a751bf8fc8cb579a5
Created December 28, 2022 04:12
ipad_screen_mirror_server
#! /usr/bin/env nix-shell
#! nix-shell --quiet -p uxplay -i bash
set -ueo pipefail
## Clear any existing "DROP ME" rules
## ref: https://stackoverflow.com/a/63855690/12393422
while sudo iptables -L -n --line-number | grep "DROP ME" > /dev/null; do
sudo iptables -D INPUT $(sudo iptables -L -n --line-number | grep "DROP ME" | head -1 | awk '{print $1}');
done