Skip to content

Instantly share code, notes, and snippets.

Bartosz Kosarzycki kosiara

Block or report user

Report or block kosiara

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kosiara
kosiara / AndroidManifest.xml
Created Mar 21, 2015
Add Android Annotations to project
View AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.your.application.id">
<application
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:theme="@style/Theme.AppCompat.Light.DarkActionBar">
<activity
//change Activity class to generated class from AA
@kosiara
kosiara / ExplodeActivity.java
Created Mar 22, 2015
Android: Add scene transition animation to your project
View ExplodeActivity.java
public class ExplodeActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_explode);
}
}
@kosiara
kosiara / DoubleClickListenerImageButton.java
Created Sep 20, 2015
multiple OnClickListeners in one Android control (java class)
View DoubleClickListenerImageButton.java
import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.view.View;
import android.widget.ImageButton;
/**
* Created by kosiara on 9/20/15.
*/
@kosiara
kosiara / HowTo.txt
Created Sep 22, 2015
Start Ubuntu docker image with a mounted directory
View HowTo.txt
Prerequisite: Install docker
> docker version
Client:
Version: 1.8.2
API version: 1.20
Go version: go1.4.2
Git commit: 0a8c2e3
Built: Thu Sep 10 19:19:00 UTC 2015
OS/Arch: linux/amd64
@kosiara
kosiara / karabiner.json
Created Sep 29, 2016
Karabiner-Elements-PL-right-command-alt-cmd-alt-swap
View karabiner.json
#save this file under: ~/.karabiner.d/configuration/karabiner.json
{
"profiles": [
{
"name": "Default profile",
"selected": true,
"simple_modifications": {
"right_command": "right_option",
"right_option": "right_command"
@kosiara
kosiara / setup_howto.txt
Last active Apr 21, 2017
Setup Facebook React-native sample (empty) project on Ubuntu
View setup_howto.txt
# author:
# @Bartosz Kosarzycki
#
sudo apt-get install npm
sudo npm install -g react-native-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /home/user/your/project/path
react-native init AwesomeProject
cd AwesomeProject
@kosiara
kosiara / app build.gradle
Last active Apr 21, 2017
@ParametersAreNonnullByDefault for all subpackages includes src, test and androidTest
View app build.gradle
apply plugin: 'com.android.application'
apply from: 'nonnull.gradle'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
[...]
}
@kosiara
kosiara / python3_http_simple_server.py
Created Sep 21, 2017
Simple Python3 HTTP Server; one-line python GET method
View python3_http_simple_server.py
from http.server import BaseHTTPRequestHandler, HTTPServer
from urllib.parse import urlparse
import subprocess
class GetHandler(BaseHTTPRequestHandler):
ls_l_cmd = ['ls','-l']
def do_GET(self):
parsed_path = urlparse(self.path)
@kosiara
kosiara / nonnull.gradle
Last active Feb 11, 2018
@ParametersAreNonnullByDefault for all subpackages
View nonnull.gradle
/**
* File: nonnull.gradle
*
* Generates package-info.java for appropriate packages
* inside src/main/java folder.
*
* This is a workaround to define @ParametersAreNonnullByDefault for all Java classes in a package
* i.e. including all subpackages (note: edit line no. 19).
*/
task generateNonNullJavaFiles(dependsOn: "assembleDebug", type: Copy) {
@kosiara
kosiara / InitActivity.java
Created Jul 21, 2014
Android slf4j logger with logcat + file; logging to file and logcat on Android
View InitActivity.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class InitActivity {
public InitActivity() {
logger.debug("Activity loading....");
}
You can’t perform that action at this time.