Skip to content

Instantly share code, notes, and snippets.

@rkluszczynski
rkluszczynski / git.migrate
Created January 26, 2020 20:30 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@rkluszczynski
rkluszczynski / postgres-brew.md
Created April 8, 2019 12:10 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@rkluszczynski
rkluszczynski / HelloAvro.scala
Created June 30, 2017 07:38 — forked from hammer/HelloAvro.scala
Concise example of how to write an Avro record out as JSON in Scala
import java.io.{IOException, File, ByteArrayOutputStream}
import org.apache.avro.file.{DataFileReader, DataFileWriter}
import org.apache.avro.generic.{GenericDatumReader, GenericDatumWriter, GenericRecord, GenericRecordBuilder}
import org.apache.avro.io.EncoderFactory
import org.apache.avro.SchemaBuilder
import org.apache.hadoop.fs.Path
import parquet.avro.{AvroParquetReader, AvroParquetWriter}
import scala.util.control.Breaks.break
object HelloAvro {
@ECHO OFF
IF "%1"=="" GOTO ERROR
PUSHD %1 2>NUL && SET IS_DIR=1 || SET IS_DIR=0 & POPD
IF "%IS_DIR%"=="0 " GOTO ERROR
REM Based on:
REM http://www.howtogeek.com/204088/how-to-use-a-batch-file-to-make-powershell-scripts-easier-to-run/
@rkluszczynski
rkluszczynski / changes-for-plg.patch
Last active August 17, 2017 10:23
Patch for Unity IDM 2.1.0 to make it work with PLG infrastructure
diff --git a/.gitignore b/.gitignore
index 18d2ca6cd..88dd037ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,6 @@ target/
.classpath
.project
.settings/
+
+.idea/
@rkluszczynski
rkluszczynski / BreadthFirstSearchOnTreeWithStream.java
Created June 29, 2015 19:28
Simple example for stream creation based on Spliterator which do BFS algorithm on tree (and only on tree!).
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Spliterator;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
@rkluszczynski
rkluszczynski / netlogo-batch.sh
Created May 20, 2012 10:28
NetLogo shell script for use with batch systems like Torque, Slurm etc.
#!/bin/sh
# Script for running NetLogo headless also for large models
# (version for use with batch system like torque or slurm).
# Prepared based on NetLogo 5.0
#
# Author: Rafal Kluszczynski
# Company: ICM UW
# Website: http://www.icm.edu.pl
# Email: klusi@icm.edu.pl