REFERENCES FOR LEARNING & USING APPLESCRIPT Modified: 2018/06/19 18:47
AppleScript is a rather peculiar scripting language to learn.
| #!/bin/sh | |
| # | |
| # Running this script in a directory with a Makefile will print the | |
| # targets in that Makefile, e.g. | |
| # | |
| # $ list-makefile-targets | |
| # all | |
| # clean | |
| # docs | |
| # install |
| /******************************************************************************* | |
| WHAT: Read SMC keys that Apple's powermetrics tool uses. Requires OS X 10.10 | |
| RUN: sudo dtrace -qCs powermetrics.d -c 'powermetrics --sampler smc -n 1' | |
| DETAIL: This lets us see what hardware components/functions they map to. | |
| LICENSE: MIT | |
| AUTHOR: beltex <http://beltex.github.io> | |
| REFERENCES: | |
| - Advanced Mac OS X Programming: The Big Nerd Ranch Guide |
| #!/usr/bin/env python | |
| """\ | |
| Extract files from Hotline Miami 2 WAD files. | |
| Usage: | |
| hlm2-dewad --help | |
| hlm2-dewad [--flatten] <wad-path> [<path>] | |
| hlm2-dewad --list <wad-path> | |
| Options: |
This is a document full of notes of all the things that have hung me up getting into Python's new asyncio library. I mostly use it for tools that schlep data around between file systems, databases, and search engines for work. So lots of io. Usually I use gevent and python 2.7. But recently I've been trying to get more into asyncio and here I'm going to document all the things that I felt important to know or that tripped me up.
The first thing you need to do is write some coroutines without asyncio. This means understanding the yield keyword and how it can be used to create generators. Then next the protocol for sending/receiving from generator objects.
Recall generators are a special kind of iterator. When you specify a generator like so, you can use it in a for loop:
def generator()
for i in range(0, 5):
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
| package main | |
| import ( | |
| "bufio" | |
| "log" | |
| "os" | |
| ) | |
| var concurrency = 100 |