Skip to content

Instantly share code, notes, and snippets.

View codenirvana's full-sized avatar
[object Object]

Udit Vasu codenirvana

[object Object]
View GitHub Profile
@codenirvana
codenirvana / Responsive-Social-Icons.markdown
Created December 25, 2014 05:33
Responsive Social Icons
@codenirvana
codenirvana / notify-send with sound
Created June 21, 2015 05:37
New email notify-send notification with sound
notify-send -u normal -i /usr/share/icons/Paper/64x64/apps/email.png "New Email" "${USER^} you have a new email!" && paplay /usr/share/sounds/freedesktop/stereo/message-new-instant.oga
@codenirvana
codenirvana / main.cpp
Created September 23, 2015 11:20
C++ Template for Competitive Programming
/* Udit | CodeNirvana */
#include <bits/stdc++.h>
using namespace std;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
@codenirvana
codenirvana / Quack & Hack Links.md
Last active February 2, 2016 18:31
DuckDuckGo Global Global Quack & Hack 2 - Quick Links
@codenirvana
codenirvana / echo.js
Created August 10, 2018 10:09
Simple HTTP Echo Server in Node.js
require('http')
.createServer((req, res) => req.pipe(res))
.listen(8080);
@codenirvana
codenirvana / rawResponse.js
Created August 13, 2018 11:22
Node.js Dump Raw HTTP Response
const http = require('http');
const server = http.createServer();
server.on('connection', (socket) => {
socket.end(`HTTP/1.1 204 No Content
Content-Length: 12
Content-Type: text/plain
Hello World!`);
});
@codenirvana
codenirvana / rawEcho.js
Created February 25, 2019 02:38
Simple RAW HTTP Echo Server in Node.js
const net = require('net');
net.createServer(function (socket) {
socket.on('data', function (chunk) {
socket.write('HTTP/1.1 200 Ok\r\n');
socket.write('\r\n');
socket.write(chunk.toString());
socket.end();
});
}).listen(3000);

Keybase proof

I hereby claim:

  • I am codenirvana on github.
  • I am codenirvana (https://keybase.io/codenirvana) on keybase.
  • I have a public key ASBP2UHdme1PtmOoDChk0QZvSfTQz65VKT_aSMmkgR0Ojwo

To claim this, I am signing this object:

@codenirvana
codenirvana / a==1 && a==2 && a==3.js
Last active January 6, 2020 19:34
a==1 && a==2 && a==3
const a = {
value : 0,
valueOf: () => ++a.value
};
@codenirvana
codenirvana / a===1 && a===2 && a===3.js
Last active January 6, 2020 19:33
a===1 && a===2 && a===3
this.value = 0; // global, window, or globalThis ¯\_(ツ)_/¯
Object.defineProperty(this, 'a', {
get: () => ++this.value
});