Skip to content

Instantly share code, notes, and snippets.

alex-shpak /
Created Feb 4, 2017
Gogs on raspberry pi

Update and install dependencies

apt-get update; apt-get upgrade

dphys-swapfile swapoff
dphys-swapfile uninstall

apt-get remove -y --purge wolfram-engine triggerhappy xserver-common lightdm sonic-pi minecraft-pi pigpio
apt-get autoremove -y
alex-shpak / build.gradle
Created Aug 14, 2016
Idea gradle plugin workaround for kapt. This will create separate source root even if generated folder is excluded. For 2016.1+
View build.gradle
apply plugin: 'kotlin'
kapt {
generateStubs = true
sourceSets { {
srcDir file("build/generated/source/kapt/main")
alex-shpak / querydsl.gradle
Last active Jan 9, 2020
Gradle script for querydsl-apt processor with separate classpath
View querydsl.gradle
// apply plugin: 'idea'
sourceSets { +=
configurations {
alex-shpak / proguard-custom.txt
Last active Nov 2, 2015
Play Services 8.1.0 and MADS proguard rules
View proguard-custom.txt
-keep class com.madsadview.* { ; }
-keep class com.mads.adview.* { ; }
-dontwarn com.madsadview.**
-dontwarn com.mads.adview.**
# Play Ads 8.1.0
alex-shpak /
Created Jul 23, 2015
Script for copying multi-dimen files from material design icon set to working directories
import os, re, shutil
white = "white"
grey = "grey600"
black = "black"
dimensions = ["mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"]
alex-shpak /
Last active Nov 14, 2016 /swap 2G
fallocate -l $SIZE $FILE
chmod 600 $FILE
ls -lh $FILE
mkswap $FILE
alex-shpak /
Last active Jul 23, 2021
Refreshing OAuth token with okhttp interceptors. All requests will wait until token refresh finished, and then will continue with the new token.
private class HttpInterceptor implements Interceptor {
public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
//Build new request
Request.Builder builder = request.newBuilder();
builder.header("Accept", "application/json"); //if necessary, say to consume JSON