Skip to content

Instantly share code, notes, and snippets.

@antoniolg
antoniolg / SwipeRefreshActivity.java
Last active July 29, 2019 11:59
An activity that uses a SwipeRefreshLayout as a container for the layout of the classes that extend it.
/*
* Copyright (C) 2014 Antonio Leiva Gordillo.
*
* 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
@snadjafi
snadjafi / uploadImageRetrofit.java
Last active February 14, 2017 13:10
[blipo] upload image using retrofit
byte[] photoByteArray = Files.toByteArray(photo.getImageFile());
BlipoApi blipoApi = setUpNetwork();
blipoApi.uploadPhoto(photoByteArray);
private BlipoApi setUpNetwork() {
RequestInterceptor requestInterceptor = new RequestInterceptor() {
@Override
public void intercept(RequestFacade requestFacade) {
String imageId = UUID.randomUUID().toString();
@swankjesse
swankjesse / RetrofitCachingExample.java
Created June 29, 2013 03:03
Demonstrate HTTP caching with OkHttp and Retrofit.
/*
* Copyright (C) 2013 Square, Inc.
*
* 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
@j8
j8 / ubuntu_sublime_text_launcher.txt
Last active May 22, 2021 21:05
Sublime Text 3 Ubuntu Sidebar Icon Launcher
# Create new file trough vim in the following directory
sudo vim /usr/share/applications/sublime.desktop
#Put the following file contents and replace with the path to your Sublime Text
[Desktop Entry]
Version=1.0
Name=Sublime Text 2
# Only KDE 4 seems to use GenericName, so we reuse the KDE strings.
# From Ubuntu's language-pack-kde-XX-base packages, version 9.04-20090413.
GenericName=Text Editor