Skip to content

Instantly share code, notes, and snippets.

@smsohan
smsohan / CSharpAsyncAwait.cs
Created September 16, 2011 22:11
C# async and await example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading.Tasks;
namespace AsyncCSharp
{
class Program
@jboner
jboner / latency.txt
Last active July 23, 2024 10:32
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
@nicolsc
nicolsc / hex2ascii2hex.js
Created April 10, 2015 16:14
JS hex/ascii
//Thanks stackoverflow
//http://stackoverflow.com/questions/3745666/how-to-convert-from-hex-to-ascii-in-javascript
function a2hex(str) {
var arr = [];
for (var i = 0, l = str.length; i < l; i ++) {
var hex = Number(str.charCodeAt(i)).toString(16);
arr.push(hex);
}
return arr.join('');
@yasinkuyu
yasinkuyu / agGrid-tr.js
Created November 27, 2018 23:14
ag-Grid Türkçe/Turkish
var localeTextTR = {
// for filter panel
page: 'Sayfa',
more: 'Devamı',
to: 'To',
of: 'Of',
next: 'İleri',
last: 'Son',
first: 'İlk',
previous: 'Sonraki',