Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Kris Mulyandani P. krismp

  • East Blue
Block or report user

Report or block krismp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@krismp
krismp / quicksort.c
Created Mar 13, 2019
Non randomized quicksort
View quicksort.c
/* 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 Mar 13, 2019
Randomize Quicksort Algorithm
View randomize_quicksort.cpp
/* 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
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
krismp / introrx.md
Created Jan 11, 2017 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
@krismp
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
krismp / Install Composer using MAMP's PHP.md
Created Aug 27, 2016 — 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
View Install Composer using MAMP's PHP.md

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 Sep 17, 2015
install pg gem on Mac OSX
View gist:43fa6b50448b54b06cf1
```
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
```
View gist:57edef1cd11a0642dbb7
look process:
`lsof -i :<PORT NUMBER>
kill process
`kill -9 <PID>`
View multiple_ssh_setting.md

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"
You can’t perform that action at this time.