Skip to content

Instantly share code, notes, and snippets.

View subhadipghs's full-sized avatar
👨‍💻

Subhadip Ghosh subhadipghs

👨‍💻
View GitHub Profile
@hagino3000
hagino3000 / client.js
Created December 8, 2011 18:42
WebSocket with binary data
var socket = null;
function bootstrap() {
// 適当な図形を描画
var c = document.getElementById('mycanvas');
var ctx = c.getContext('2d');
ctx.globalalpha = 0.3;
for(var i=0; i<1000; i++) {
ctx.beginPath();
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@facultymatt
facultymatt / roles_invesitgation.md
Last active April 16, 2024 09:31
Roles and permissions system for Nodejs
@staltz
staltz / introrx.md
Last active March 9, 2025 05:06
The introduction to Reactive Programming you've been missing
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active March 9, 2025 22:47
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@r-lyeh-archived
r-lyeh-archived / gc.cpp
Last active September 24, 2024 15:10
C++ Garbage Collection
/*/
C++ Garbage Collection Library
==============================
This is a library to manage memory in C++ programs using a garbage
collector. It uses a mark and sweep algorithm.
All objects that are to be managed by the collector should be derived
from GCObject:
@vasanthk
vasanthk / System Design.md
Last active March 6, 2025 11:22
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@rccursach
rccursach / Gemfile
Last active October 4, 2023 13:08 — forked from daqing/Gemfile
redis_pubsub_demo.rb
source "https://rubygems.org"
gem 'eventmachine'
gem 'sinatra'
gem 'yajl-ruby', require: 'yajl'
gem 'thin'
gem 'em-websocket'
@wojteklu
wojteklu / clean_code.md
Last active March 10, 2025 11:42
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules