This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Inspired by https://github.com/complete-ts/cspell-check-unused-words | |
import { lint } from 'cspell' | |
import { getDefaultConfigLoader } from 'cspell-lib' | |
export async function checkForUnusedWords(): Promise<string[]> { | |
const config = await getDefaultConfigLoader().searchForConfigFile(undefined) | |
if (config === undefined) { | |
throw new Error('No CSpell configuration found.') | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Export images from Photos via automated GUI manipulation | |
-- It's an unsavory approach, but no other means of automation seems to yield higher quality edited image exports (so far) | |
-- Arguments are passed in their order of appearance in the GUI, and expect values exactly matching the UI strings in Photos.app | |
-- Accepts an individual photo UUID, or an album UUID (use osxphotos query to look up UUIDs) | |
on run { uuid, exportDirectory, photoKind, jpegQuality, tiffBitDepth, colorProfile, photoSize, maxSizeType, maxSizeValue, includeMetadata, includeLocation , fileName, sequentialPrefix, subfolderFormat} | |
tell application "System Events" | |
set wasRunning to (name of processes) contains "Photos" | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo dtrace -n 'objc$target::*:* { @[probefunc] = count(); } tick-5sec { exit(0); }' -p `pgrep -x Photos` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Cocoa | |
import Photos | |
class PhotoExporter { | |
let imageManager = PHImageManager.default() | |
func exportPhoto(withLocalIdentifier identifier: String, to destinationURL: URL) { | |
// Fetch the asset with the specified identifier |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
// Turn a decimal number into a fractional approximation rounded to a maximum denominator | |
// https://github.com/jadengeller/fractional? | |
// https://stackoverflow.com/questions/35895154/decimal-to-fraction-conversion-in-swift#35895607 | |
typealias Rational = (whole: Int, numerator: Int, denominator: Int) | |
func decimalToRational(of value: Double, withDenominator denominator: Int) -> Rational { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Script to automate downloading CSV files from GoogleDocs into the lens asset folders | |
# Note that google broke password authentication in April 2015, so the interface changed slightly | |
# to use the oauth-supporting library gspread. | |
# | |
# Expects a Google oauth key file named google_oauth_key.json, created and downloaded | |
# from http://console.developers.google.com | |
# | |
# Usage example: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Quick sketch to log brain data to a CSV | |
// Untested!!! | |
// Based on https://github.com/kitschpatrol/BrainGrapher | |
// Expects data from https://github.com/kitschpatrol/Brain | |
// Eric Mika Spring 2018 | |
import processing.serial.*; | |
Serial serial; | |
Table table; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Mindflex --> Arduino --> Processing --> OSC --> PD | |
// Eric Mika Jan 2018 | |
import processing.serial.*; | |
import netP5.*; | |
import oscP5.*; | |
Serial serial; | |
OscP5 oscProcessing; | |
NetAddress oscPD; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int frame = 0; | |
int wallOffset = 0; | |
final int windowWidth = 1; | |
final int wallWidth = 4; | |
boolean isDrawWallEnabled = false; | |
boolean isWallAnimated = true; | |
PImage pattern; | |
void setup() { |
NewerOlder