Skip to content

Instantly share code, notes, and snippets.

npm install -g create-react-kotlin-app
create-react-kotlin-app organiser
cd organiser
git init
#setup repository on github
# - https://github.com/new
# - name it organiser
# - copy the url - something like - git@github.com:paven/organiser.git - use below
git remote add github git@github.com:paven/organiser.git
@paven
paven / gist:17811d4cdc649b6e1acfaec9d266388c
Created June 8, 2017 11:55
run tests in hooks pre-push, post-rewrite, post-merge etc
#!/bin/sh
oldStash=b hash stash@{0}
git stash save --include-untracked
stash=b hash stash@{0}
mvn install
@paven
paven / gist:9d7686eb2428355cc55f
Last active August 29, 2015 14:22
replaceOrAdd
#$1 regexp
#$2 replacment
found=false;
#/bin/bash
##replace and write
while IFS='' read -r LINE || [ -n "$LINE" ]; do
if echo $LINE | grep -q "$1"; then
echo $LINE | sed "s/$1/$2/g";
found=true;
@paven
paven / gist:13e177eae11c5d7706fd
Created May 20, 2015 08:49
reflection to convert from one class to another.
public Dataset toDataset() {
Dataset dataset = new Dataset();
for (Method method : Dataset.class.getMethods()) {
if (method.getName().startsWith("set")) {
Object value;
try {
String getName = setNameToGetName(method.getName());
value = this.getClass().getMethod(getName).invoke(this, null);
@paven
paven / KillAll Java process
Created April 28, 2015 10:55
KillAll Java process
ps -emf | grep netbeans | grep java | grep -v "grep" | awk '{ print $2 }' | xargs kill -9
### Keybase proof
I hereby claim:
* I am paven on github.
* I am pvn (https://keybase.io/pvn) on keybase.
* I have a public key whose fingerprint is D7DB 40A3 CA7B E6B7 2C63 B490 3BD3 8E81 B4B5 D11A
To claim this, I am signing this object: