Skip to content

Instantly share code, notes, and snippets.

View priiduneemre's full-sized avatar
🐺

Priidu Neemre priiduneemre

🐺
View GitHub Profile
@santiaago
santiaago / sortByDate.go
Last active May 16, 2025 16:06
Sorting an array of dates in Go
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")
@asafary
asafary / Person.java
Last active April 30, 2024 11:36
Example of how to read a Pojo from a CSV file using Jackson JSON Processor
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;
@petertodd
petertodd / gist:8e87c782bdf342ef18fb
Last active December 13, 2020 05:33
What the CoinWallet.eu tx-flood stress-test means for you and how to deal with it
@tparton42
tparton42 / Java8-JodaDateTime-To-TimeZonedDateTime.java
Last active January 28, 2020 20:01
Java 8: Convert JODA DateTime to Java Time.ZonedDateTime
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;
@jcberthon
jcberthon / networkmanager-wifi-powersave.md
Last active December 30, 2025 09:57
NetworkManager Wi-Fi powersaving configuration

NetworkManager WiFi Power Saving

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
@mpneuried
mpneuried / Makefile
Last active August 29, 2025 08:17
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# 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)
@ntamvl
ntamvl / Increasing-the-amount-of-inotify-watchers.md
Created August 16, 2017 03:10
Increasing the amount of inotify watchers

Increasing the amount of inotify watchers

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
@thomaswieland
thomaswieland / gist:3cac92843896040b11c4635f7bf61cfb
Created February 17, 2018 13:56
Python: IMAP IDLE with imaplib2
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()
@yochem
yochem / .nanorc
Created May 11, 2018 11:13
All options for your .nanorc file
# ------------------------------------------------------------------
#
# 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
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 2, 2026 06:47
Conventional Commits Cheatsheet