Skip to content

Instantly share code, notes, and snippets.

View pwittchen's full-sized avatar
🎯
Focusing

Piotr Wittchen pwittchen

🎯
Focusing
View GitHub Profile
package jmodern;
import com.codahale.metrics.*;
import com.codahale.metrics.annotation.*;
import com.fasterxml.jackson.annotation.*;
import com.google.common.base.Optional;
import feign.Feign;
import feign.jackson.*;
import feign.jaxrs.*;
import io.dropwizard.Application;
# Flask wsgi for simple application
# (dziala na linuxpl.com)
import os, sys
p = os.path.split(os.path.abspath(__file__))[0]
activate_this = p + '/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
sys.path.insert(0, p)
from app import app as application
@niusounds
niusounds / MyAdapter.java
Last active February 16, 2016 20:42
How to simplify RecyclerView.Adapter and RecyclerView.ViewHolder
import android.content.Context;
import org.androidannotations.annotations.EBean;
public class MyAdapter extends SimpleListAdapter<String, TextView> {
public MyAdapter(Context ctx) {
super(ctx);
}
@serkanh
serkanh / gist:23c73bdb1fc294ee9105f33ccc1f304e
Created November 14, 2016 19:20
Save tmux session via ascii cinema
asciinema rec -c "tmux attach -t 3"
/*
* Copyright 2013 Chris Banes
*
* 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
@vazexqi
vazexqi / logback.xml
Created February 24, 2013 17:01
sfl4j logging with Groovy using Gradle to manage dependencies (logback.xml) See http://vazexqi.github.com/posts/2013/02/24/groovy-sfl4j.html
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %ms
package com.mirth.stevek.rxtest;
import rx.Observable;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.functions.Func3;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.*;
@rogerpujol
rogerpujol / Android Value Animator Example.java
Last active June 20, 2018 09:47
Example that shows how to implement a Value Animator
/**
* ValueAnimator can be type of: ofInt, ofFloat, ofObject, etc...
* Check for more info: http://developer.android.com/reference/android/animation/ValueAnimator.html
* and http://developer.android.com/guide/topics/graphics/prop-animation.html
*/
public ValueAnimator va = ValueAnimator.ofInt(0, 300);
public int mDuration = 3000; //in millis
va.setDuration(mDuration);
va.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
public void onAnimationUpdate(ValueAnimator animation) {
package rx.android.observables;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.android.subscriptions.AndroidSubscriptions;
import rx.functions.Action0;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@dehora
dehora / gradle-executable-jar.md
Last active October 3, 2018 15:09
Executable fat jars via gradle

Executable fat jars are easy to deploy and upgrade, and don't need wrapper scripts to pull in the classpath. You can use the Gradle fatjar plugin to create executable, self-contained jars in Gradle, akin to the Shade plugin for Maven -

apply plugin: 'fatjar'
buildscript {
  dependencies {
  classpath 'eu.appsatori:gradle-fatjar-plugin:0.1.3'  
  }
}