View generate-pushid.js
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
View git-cheat-list.md

Git cheat list

  • all commits that your branch have that are not yet in master

    git log master..<HERE_COMES_YOUR_BRANCH_NAME>
    
  • setting up a character used for comments

    git config core.commentchar <HERE_COMES_YOUR_COMMENT_CHAR>
    
View type-inference.cpp
int original = 42;
decltype(original) copy = original;
decltype((original)) reference = original;
original = 1729;
std::cout << copy << std::endl; // 42
std::cout << reference << std::endl; // 1729
View cars.cpp
#define _CRT_SECURE_NO_WARNINGS
#include <vector>
#include <memory>
#include <future>
#include <stdio.h>
#include <assert.h>
#include <time.h>
#include <stdint.h>
View RLE0DifEncoder.cpp
#include "RLE0DifEncoder.h"
#include <cassert>
#include <stdint.h>
#include <memory>
#include <stdexcept>
///////////////////////////////////////////////////////////////////////////////
namespace matise {
namespace journal {
View TestClrMD.cs
// TODO: encapsulate runtime session, store heap, common general purpose types, stats, etc.
static ClrRuntime _runtime;
void Main()
{
DataTarget _target = DataTarget.LoadCrashDump("C:\\Temp\\MEM.DMP");
_target.SetSymbolPath(Environment.GetEnvironmentVariable("_NT_SYMBOL_PATH"));
var clrVer = _target.ClrVersions[0];
string dac = clrVer.TryGetDacLocation();
View gist:fb115ffdaa4e9bbd66f1c68b60bd2d3b
#ifndef UNICODE
#define UNICODE
#endif
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#include <Ws2tcpip.h>
#include <stdio.h>
View asynch-echo-inc.c
#undef UNICODE
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdlib.h>
#include <stdio.h>
View InheritGenericClass.cs
using System;
public class GenericClass<T> {
public virtual void Method (T value) {
Console.WriteLine("GenericClass<{0}>.Method({1})", typeof(T), value);
}
}
public class MyClass<T> : GenericClass<T> {
public override void Method (T value) {
View getopt.c
/* Getopt for GNU.
NOTE: getopt is now part of the C library, so if you don't know what
"Keep this file name-space clean" means, talk to drepper@gnu.org
before changing it!
Copyright (C) 1987,88,89,90,91,92,93,94,95,96,98,99,2000,2001
Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public