Skip to content

Instantly share code, notes, and snippets.

View joerick's full-sized avatar

Joe Rickerby joerick

View GitHub Profile
@joerick
joerick / fix dates.scpt
Created July 22, 2023 09:09
Fix Photos.app dates Applescript
-- create a folder for use by the script and set the path to it here
set thepath to alias "Macintosh HD:Users:joerick:Desktop:Scratch" as text
tell application "Photos"
set photos to every media item of container "DateFix"
repeat with mediaitem in photos
tell application "Finder" to delete every item of folder thepath
export {mediaitem} to thepath with using originals
tell application "Finder" to set theExport to item 1 of folder thepath
@joerick
joerick / build.py
Last active March 19, 2023 11:33
cibuildwheel high-level arch design attempt
from __future__ import annotations
import abc
from typing import ContextManager, Protocol
from cibuildwheel.logger import log
from cibuildwheel.options import Options
class PythonConfiguration(Protocol):
identifier: str
@joerick
joerick / gist:42e9e31ceb5d1dfe43c69fb6a59436e2
Created October 10, 2022 08:23
PYTHONVERBOSE=1 /opt/homebrew/bin/python3.10 -m pip -v wheel .
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'posix' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
# installing zipimport hook
@joerick
joerick / arm64
Created December 31, 2020 20:16
python -m pip debug -v
pip version: pip 20.3.3 from /private/tmp/env/lib/python3.9/site-packages/pip (python 3.9)
sys.version: 3.9.1 (v3.9.1:1e5d33e9b9, Dec 7 2020, 12:44:01)
[Clang 12.0.0 (clang-1200.0.32.27)]
sys.executable: /private/tmp/env/bin/python
sys.getdefaultencoding: utf-8
sys.getfilesystemencoding: utf-8
locale.getpreferredencoding: UTF-8
sys.platform: darwin
sys.implementation:
name: cpython
@joerick
joerick / deviceli
Created April 26, 2020 12:27
device.li nginx config
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream littleprinter {
server littleprinter.nordprojects.co:443;
}
server {

Keybase proof

I hereby claim:

  • I am joerick on github.
  • I am joerick (https://keybase.io/joerick) on keybase.
  • I have a public key ASDltyZj-bUqerbEwz324BDuZbbpCpQCF5NYiPLo6qU80wo

To claim this, I am signing this object:

@joerick
joerick / README.md
Created September 8, 2018 10:03
Test gist

formatting

this is a readme

@joerick
joerick / make-wheel.sh
Last active May 8, 2018 04:57
patch-python-macos-openssl wheel build
#!/bin/bash
set -o errexit
set -o xtrace
version=0.1
package_name=patch_python_macos_openssl
tag=cp27-cp27m-macosx_10_6_intel
wheel_root=$package_name-$version
@joerick
joerick / termfix.c
Last active February 16, 2022 12:49
C program which will fix the terminal when an SDL app has crashed or been SIGKILL'd before cleaning up after itself
#include <sys/ioctl.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>
#include <linux/vt.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/kd.h>
#include <linux/keyboard.h>
@joerick
joerick / button_event_parse.py
Created May 28, 2016 17:38
Button state machine prototype
from collections import namedtuple
import Queue, unittest
ButtonEvent = namedtuple('ButtonEvent', ('state', 'timestamp',))
ButtonAction = namedtuple('ButtonAction', ('type', 'timestamp',))
class Button(object):
def __init__(self):
self.event_queue = Queue.Queue()