Skip to content

Instantly share code, notes, and snippets.

alex-shpak /
Created February 4, 2017 16:41
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 August 14, 2016 15:20
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 January 9, 2020 05:45
Gradle script for querydsl-apt processor with separate classpath
View querydsl.gradle
// apply plugin: 'idea'
sourceSets { +=
configurations {
alex-shpak / proguard-custom.txt
Last active November 2, 2015 12:56
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 July 23, 2015 17:33
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 July 20, 2022 11:03 /swap 2G
fallocate -l $SIZE $FILE
chmod 600 $FILE
ls -lh $FILE
mkswap $FILE
alex-shpak /
Last active March 29, 2023 21:06
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