Skip to content

Instantly share code, notes, and snippets.

View m-esm's full-sized avatar
https://calendly.com/m-esm/coffee-chat

Mohsen Esmaeili m-esm

https://calendly.com/m-esm/coffee-chat
View GitHub Profile
@m-esm
m-esm / README.md
Created April 29, 2024 21:22 — forked from serdaradali/README.md
Interactive world globe

Zoomable/rotatable world globe that uses orthographic projection. Drag behavior is enhanced as described here: https://www.jasondavies.com/maps/rotate/

Performance is not good due to redrawing whole world upon zoom/drag.

@m-esm
m-esm / gist:1a01d9ac6e0eb12ea0587eef6dc088e8
Created August 14, 2020 23:47 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@m-esm
m-esm / crypto-stream.js
Created February 6, 2020 23:34 — forked from chris-rock/crypto-stream.js
Encrypt and decrypt streams
// Part of https://github.com/chris-rock/node-crypto-examples
// Nodejs encryption of buffers
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
var fs = require('fs');
var zlib = require('zlib');
@m-esm
m-esm / tmux_cheatsheet.markdown
Created September 6, 2019 15:50 — forked from henrik/tmux_cheatsheet.markdown
tmux cheatsheet

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@m-esm
m-esm / LimitStream.js
Created June 29, 2019 10:08 — forked from 4poc/LimitStream.js
Node.js: LimitStream (Bandwidth limited Readable+Writable Stream)
var fs = require('fs'),
util = require('util'),
Stream = require('stream').Stream;
/**
* Create a bandwidth limited stream
*
* This is a read+writeable stream that can limit how fast it
* is written onto by emitting pause and resume events to
* maintain a specified bandwidth limit, that limit can
@m-esm
m-esm / memorySizeOfObject.js
Created April 13, 2019 09:20
calculate memory size of javascript object, it is not a accurate value!
function memorySizeOf(obj) {
var bytes = 0;
function sizeOf(obj) {
if(obj !== null && obj !== undefined) {
switch(typeof obj) {
case 'number':
bytes += 8;
break;
case 'string':
@m-esm
m-esm / nodejs-tcp-example.js
Created February 10, 2019 16:59 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');