Skip to content

Instantly share code, notes, and snippets.

View nnarain's full-sized avatar
🚀
Heya!

Natesh Narain nnarain

🚀
Heya!
View GitHub Profile
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('-S', '--mystring', help='a string')
parser.add_argument('-I', '--myint', type=int, help='an integer')
parser.add_argument('-R', '--recursive', action='store_true', help='set recursive mode')
parser.add_argument('-T', '--something-else', required=True, help='some other switch')
args = vars(parser.parse_args())
@nnarain
nnarain / CMakeLists.txt
Last active February 4, 2016 02:53
Generic CMake file
#
# Generic CmakeList file
#
# @author Natesh Narain
cmake_minimum_required(VERSION 2.8)
project(MyProject)
@nnarain
nnarain / rlencoding.cpp
Created November 10, 2014 19:12
Run Length Encoding
/**
@file rlencoding.cpp
@breif Run Length Encode and Decode
@author Natesh Narain
*/
#include "rlencoding.h"
int rlencode(uint8_t *inBuffer, int inLen, uint8_t *outBuffer, int outLen, uint8_t esc)
{
@nnarain
nnarain / basic.frag
Created November 10, 2014 19:10
Basic OpenGL 3.1 Shaders
// Basic OpenGL Shaders
out vec3 fragColor;
in vec3 wsVertexPosition;
in vec3 msFragNormal;
uniform mat4 M;
uniform mat4 V;
uniform mat4 MVP;
@nnarain
nnarain / bitopts.h
Last active August 29, 2015 14:07
Macros for handy bitwise operations
/**
Bit operation macros
@author Natesh Narain
@since July 12 2014
*/
#ifndef BITOPTS
#define BITOPTS