Skip to content

Instantly share code, notes, and snippets.

@24601
24601 / machine.js
Last active September 19, 2019 00:54
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@24601
24601 / imessage
Created April 10, 2019 21:36 — forked from aktau/imessage
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
/**
* Created by basitmustafa on 7/27/17.
*
* Do what you want with this. No warranties. This code sucks. If you improve it, I would love a better copy sent back and I'll update.
*
* basit.mustafa@gmail.com
* 24601 @github
*/
function getHelper() {