Skip to content

Instantly share code, notes, and snippets.

View delor's full-sized avatar
Working from home

Bartłomiej Piech delor

Working from home
View GitHub Profile
delor /
Last active September 26, 2019 09:21
DNA vacabulary

DNA vacabulary

invariant niezmiennik
delor /
Created May 26, 2017 09:53
You don't need to use new keyword anymore. ;)
package example;
public class Example {
private final int a;
private Example(int a) {
this.a = a;
public static Example Example(int a) {
delor /
Last active August 29, 2015 14:15
An implementation of BaseAdapter which uses the new/bind pattern for its views.
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
* An implementation of {@link BaseAdapter} which uses the new/bind pattern for its views.
public abstract class BindableAdapter<T> extends BaseAdapter {
delor / build.gradle
Created November 21, 2014 20:57
Gradle task for generating Maven's POM file for Android AAR
task createPom {
apply plugin: 'maven'
description "Generates pom.xml"
pom {
project {
groupId 'com.example'
artifactId 'example'
version '0.0.1-SNAPSHOT'
packaging 'aar'
delor / OAuthTokenRequestSpec.groovy
Created August 12, 2014 20:44
Testing RoboSpice with mocked MockWebServer
import com.squareup.okhttp.OkHttpClient
import com.squareup.okhttp.mockwebserver.MockResponse
import com.squareup.okhttp.mockwebserver.MockWebServer
import com.squareup.okhttp.mockwebserver.RecordedRequest
import spock.lang.Specification
class OAuthTokenRequestSpec extends Specification {
def POST = "POST"
def anyClient = "123"
delor / pom.xml
Created February 2, 2014 22:56
basic spock framework maven setup
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""
delor /
Last active August 29, 2015 13:55
list of rarely used commands in git

add changes without whitespace

git diff -w --no-color | git apply --cached --ignore-whitespace

find deleted file

$ git log -- /path/to/file

display deleted file

delor / named_arguments.scala
Created August 20, 2013 13:41
Watch out when overwriting methods and changing parameter name in Scala.
scala> trait Person { def grade(years: Int): String }
defined trait Person
scala> class SalesPerson extends Person { def grade(yrs: Int) = "Senior" }
defined class SalesPerson
scala> val s = new SalesPerson
s: SalesPerson = SalesPerson@3ce89cd5
scala> s.grade(yrs=1)
delor / mvn-output
Last active February 7, 2018 09:41
Minimal Maven configuration separating unit and integration tests.
$ mvn verify
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-tests-config 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ maven-tests-config ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
* @file palindrome.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <cs50.h>
bool isPalindrome(char* text);