Skip to content

Instantly share code, notes, and snippets.

View winwinashwin's full-sized avatar
sipping coffee

Ashwin A Nayar winwinashwin

sipping coffee
View GitHub Profile
@winwinashwin
winwinashwin / Instrumentor.hpp
Last active May 1, 2023 02:59 — forked from TheCherno/Instrumentor.h
Basic Instrumentation Profiler for C++ | Macro-fied
/**
* @file Instrumentor.hpp
*
* @brief Basic Instrumentation Profiler for C++ | Macro-fied
*
* Upon execution of profile macro embedded source code, all the profiling data
* is dumped to a JSON file compatible with Chrome Tracing tool. The JSON file can
* then be loaded to chrome tracing (chrome://tracing) to visualise the data.
*
* @author TheCherno (primary author)
@conrad784
conrad784 / read_nonblocking.py
Created December 14, 2018 15:50
nonblocking read function for python, e.g. for named pipes
def read_nonblocking(path, bufferSize=100, timeout=.100):
import time
"""
implementation of a non-blocking read
works with a named pipe or file
errno 11 occurs if pipe is still written too, wait until some data
is available
"""
grace = True
@Ahuge
Ahuge / Example Signals Multithreaded.py
Last active November 5, 2020 05:57
Basic Example of using a pure python Signal/Slot implementation talking between threads. Aims to feel like Qt's Signals.
# ------------------------------------------------------------------------------------------------------------ #
# --------------------------------------------- Signal Library ----------------------------------------------- #
# ------------------------------------------------------------------------------------------------------------ #
import weakref
class Signal(object):
def __init__(self, *types):
self._call_types = types
self._connections = set()

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream