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
public static Long calendarWeekIso (Date inputDate) { | |
Date thisThursday = new Date(inputDate.getYear(), inputDate.getMonth(), inputDate.getDate() - weekday(inputDate) + 4); | |
Date firstOfJan = new Date(thisThursday.getYear(), 0, 1); | |
Date firstThursdayOfYear = new Date(thisThursday.getYear(), 0, 1); | |
while(weekday(firstThursdayOfYear) != 4){ | |
firstThursdayOfYear.setDate(firstThursdayOfYear.getDate() + 1); | |
} | |
Date firstMondayOfYear = new Date(firstThursdayOfYear.getYear(), 0, firstThursdayOfYear.getDate() - 3); | |
Long cw = (thisThursday.getTime() - firstMondayOfYear.getTime())/1000/60/60/24/7 + 1; | |
return cw; |
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
-- click on icon | |
try | |
tell application "Finder" | |
set currentPath to (POSIX path of (target of front window as alias)) | |
set the clipboard to currentPath | |
end tell | |
on error | |
my finderErrorMsg() | |
end try | |
-- drop folder on icon |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.brainsatwork.sync</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>~/.sync/sync.sh</string> | |
</array> |