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
-- debugging | |
on log_event(themessage) | |
set theLine to (do shell script "date +'%Y-%m-%d %H:%M:%S'" as string) & " " & themessage | |
do shell script "echo " & theLine & " >> ~/Library/Logs/AppleScript-events.log" | |
end log_event | |
-- Extract the album name from the session file | |
on extractAlbumName(sessionContents) | |
set albumName to "" | |
set allLines to every paragraph of sessionContents |
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
# Let's not localize programming languages. Please >_< | |
# | |
# Feel free to fork and expand and/or add more languages as an example | |
# to why this would be horrible, and I'll add them here :) | |
# Ruby in English | |
if user.is_alive? | |
# send spam mail |
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
#!/bin/sh | |
eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; | |
if /sbin/ifconfig tun0; then | |
echo "VPN is active"; | |
else | |
DISPLAY=:0 notify-send "VPN is not active" | |
fi |
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
var file = ... // a File web API interface: https://developer.mozilla.org/en-US/docs/Web/API/File | |
img = new Image(); | |
img.src = URL.createObjectURL(file); | |
img.onload = function() { | |
alert(this.naturalWidth); | |
}; |
OlderNewer