Skip to content

Instantly share code, notes, and snippets.

View Himujjal's full-sized avatar
🏠
Working from home

Himujjal Upadhyaya Himujjal

🏠
Working from home
View GitHub Profile
@Himujjal
Himujjal / base64ArrayBuffer.js
Created October 11, 2022 13:53 — forked from jonleighton/base64ArrayBuffer.js
Encode an ArrayBuffer as a base64 string
// Converts an ArrayBuffer directly to base64, without any intermediate 'convert to string then
// use window.btoa' step. According to my tests, this appears to be a faster approach:
// http://jsperf.com/encoding-xhr-image-data/5
/*
MIT LICENSE
Copyright 2011 Jon Leighton
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@Himujjal
Himujjal / hash.c
Created January 6, 2021 17:03 — forked from tonious/hash.c
A quick hashtable implementation in c.
/* Read this comment first: https://gist.github.com/tonious/1377667#gistcomment-2277101
* 2017-12-05
*
* -- T.
*/
#define _XOPEN_SOURCE 500 /* Enable certain library functions (strdup) on linux. See feature_test_macros(7) */
#include <stdlib.h>
#include <stdio.h>
@Himujjal
Himujjal / ANSI.md
Created January 3, 2021 15:39 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
@Himujjal
Himujjal / languages-and-vms.md
Created November 23, 2020 14:24 — forked from haxscramper/languages-and-vms.md
languages-and-vms

Language & VM design

Lexing & parsing

Writing own parser

  1. nimly - Lexer Generator and Parser Generator as a Library in Nim.

    With nimly, you can make lexer/parser by writing definition in formats like lex/yacc. nimly generates lexer and parser by using macro in compile-time, so you can use nimly not as external tool of your program but as a library.

@Himujjal
Himujjal / init.vim
Last active July 19, 2020 17:16 — forked from benawad/init.vim
My nvim setup
call plug#begin('~/AppData/Local/nvim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'
Plug 'ctrlpvim/ctrlp.vim' " fuzzy find files
Plug 'scrooloose/nerdcommenter'
to check if the server works - https://webrtc.github.io/samples/src/content/peerconnection/trickle-ice
stun:
stun.l.google.com:19302,
stun1.l.google.com:19302,
stun2.l.google.com:19302,
stun3.l.google.com:19302,
stun4.l.google.com:19302,
stun.ekiga.net,
stun.ideasip.com,
@Himujjal
Himujjal / stuns
Created May 27, 2020 10:02 — forked from zziuni/stuns
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@Himujjal
Himujjal / The Technical Interview Cheat Sheet.md
Created June 19, 2019 15:44 — forked from prashant-shahi/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Big-O Complexity Chart

Data Structure Basics

Common Data Structure operations

@Himujjal
Himujjal / is-private-mode.js
Created July 24, 2018 06:23 — forked from jherax/is-private-mode.js
Detect if a browser is in Private Browsing mode
/**
* Detect if the browser is running in Private Browsing mode
*
* @export
* @returns {Promise}
*/
export default function isPrivateMode() {
return new Promise((resolve) => {
const on = () => resolve(true); // is in private mode
const off = () => resolve(false); // not private mode