Skip to content

Instantly share code, notes, and snippets.

View Shibabrat's full-sized avatar

Naik, Shibabrat Shibabrat

View GitHub Profile
@Shibabrat
Shibabrat / ssh-add.md
Created April 25, 2018 15:52 — forked from egoens/ssh-add.md
Use this if ssh key keeps asking for password
@Shibabrat
Shibabrat / randgsl.c
Created August 8, 2017 15:46 — forked from PhDP/randgsl.c
Random numbers with gsl
//: clang -DHAVE_INLINE -O3 randgsl.c -o randgsl -lgsl -lgslcblas
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_randist.h>
int main(int argc, const char *argv[])
@Shibabrat
Shibabrat / make_movies.m
Last active January 30, 2017 02:27
MATLAB segment for creating movies
%%% MAKE_MOVIES generates AVI movies in MATLAB by writing the
%data stored as frame. Adapted from the documentation at:
%https://www.mathworks.com/help/matlab/ref/videowriter.html
%Shibabrat Naik, Dated: 29th Jan, 2017
nFrames = 20;
% Preallocate movie structure.
mov(1:nFrames) = struct('cdata', [], ...
'colormap', []);
@Shibabrat
Shibabrat / install_pandoc.sh
Last active August 29, 2015 14:23
Install Pandoc MAC OS X Yosemite (Version 10.10.2)
# Tested on MAC OS X Yosemite (Version 10.10.2)
# Assumes LaTex is already installed using MacTex, otherwise follow:
# http://mirror.ctan.org/systems/mac/mactex/mactex-basic.pkg
# Ref: https://gist.github.com/schmurfy/3199254
# Install homebrew, if you haven't already
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew update
$ brew install ghc cabal-install
function save_matrix_as_ascii(matlabVec, asciiFilename, zoneHeaderText)
% FUNCTION to write the input matlab matrix as the input ASCII file and
% input zone header, only tested for matrix of size Nx2.
% Examples:
% save_matrix_as_ascii(sManifold, 's.n', 'VARIABLES="x""y"\nZone T="stable"\n')
% save_matrix_as_ascii(uManifold, 'u.n', 'VARIABLES="x""y"\nZone T="unstable"\n')
fid = fopen(asciiFilename,'w+') %success returns an interger
fprintf(fid,zoneHeaderText);