Skip to content

Instantly share code, notes, and snippets.

@muendelezaji
muendelezaji / bash-to-zsh-hist.py
Created October 5, 2016 14:18 — forked from op/bash-history-to-zsh-history.py
Convert Bash history to Zsh history
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This is how I used it:
# $ cat ~/.bash_history | python bash-to-zsh-hist.py >> ~/.zsh_history
import sys
import time
@muendelezaji
muendelezaji / page.html
Last active November 21, 2016 06:09
Exponential backoff strategy for a generic asynchronous function call
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Retry with Backoff</title>
</head>
<body>
<pre id="result"></pre>
</body>
</html>
@muendelezaji
muendelezaji / struct-pointer-array.cpp
Last active June 15, 2016 01:25
Converting an array of struct pointers to a generic int pointer and recovering original structs from it. May or may not have been used to settle an argument or two ;)
// Coliru - http://coliru.stacked-crooked.com/a/655f184e31f1e779
#include <iostream>
using std::size_t;
using std::string;
using std::ostream;
using std::cout;
using std::endl;
using std::boolalpha;
@muendelezaji
muendelezaji / pre-commit-clang-format.sh
Last active April 5, 2016 09:56
Git hook to re-format code on commit
#!/bin/bash
#
# git pre-commit hook that runs a clang-format stylecheck.
#
# This file is part of a set of unofficial pre-commit hooks available
# at github.
# Link: https://github.com/githubbrowser/Pre-commit-hooks
# Contact: David Martin, [email protected]
#
# Modifications for clang-format by [email protected]