Skip to content

Instantly share code, notes, and snippets.

Working from home

Kris Mulyandani P. krismp

Working from home
View GitHub Profile
krismp / quicksort.c
Created Mar 13, 2019
Non randomized quicksort
View quicksort.c
/* C implementation QuickSort */
// A utility function to swap two elements
void swap(int* a, int* b)
int t = *a;
*a = *b;
*b = t;
krismp / randomize_quicksort.cpp
Created Mar 13, 2019
Randomize Quicksort Algorithm
View randomize_quicksort.cpp
/* C++ implementation QuickSort using Lomuto's partition
#include <cstdlib>
#include <iostream>
using namespace std;
/* This function takes last element as pivot, places
the pivot element at its correct position in sorted
array, and places all smaller (smaller than pivot)
to left of pivot and all greater elements to right
View gather-to-all.c
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int numnodes;
int main(int argc, char* argv[])
int rank;
int *back_array;
int i,data;
View collective_scatter_and_gather.c
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
int numnodes;
int main(int argc, char* argv[])
int rank;
int *myray,*send_array,*back_array;
int count;
krismp /
Created Jan 11, 2017 — forked from staltz/
The introduction to Reactive Programming you've been missing
krismp / gulpfile.js
Created Sep 10, 2016 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
View gulpfile.js
var gulp = require('gulp');
var sourcemaps = require('gulp-sourcemaps');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var browserify = require('browserify');
var watchify = require('watchify');
var babel = require('babelify');
function compile(watch) {
var bundler = watchify(browserify('./src/index.js', { debug: true }).transform(babel));
krismp / Install Composer using MAMP's
Created Aug 27, 2016 — forked from irazasyed/Install Composer using MAMP's
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management
View Install Composer using MAMP's

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management

Instructions to Change PHP Installation

First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php
krismp / gist:43fa6b50448b54b06cf1
Created Sep 17, 2015
install pg gem on Mac OSX
View gist:43fa6b50448b54b06cf1
gem install pg -- --with-pg-config=/Applications/
Note: in newer versions (in 9.4 at least) the path is actually: /Applications/
View gist:57edef1cd11a0642dbb7
look process:
`lsof -i :<PORT NUMBER>
kill process
`kill -9 <PID>`

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C ""