-
--
---
–
––
from machine import freq, reset, lightsleep | |
freq(250_000_000) # Speed up CPU for faster imports | |
import thumbyGraphics | |
from thumbyButton import actionPressed | |
# Tweaks for extended battery life | |
freq(24_000_000) # Lowest stable CPU frequency | |
thumbyGraphics.display.brightness(1) # Low brightness | |
thumbyGraphics.display.setFPS(0) # Minimal frame rate: draws buffer without delay |
on run | |
# TODAY - Returns today's date! | |
# Create your own Service, to avoid 3rd Party software (WordService, etc.) | |
# In Automator: | |
# > Service receives 'no input' in 'any application' | |
# > Output replaces selected text | |
# Add Shortcut (e.g. Ctrl+Cmd+T - it's hard to find a free shortcut!): | |
# > Preferences > Keyboard > Keyboard Shortcuts > Services | |
# When setting up Keyboard Shortcut, *exit* the target app before testing. (It seems shortcuts are only refreshed when app is launched) | |
# Adjust 'Short' Date format |
<?php | |
/** | |
* MAGICSTRINGPACKER | |
* | |
* Pack small strings or Codes (e.g. 2 letter ISO country codes), into a compact 'magic string' minimized by: | |
* 1> Running Codes into each other (eliminating matching first and last letters) 'AB'+'BA' => 'ABA' ; | |
* 2> Avoiding spaces / code break characters, by joining Codes 'AA,BB' => 'AABB'; | |
* Only where 1&2 generates allowable sequences (unique, with no collisions). | |
* This is useful for matching data against a compact reference (magic string), where hashing isn't an option. | |
* E.g. Checking country codes in a spreadsheet against the list of EU countries. |