Skip to content

Instantly share code, notes, and snippets.

@joker1007
joker1007 / mount_nas.scpt
Created November 16, 2014 11:12
特定のIPが割り当てられた時、NASを自動でマウントするAppleScript
global prevIpValue
set prevIpValue to ""
on idle
set newIpValue to IPv4 address of (get system info) as string
if newIpValue = "192.168.1.80" and not newIpValue = prevIpValue then
try
display alert "NASをマウントします"
@theprojectsomething
theprojectsomething / Timer.js
Created March 17, 2014 07:26
Timer - a simple JS timing implementation utilising requestAnimationFrame.
/*
Timer
- utilises animation frames (with a fallback to setTimeout when using the polyfill, below)
- returns remaining (or running) time
- pass a callback [fn], with an optional duration [ms] and autotart [bool], to the constructor or 'init' method
eg. new Timer(foo, 1000) *or* (new Timer()).init(foo, 0, true)
- for uniform x-browser support combine with the requestAnimationFrame polyfill from Erik Möller, et. al.
[https://github.com/darius/requestAnimationFrame]
*/