Swift, in contrast with Objective-C, makes a distinction between values that may be nil and values that can never be nil through its use of Optionals. Due to the fact that Objective-C does not make this distinction, Objective-C functions that do not use the Nullability annotations are imported with parameters of the implicitly unwrapped optional type. Unfortunately, this allows users to write their own Swift code that looks like this:
This file contains hidden or 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
| function shouldStop(startTime) { | |
| return new Date().getTime() - startTime.getTime() > 300000; // 5 minutes | |
| } | |
| function archive() { | |
| var days = 7; // How old a message must be to be archived | |
| var startTime = new Date(); | |
| var date = new Date(); | |
| date.setDate(date.getDate() - days); | |
| var label = GmailApp.getUserLabelByName("[LABEL NAME]"); |
This file contains hidden or 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
| # If you haven't already, download Conky Google Now from http://satya164.deviantart.com/art/Conky-Google-Now-366545753 and unzip it to your home folder; then copy this .conkyrc over the one you just extracted | |
| # Requires lm-sensors and inxi (and conky) to be installed: | |
| # sudo apt-get install lm-sensors inxi | |
| # Adapted from these: | |
| # http://satya164.deviantart.com/art/Conky-Google-Now-366545753 | |
| # https://gist.github.com/anonymous/6666594 | |
| # Conky Google Now style # |
NewerOlder