Skip to content

Instantly share code, notes, and snippets.

View freakynit's full-sized avatar

Nitin Bansal freakynit

View GitHub Profile
// ref.: https://medium.freecodecamp.org/node-js-streams-everything-you-need-to-know-c9141306be93
var stream = require('stream');
var Writable = stream.Writable;
var Readable = stream.Readable;
var Duplex = stream.Duplex;
var Transform = stream.Transform;
function consoleWriterStream(){
var writeStream = new Writable({
@freakynit
freakynit / spectre.c
Created January 11, 2018 18:48 — forked from ErikAugust/spectre.c
Spectre example code
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#ifdef _MSC_VER
#include <intrin.h> /* for rdtscp and clflush */
#pragma optimize("gt",on)
#else
#include <x86intrin.h> /* for rdtscp and clflush */
#endif

Keybase proof

I hereby claim:

  • I am freakynit on github.
  • I am freakynit (https://keybase.io/freakynit) on keybase.
  • I have a public key ASC547gzzrHjkkBPb-L9g2dY3-FKdaiDcv54Mhe1u7kboAo

To claim this, I am signing this object:

@freakynit
freakynit / LetsEncrypt.md
Created May 24, 2017 11:29 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
@freakynit
freakynit / tmux-cheatsheet.markdown
Created April 16, 2017 11:20 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@freakynit
freakynit / init.d-script.sh
Created February 15, 2017 12:22 — forked from orrsella/init.d-script.sh
Init.d Script
#!/bin/bash
START_SCRIPT={{ start_script }}
PID_FILE={{ pid_file }}
# ***********************************************
# ***********************************************
ARGS="" # optional start script arguments
DAEMON=$START_SCRIPT
@freakynit
freakynit / ANestObject.json
Created December 10, 2016 10:10 — forked from varunachar/ANestObject.json
Google Gson TypeAdapterFactory to use with Retrofit when the the object is nested inside another object (Typically an object which contains status code etc) and when the root changes per object like shown below in the sample ANestedObject.json. Then you can use Retrofit normally! Enjoy
// Root is hotel
{
status : "ok",
statusCode : 200,
hotels : [{
name : "Taj Palace",
location : {
lat : 12
lng : 77
var PORT = 9999;
var express = require('express');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
@freakynit
freakynit / 0_reuse_code.js
Created August 13, 2016 08:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@freakynit
freakynit / gitflow-breakdown.md
Created June 16, 2016 11:07 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository