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
| package main | |
| import "fmt" | |
| import "time" | |
| import "sort" | |
| func main() { | |
| fmt.Println("Sorting an array of time") | |
| const shortForm = "Jan/02/2006" | |
| t1, _ := time.Parse(shortForm, "Feb/02/2014") |
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
| package org.asafary.csv; | |
| import com.fasterxml.jackson.annotation.JsonPropertyOrder; | |
| @JsonPropertyOrder({ "name", "surname", "shoesize", "gender" }) | |
| public class Person { | |
| public String name; | |
| public String surname; | |
| public int shoesize; |
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
| private java.time.ZonedDateTime convertJODADateTimeToJavaZonedDateTime(DateTime originDateTime, DateTimeZone originTimeZone) { | |
| if (originDateTime == null || originTimeZone == zone) { | |
| return null; | |
| } | |
| // Convert from JODA to Java 8 time | |
| java.time.ZonedDateTime newDateTime = java.time.ZonedDateTime.ofInstant( | |
| Instant.ofEpochMilli(originDateTime.getMillis()), java.time.ZoneId.of(zone.getID())); | |
| return newDateTime; |
NetworkManager supports WiFi powersaving but the function is rather undocumented.
From the source code: wifi.powersave can have the following value:
- NM_SETTING_WIRELESS_POWERSAVE_DEFAULT (0): use the default value
- NM_SETTING_WIRELESS_POWERSAVE_IGNORE (1): don't touch existing setting
- NM_SETTING_WIRELESS_POWERSAVE_DISABLE (2): disable powersave
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
| # import config. | |
| # You can change the default config with `make cnf="config_special.env" build` | |
| cnf ?= config.env | |
| include $(cnf) | |
| export $(shell sed 's/=.*//' $(cnf)) | |
| # import deploy config | |
| # You can change the default deploy config with `make cnf="deploy_special.env" release` | |
| dpl ?= deploy.env | |
| include $(dpl) |
If you are not interested in the technical details and only want to get Listen to work:
- If you are running Debian, RedHat, or another similar Linux distribution, run the following in a terminal:
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
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
| import imaplib2, time | |
| from threading import * | |
| # This is the threading object that does all the waiting on | |
| # the event | |
| class Idler(object): | |
| def __init__(self, conn): | |
| self.thread = Thread(target=self.idle) | |
| self.M = conn | |
| self.event = Event() |
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
| # ------------------------------------------------------------------ | |
| # | |
| # All possible options for your .nanorc file as documented in the | |
| # nanorc man page. | |
| # | |
| # ------------------------------------------------------------------ | |
| # When backing up files, allow the backup to succeed even if its per- | |
| # missions can't be (re)set due to special OS considerations. You |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
OlderNewer