Skip to content

Instantly share code, notes, and snippets.

@PaulStovell
PaulStovell / Test.cs
Created November 2, 2011 18:33
SHA512Managed is not thread safe
static void Main(string[] args)
{
var hashAlgorithm = SHA512.Create();
var text = "Hello world";
var bytes = Encoding.Default.GetBytes(text);
var hashes = new List<string>();
Parallel.For(0, 10000, ignored =>
@jboner
jboner / latency.txt
Last active June 3, 2024 13:21
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@digitaljhelms
digitaljhelms / gist:4287848
Last active May 25, 2024 22:25
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@davidroth
davidroth / FastImportRewriter.cs
Last active February 1, 2020 16:06
Fast-Import / Fast-Export Rewriter to migrate bazaar bugtracking metdata properties to git. More infos: http://www.fusonic.net/en/blog/migrating-from-bazaar-to-git/ Licence: Mit X11 / BSD
// Fast-Import / Fast-Export Rewriter to migrate bazaar bugtracking metdata properties to git.
// More infos: http://www.fusonic.net/en/blog/migrating-from-bazaar-to-git/
// Licence: Mit X11 / BSD
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Text;
using System.Diagnostics;
using System.Collections.Generic;
@emiller
emiller / git-mv-with-history
Last active April 17, 2024 21:06
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@MarcDiethelm
MarcDiethelm / Contributing.md
Last active May 1, 2024 18:06
How to contribute to a project on Github

This text now lives at https://github.com/MarcDiethelm/contributing/blob/master/README.md. I turned it into a Github repo so you can, you know, contribute to it by making pull requests.


Contributing

If you want to contribute to a project and make it better, your help is very welcome. Contributing is also a great way to learn more about social coding on Github, new technologies and and their ecosystems and how to make constructive, helpful bug reports, feature requests and the noblest of all contributions: a good, clean pull request.

@valm
valm / TPL DataFlow and Reactive Extensions Examples
Created November 14, 2013 14:04
TPL DataFlow and Reactive Extensions Example
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reactive.Linq;
using System.Text;
using System.Threading;
@topheman
topheman / git-notes.md
Created June 29, 2015 17:39
Git notes cheat sheet
@xvitaly
xvitaly / remove_crw.cmd
Last active March 16, 2024 16:12
Remove telemetry updates for Windows 7 and 8.1
@echo off
echo Uninstalling KB3075249 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3075249 /quiet /norestart
echo Uninstalling KB3080149 (telemetry for Win7/8.1)
start /w wusa.exe /uninstall /kb:3080149 /quiet /norestart
echo Uninstalling KB3021917 (telemetry for Win7)
start /w wusa.exe /uninstall /kb:3021917 /quiet /norestart
echo Uninstalling KB3022345 (telemetry)
start /w wusa.exe /uninstall /kb:3022345 /quiet /norestart
echo Uninstalling KB3068708 (telemetry)
@peter-leonov
peter-leonov / bomb.sh
Last active November 22, 2019 03:46
docker fork bomb
docker run ruby ruby -e 'loop { fork { fork { sleep 0.1 } } }'