This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Threading; | |
public static class CodeTimer | |
{ | |
public static void Initialize() | |
{ | |
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// written by Dean Edwards, 2005 | |
// with input from Tino Zijdel, Matthias Miller, Diego Perini | |
// http://dean.edwards.name/weblog/2005/10/add-event/ | |
function addEvent(element, type, handler) { | |
if (element.addEventListener) { | |
element.addEventListener(type, handler, false); | |
} else { | |
// assign each event handler a unique ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import configparser | |
class DatabaseFactory(object): | |
def __init__(self, filename, encoding=None): | |
"""instantiate with configuration filename""" | |
self._cache = dict() | |
self._servers = configparser.ConfigParser() | |
self._servers.read(filename, encoding) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Stephen Toub | |
// stoub@microsoft.com | |
// | |
// ManagedThreadPool.cs | |
// ThreadPool written in 100% managed code. Mimics the core functionality of | |
// the System.Threading.ThreadPool class. | |
// | |
// HISTORY: | |
// v1.0.1 - Disposes of items remaining in queue when the queue is emptied | |
// - Catches errors thrown during execution of delegates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Collections.ObjectModel; | |
using System.ComponentModel; | |
using System.Reflection; | |
using System.Runtime.InteropServices; | |
using System.Runtime.Serialization; | |
using System.Security; | |
using System.Text.RegularExpressions; | |
using System.Linq; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# deploy project script. | |
# make sure /usr/local/etc/deployment.key permissions is 600. | |
# this is required to open it. | |
set -e | |
build= | |
revision=HEAD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm | |
rpm -Uhv epel-release-latest-6.noarch.rpm | |
yum clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://arxiv.org/ftp/arxiv/papers/1406/1406.2294.pdf | |
int32_t JumpConsistentHash(uint64_t key, int32_t num_buckets) { | |
int64_t b = -1, j = 0; | |
while (j < num_buckets) { | |
b = j; | |
key = key * 2862933555777941757ULL + 1; | |
j = (b + 1) * (double(1LL << 31) / double((key >> 33) + 1)); | |
} | |
return b; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem == CreatePartitions-UEFI.txt == | |
rem == These commands are used with DiskPart to | |
rem create five partitions | |
rem for a UEFI/GPT-based PC. | |
rem Adjust the partition sizes to fill the drive | |
rem as necessary. == | |
select disk 0 | |
clean | |
convert gpt | |
rem == 1. Windows RE tools partition =============== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"jsx": "react", | |
"moduleResolution": "node", | |
"module": "commonjs", | |
"experimentalDecorators": true, | |
"target": "es5", | |
"lib": [ | |
"es5", | |
"scripthost", |
OlderNewer