Skip to content

Instantly share code, notes, and snippets.

@summivox
summivox / tsconfig.json
Last active December 5, 2017 17:34
typescript
{
"compilerOptions": {
"outDir": "./lib",
"target": "es2017",
"module": "commonjs",
"declaration": true,
"strict": true,
"preserveConstEnums": true,
"sourceMap": true
},
@gnaggnoyil
gnaggnoyil / bia.hpp
Last active January 2, 2016 19:10
Binary Indexed Array
/*
Author: gnaggnoyil (gnaggnoyil at gmail.com)
License: WTFPL
*/
#ifndef _BIA_HPP_
#define _BIA_HPP_
#include <memory>
#include <utility>
#include <cstddef>
#define _GNU_SOURCE 1
#include <sched.h> // sched_setaffinity
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#include <stdint.h>
#include <pthread.h>
#include <assert.h>
#include <sys/time.h>
@koreno
koreno / README.md
Last active April 1, 2020 10:44
'rebaser' improves on 'git rebase -i' by adding information per commit regarding which files it touched.

Prebase

git-prebase improves on 'git rebase -i' by adding information per commit regarding which files it touched.

  • Each file gets an alpha-numeric identifier at a particular column, a list of which appears below the commit list. (The identifiers wrap around after the 62nd file)
  • Commits can be moved up and down safely (without conflicts) as long as their columns don't clash (they did not touch the same file).

Installation

Add the executable to your path and git will automatically expose it as

@imneme
imneme / randutils.hpp
Last active March 28, 2024 20:43
Addresses common issues with C++11 random number generation; makes good seeding easier, and makes using RNGs easy while retaining all the power.
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015-2022 Melissa E. O'Neill
*
@kachayev
kachayev / concurrency-in-go.md
Last active March 11, 2024 11:27
Channels Are Not Enough or Why Pipelining Is Not That Easy
@staltz
staltz / introrx.md
Last active May 23, 2024 20:07
The introduction to Reactive Programming you've been missing
#!/bin/bash -e
# $File: setup-ipv6.sh
# $Date: Fri Mar 07 13:00:05 2014 +0800
# $Author: jiakai <jia.kai66@gmail.com>
PREFIX='2402:f000:1:1501:200:5efe'
ADDR_LOCAL=$(ip r g 8.8.8.8 | grep src | awk '{print $7}')
ADDR_OUT=$(curl ifconfig.me)
ADDR_REMOTE='166.111.21.1'
@Wizmann
Wizmann / xiami_cracker.py
Last active December 16, 2015 18:21
下载虾米音乐
# coding=utf-8
import gevent
import gevent.monkey
gevent.monkey.patch_all()
import gevent.queue
import requests
import sys
import re
import os
// ==UserScript==
// @name Test Window 27
// @namespace http://use.i.E.your.homepage/
// @version 0.2
// @description enter something useful
// @match http://tampermonkey.net/test/jquery.html
// @run-at document-body
// @copyright 2012+, You
// ==/UserScript==