Skip to content

Instantly share code, notes, and snippets.

@current1990
current1990 / main.go
Created April 11, 2020 15:02
remove json fields
package main
import (
"os"
"encoding/json"
"io/ioutil"
"fmt"
"strings"
)
@current1990
current1990 / test.py
Created June 20, 2018 04:12
nonblocking connect
import socket
import select
import errno
s = socket.socket()
s.setblocking(0)
try:
s.connect(('14.215.177.39', 80))
@current1990
current1990 / TimeMeasure.cc
Created August 15, 2016 10:23
cpp11 function running time measurement
class TimeMeasure
{
public:
TimeMeasure(const std::string& name) :
name_(name),
start_time(std::chrono::high_resolution_clock::now())
{
}
~TimeMeasure()
{

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@current1990
current1990 / const.py
Created January 27, 2015 04:16
python constant
__author__ = 'current'
import sys
class Const(object):
class ConstError(TypeError): pass
def __setattr__(self, key, value):
if self.__dict__.has_key(key):