Skip to content

Instantly share code, notes, and snippets.

View Midnoclose's full-sized avatar

Midnoclose Midnoclose

View GitHub Profile
@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);
@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;
@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
@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
@bkaradzic
bkaradzic / orthodoxc++.md
Last active April 25, 2025 00:16
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@omaraboumrad
omaraboumrad / wiki.md
Last active March 23, 2025 19:19
How to contribute to a GitHub Project's Wiki

Setup

Assuming project is SOME/PROJECT And you are FOO

You will need to do the following one time only:

@jblang
jblang / C64.md
Last active April 26, 2025 12:47
C64 Resources

Emulators

VICE is the best by such a commanding margin that you really needn't look elsewhere. Open source and has the largest community.

However, other options are:

  • CCS64, Lots of features, but I found it to be painfully slow. Shareware.
  • Hoxs64. Decent, but not as full-featured as VICE. The ML monitor seems nice.
  • Frodo is pretty outdated and the author admits as much.
  • micro64 seems promising but incomplete.
@CherryDT
CherryDT / registry_standalone.bi
Created January 17, 2017 17:17
Simplified Windows registry reader/writer library for FreeBasic
' By David "Cherry" Trapp (2009)
' Fork of RegLib by porfirio: http://www.freebasic.net/forum/viewtopic.php?t=7072
Namespace RegObj
#Define REG_KEY_NOT_EXIST "REG_KEY_NOT_EXIST"
#Define REG_KEY_INVALID "REG_KEY_INVALID"
Type RegLib
Declare Constructor(root As HKEY,Key As String, create As Boolean=false, acc As Integer = KEY_ALL_ACCESS)
@jspanos71
jspanos71 / OptiFine in MultiMC
Last active February 28, 2025 08:58
How to install OptiFine in MultiMC
The OptiFine installer requires that MC be installed in the default launcher and has opened the version of MC at least once. Do this first.
1. Download OptiFine
2. Extract OptiFine
a. Double click the download from step 1
b. Click Extract button
c. Navigate to MultiMC instance you wish to install OptiFine into (C:\mc\MultiMC\instances\1.13\.minecraft\)
3. Move extracted Optifine to instance \ libraries folder (C:\mc\MultiMC\instances\1.13\libraries\)
4. In MultiMC edit instance, go to Version screen and select the Minecraft entry in the list. Then click Add to Minecraft.jar
5. Select the OptiFine file you extracted and moved in step 3.
@ityonemo
ityonemo / test.md
Last active April 29, 2025 08:28
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)