Skip to content

Instantly share code, notes, and snippets.

View Midnoclose's full-sized avatar

Midnoclose Midnoclose

View GitHub Profile
@azmfaridee
azmfaridee / iscii2unicode.py
Created June 3, 2013 07:44
ISCII to Unicode Converter Script
#!/usr/bin/env python
# released under BSD License
# mary <[email protected]> aka meyarivan <[email protected]>
# inspired by ICU [ http://oss.software.ibm.com/icu/ ]
# code still in alpha stage.. lots of redundant code.. and probably incorrect
# if ya find errors, pls submit bug reports at indlinux
@jboner
jboner / latency.txt
Last active April 29, 2025 15:40
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
@martinsik
martinsik / chat-frontend.js
Last active March 22, 2025 16:43
Node.js chat frontend and server
$(function () {
"use strict";
// for better performance - to avoid searching in DOM
var content = $('#content');
var input = $('#input');
var status = $('#status');
// my color assigned by the server
var myColor = false;
@ryanflorence
ryanflorence / static_server.js
Last active February 27, 2025 06:28
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);