Skip to content

Instantly share code, notes, and snippets.

View krismp's full-sized avatar
🏠
Working from home

Kris Mulyandani P. krismp

🏠
Working from home
View GitHub Profile
@krismp
krismp / quicksort.c
Created March 13, 2019 05:44
Non randomized quicksort
/* C implementation QuickSort */
#include<stdio.h>
// A utility function to swap two elements
void swap(int* a, int* b)
{
int t = *a;
*a = *b;
*b = t;
}
@krismp
krismp / randomize_quicksort.cpp
Created March 13, 2019 05:42
Randomize Quicksort Algorithm
/* C++ implementation QuickSort using Lomuto's partition
Scheme.*/
#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
@krismp
krismp / gather-to-all.c
Created March 12, 2019 04:25
Gather to all
#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;
#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;
look process:
`lsof -i :<PORT NUMBER>
kill process
`kill -9 <PID>`
@krismp
krismp / introrx.md
Created January 11, 2017 07:33 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@krismp
krismp / gulpfile.js
Created September 10, 2016 00:24 — forked from danharper/gulpfile.js
New ES6 project with Babel, Browserify & Gulp
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
krismp / Install Composer using MAMP's PHP.md
Created August 27, 2016 01:27 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

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
krismp / gist:43fa6b50448b54b06cf1
Created September 17, 2015 01:16
install pg gem on Mac OSX
```
gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Note: in newer versions (in 9.4 at least) the path is actually: /Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config
```

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 "your_email@youremail.com"