Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block adenosinew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
adenosinew / fileExistence.go
Created Apr 1, 2020
[os.IsExist and os.IsNotExist] #go #file
View fileExistence.go
Watch out, os.IsExist(err) != !os.IsNotExist(err)
They are error checkers, so use them only when err != nil, and you want to handle
specific errors in a different way!
Their main purpose is to wrap around OS error messages for you, so you don't have to test
for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and
"file does not exist/directory does not exist"
adenosinew / mytimer.timer
Last active Mar 9, 2020
[Set up timer] #linux
View mytimer.timer
Description=Runs mytimer every hour
adenosinew /
Created Feb 26, 2020
[read and write a json] #python
# string:
import json
# json.loads(string)
print ( json.loads(open("in.json","r").read() ) )
import json
# json.load(_io)
print( json.load(open("in.json","r")) )
adenosinew / simple-timing.go
Last active Feb 24, 2020
[Measuring execution time] #golang
View simple-timing.go
package main
import (
func main() {
start := time.Now()
View lsyncd.conf.lua
adenosinew /
Created Dec 18, 2019
[Github Management]
systemctl is-active --quiet <service> && echo <service> is running
adenosinew /
Last active Nov 27, 2019
[Linux benchmarks]
# Installation
sudo apt-get install stress
yum install stress
# Usage
git for-each-ref --sort=-committerdate refs/heads/
# Or using git branch (since version 2.7.0)
git branch --sort=-committerdate # DESC
git branch --sort=committerdate # ASC
You can’t perform that action at this time.