Have [SBT plugin][sbt-plugin] installed
- [Create a new project][create-project] in IDEA ( File > New Project ...)
- Make sure you select a maven module
| /* Takes a list of int args to sort */ | |
| #include <stdio.h> | |
| void swap(int array[], int n, int m) { | |
| int tmp = 0; | |
| tmp = array[n]; | |
| array[n] = array[m]; | |
| array[m] = tmp; |
| from itertools import islice | |
| import random | |
| def merge_sort(l): | |
| if len(l) <= 1: | |
| return l | |
| left = [] | |
| right = [] | |
| middle = len(l) / 2 |
| import random | |
| def insert_sort(l): | |
| for i, item in enumerate(l): | |
| while i > 0 and l[i - 1] > item: | |
| l[i] = l[i - 1] | |
| i -= 1 | |
| l[i] = item |
| #include <iostream> | |
| using namespace std; | |
| enum Color { BLACK, RED }; | |
| template <typename T> | |
| class Node_ { | |
| public: | |
| Node_ () { }; |
| #include <pthread.h> | |
| #include <stdio.h> | |
| #include "Python.h" | |
| #define atomic_int_add(ptr, val) __sync_add_and_fetch(&ptr, val) | |
| static PyObject* | |
| int_add(PyObject *self, PyObject *args) | |
| { |
| #include <pthread.h> | |
| #include <stdio.h> | |
| #define atomic_int_add(ptr, val) __sync_add_and_fetch(&ptr, val) | |
| int counter = 0; | |
| void* worker(void* val){ | |
| int i; | |
| #ifdef ATOMIC |
| #include <Python.h> | |
| #include "structmember.h" | |
| #define atomic_int_add(ptr, val) __sync_add_and_fetch(ptr, val) | |
| typedef struct { | |
| PyObject_HEAD | |
| int number; | |
| } AtomicInt; |
| #!/bin/bash | |
| if [ $DEBUG ]; then | |
| set -x | |
| fi | |
| set -e | |
| unpackJar() { | |
| echo $1 |
This is about how to split a GitHub pull request, following a real in-the-wild example.
So it happened that I once wanted to fix a bug (#832) on the shelljs repository.
I forked the repository, cloned it and created a new branch called ln-directory-dest. I fixed the bug, created a pull request, and implemented initial review feedback.
At this point, I had added the commits A, B, C, D, E and [F](https://github.com/Loilo/shelljs/commit/946ab48bf5cf9c8aac03407