#!/usr/bin/env python | |
import re | |
cpy_regex = re.compile(r"cpy ((?P<reg>[a-z]+)|(?P<num>\d+)) (?P<y>\w+)") | |
inc_regex = re.compile(r"inc (?P<x>\w+)") | |
dec_regex = re.compile(r"dec (?P<x>\w+)") | |
jnz_regex = re.compile(r"jnz ((?P<reg>[a-z]+)|(?P<num>\d+)) (?P<y>[\w-]+)") | |
class Cmd(object): |
#!/usr/bin/env python | |
import re | |
value_regex = re.compile("value (?P<value>\d+) goes to bot (?P<dest>\d+)") | |
gives_regex = re.compile("bot (?P<bot>\d+) gives low to (?P<low_dest>(output|bot)) (?P<low_id>\d+) and high to (?P<high_dest>(output|bot)) (?P<high_id>\d+)") | |
class Element(object): | |
def store(self): | |
raise NotImplemented('Need to override this.') |
#!/usr/bin/env python | |
# Aleksandar Topuzovic <aleksandar dot topuzovic at gmail dot com> | |
import re | |
rect_regex = re.compile("rect (?P<n>\d+)x(?P<m>\d+)") | |
rotate_regex = re.compile("rotate (?P<what>column|row) (x|y)=(?P<cid>\d+) by (?P<by>\d+)") | |
class Cmd(object): |
Simple toggleable menubar replacement for Caffeine in Hammerspoon, utilizing ASCIImage (for vector) to create the amphetamine icons. Motivated by the official Caffeine app's icon looking bad on Retina
Get latest version here: amphetamine.lua
Save as amphetamine.lua
in ~/.hammerspoon/
and put amphetamine = require "amphetamine"
in your init.lua
Copyright © 2017 Fantasyland Institute of Learning. All rights reserved.
A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.
val square : Int => Int = x => x * x
####Disabling SPI write protection
Put the Chromebook in developer-mode:
- With machine powered off, hold down Esc and Refresh(F3) while hitting power button
- At warning prompt, hit Control+D, then Enter at prompt about enabling developer mode
- Machine will format itself
Now remove the write-protect screw to enable flashrom
to flash new Coreboot/Libreboot.
Flip powered-off machine over and remove 8 philips-head screws. 2 are located under rubber feet.
#!/bin/sh | |
. /lib/functions/network.sh | |
network_find_wan wan_if | |
network_get_device wan_if_dev $wan_if | |
if ! ping -I $wan_if_dev -q -c 1 -W 10 8.8.8.8 > /dev/null | |
then | |
echo "Lost internet connectivity. Reconnecting." | logger -t "tester[$$]" -p info | |
(ifup $wan_if) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# The MIT License (MIT) | |
# Copyright (c) 2014 Aleksandar Topuzović <aleksandar.topuzovic@gmail.com> | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |