Skip to content

Instantly share code, notes, and snippets.

View andreineculau's full-sized avatar
:bowtie:

Andrei Neculau andreineculau

:bowtie:
View GitHub Profile
@andreineculau
andreineculau / imessage
Created January 2, 2019 12:49 — 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
let elementsFromPoint = function(x, y) {
let items = [];
let element;
do {
element = document.elementFromPoint(x, y);
if (!element || element === (items[0] || {}).element) {
break;
}
items.unshift({
@andreineculau
andreineculau / -
Last active August 29, 2015 14:20 — forked from kemitchell/-
74925 NONE
54706 MIT
9268 ISC
3050 BSD
1521 BSD-2-CLAUSE
791 APACHE-2.0
699 APACHE 2.0
392 BSD-3-CLAUSE
364 WTFPL
346 UNKNOWN
@andreineculau
andreineculau / sendmail.app
Last active February 2, 2018 16:41 — forked from masnick/gist:6985205
a nice way to send mail from the shell in osx
#!/usr/bin/env osascript
# usage: sendmail.app from@me.com to@you.com,and@you.com "have you seen this?" "a nice way to send mail/attachment from the shell in osx (if you have configured Mail.app) https://gist.github.com/andreineculau/38f6160cc9aa11956953"
on theSplit(theString, theDelimiter)
-- save delimiters to restore old settings
set oldDelimiters to AppleScript's text item delimiters
-- set delimiters to delimiter to be used
set AppleScript's text item delimiters to theDelimiter
-- create the array