Skip to content

Instantly share code, notes, and snippets.

Avatar

Tomáš Procházka tprochazka

View GitHub Profile
@tprochazka
tprochazka / RemoteSignTask.groovy
Last active Jan 17, 2019
Custom sign task implementation for Android Build Plugin compatible with build plugin 3.3.0 (with app bundle support)
View RemoteSignTask.groovy
import com.android.annotations.NonNull
import com.android.build.api.artifact.BuildableArtifact
import com.android.build.gradle.api.ApkVariant
import com.android.build.gradle.api.ApkVariantOutput
import com.google.common.io.Files
import org.gradle.api.Action
import org.gradle.api.DefaultTask
import org.gradle.api.GradleException
import org.gradle.api.Project
@tprochazka
tprochazka / ISettableView.java
Created Feb 27, 2016
Example of solution for universal RecyclerViewAdapter
View ISettableView.java
/**
* View that can be used with this adapter must implement this interfaces.
*/
public interface ISettableView<T> {
void setData(T item);
void setEventListener(RecylerViewAdapter.ViewItemEventListener<T> listener);
}
@tprochazka
tprochazka / KnightRider.ino
Last active Jan 12, 2016
Simplistic Knight Rider (KIT) lights implementation
View KnightRider.ino
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 6
#define LEDS 9
#define SUBSTEPS 8
#define DELAY 75
View ArduinoESP8266.ino
/*
* Example of use ESP8266 library
* https://github.com/Diaoul/arduino-ESP8266
*
* Created: 12/30/2014 7:29:04 PM
* Author: Tomáš Procházka
*/
#include <SoftwareSerial.h>
//#include <AltSoftSerial.h>
@tprochazka
tprochazka / build.gradle
Last active Jul 3, 2019
Smart versionName and versionCode for android Gradle build evaluation
View build.gradle
/**
* Will return version from properties file and replace -SNAPSHOT by GIT commit hash
* to recognize origin commit for the every build.
*/
project.ext.evalVersionName = {
def ideBuild = project.properties['android.injected.invoked.from.ide']
if (ideBuild) {
logger.info("IDE build");
return "dev"
} else if (project.VERSION.toUpperCase().contains("SNAPSHOT")) {
@tprochazka
tprochazka / ALK.ino
Created Jun 9, 2014
Code for my Arduino Learning Kit project
View ALK.ino
/*
* Copyright (C) 2014 Tomas Prochazka
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@tprochazka
tprochazka / 0_reuse_code.js
Created Feb 22, 2014
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tprochazka
tprochazka / thermostat.ino
Created Jan 6, 2014
Arduino thermostat example project
View thermostat.ino
#include <DHT.h>
#include <LCD5110_Basic.h>
const int COMFORT_TEMPERATURE = 21;
#define DHTPIN 3 // pin teplotního senzoru
#define DHTTYPE DHT11 // typ teplotního senzoru
#define RELAYPIN 2 // pin relé
LCD5110 myGLCD(8,9,10,11,12); // piny LCD displeje
View PreferenceListFragment
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.preference.Preference;
import android.preference.PreferenceGroup;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
View gist:5677714
[INFO] trouble processing "javax/xml/bind/annotation/XmlAccessorType.class":
[INFO]
[INFO] Ill-advised or mistaken usage of a core class (java.* or javax.*)
[INFO] when not building a core library.
[INFO]
[INFO] This is often due to inadvertently including a core library file
[INFO] in your application's project, when using an IDE (such as
[INFO] Eclipse). If you are sure you're not intentionally defining a
[INFO] core class, then this is the most likely explanation of what's
[INFO] going on.
You can’t perform that action at this time.