Skip to content

Instantly share code, notes, and snippets.


Piotr Wittchen pwittchen

View GitHub Profile
pwittchen /
Created Apr 24, 2018 — forked from okapies/
Ubuntu 16.04 on ThinkPad T470s

This is a document describing how to install Ubuntu 16.04 LTS on ThinkPad T470s.

My Hardware

  • CPU: Intel Core i7-7600U (2.80GHz, 4MB cache)
  • Graphics: Intel HD Graphics 620
  • Display: 14” WQHD (2560 X 1440) IPS Non-Touch Anti-Glare
  • Memory: 24GB DDR4 2133 MHz (8GB Onboard + 16GB)
  • SSD: PCIe-NVMe 256G OPAL 2.0
  • Wireless: Intel Dual Band Wireless AC (2x2) 8265 Bluetooth 4.1
  • Fingerprint Reader
View 5 minute local Kubernetes Cluster on Mac
# Reference:
# install homebrew and cask
ruby -e "$(curl -fsSL"
# install virtualbox
brew cask install virtualbox
# install dockertoolbox
pwittchen /
Created Jan 27, 2018 — forked from mackuba/
Lista coworkingów w Krakowie

Coworking w Krakowie

Studio Kreatywnej Współpracy

Adres: ul. Królewska 2/2

  • miesiąc - 420 + VAT
  • 10 dni - 230 + VAT
pwittchen /
Created Jan 12, 2018 — forked from spalladino/
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
pwittchen /
Created Nov 20, 2017 — forked from jtan189/
Java PBKDF2 Password Hashing Code
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.SecretKeyFactory;
import java.math.BigInteger;
* PBKDF2 salted password hashing.
* Author: havoc AT
pwittchen / logback.xml
Created Oct 22, 2017 — forked from vazexqi/logback.xml
sfl4j logging with Groovy using Gradle to manage dependencies (logback.xml) See
View logback.xml
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %ms
pwittchen /
Created Oct 7, 2017 — forked from brenopolanski/
Install Firefox Nightly in Ubuntu via PPA


Add the Mozilla Daily PPA (available for Ubuntu 11.04, 10.10 and 10.04) and install Firefox Nightly using the commands below:

$ [sudo] add-apt-repository ppa:ubuntu-mozilla-daily/ppa
$ [sudo] apt-get update
$ [sudo] apt-get install firefox-trunk

Since this is a daily builds PPA, it's nowhere near stable so use it at your own risk!

pwittchen /
Created May 5, 2017 — forked from maxogden/
list of interdisciplinary open source conferences

Interdisciplinary Open Source Community Conferences


  • Must be an event that someone involved in open source would be interested in attending
  • Must be a community oriented event (no corporate owned for-profit events here please)
  • Can't be about a specific language/framework.

Leave suggestions in the comments below


React "Hello World" Examples

Below are a small collection of React examples to get anyone started using React. They progress from simpler to more complex/full featured.

They will hopefully get you over the initial learning curve of the hard parts of React (JSX, props vs. state, lifecycle events, etc).


You will want to create an index.html file and copy/paste the contents of 1-base.html and then create a scripts.js file and copy/paste the contents of one of the examples into it.

View gist:023191e469179868049f74e30d162c36
function calculateDistance(rssi) {
var txPower = -59 //hard coded power value. Usually ranges between -59 to -65
if (rssi == 0) {
return -1.0;
var ratio = rssi*1.0/txPower;
if (ratio < 1.0) {