I hereby claim:
- I am ChristoferK on github.
- I am christoferk (https://keybase.io/christoferk) on keybase.
- I have a public key whose fingerprint is B621 0876 4E7A 713C F8F3 EC3A FD7A BF5E 1AB1 49E2
To claim this, I am signing this object:
tell application "Safari" to tell front window to tell ¬ | |
(first tab whose URL contains "youtube.com/watch?v=") to ¬ | |
if it exists then do JavaScript [¬ | |
"document", ¬ | |
".querySelector('div[class*=\"-mode\"]')", ¬ | |
".className", ¬ | |
".match(/(playing|paused|ended)-mode/)[1]"] as text |
tell application "System Events" to tell ¬ | |
process "Dock" to tell ¬ | |
list 1 to get the name of ¬ | |
(every UI element whose ¬ | |
value of attribute "AXSubrole" is "AXApplicationDockItem" and ¬ | |
value of attribute "AXIsApplicationRunning" is true) |
# Note: «class isot» cannot be coerced to text | |
get the ((current date) as «class isot» as string) | |
--> "2018-03-28T14:52:26" |
property S : a reference to application "Safari" | |
global W | |
on run input -- input is a list of URLs | |
if (count input) is 0 then ¬ | |
set the input to {¬ | |
"alfredapp.com", ¬ | |
"stackoverflow", ¬ | |
"google.co.uk"} |
I hereby claim:
To claim this, I am signing this object:
use application "System Events" | |
on directories of directory without contents | |
local contents | |
tell (a reference to the POSIX path of every folder in ¬ | |
the folder named directory) to if contents then | |
to __string__(object) | |
local object | |
try | |
null object | |
on error E --> "Can’t get null %object%." | |
E's text 16 thru -2 | |
end try | |
end __string__ | |
on |$|:value |
to factorise(x) | |
script | |
property lim : x ^ 0.5 | |
property P : primes(lim) & getNextPrime(lim) | |
property L : {} | |
end script | |
tell the result | |
repeat with p0 in its P | |
repeat until (x mod p0) ≠ 0 |
windows = Application('Safari').windows() | |
windows.shift() // Remove front window from array | |
windows.map(w=>w.miniaturized = true) |