Skip to content

Instantly share code, notes, and snippets.

View marsicdev's full-sized avatar
🏠
Working from home

Marko Arsić marsicdev

🏠
Working from home
View GitHub Profile
@marsicdev
marsicdev / CircleTransform.java
Created December 8, 2015 13:27
Glide circular transform that doesn't throw java.lang.IllegalArgumentException: "Cannot draw recycled bitmaps" exception
public class CircleTransform extends BitmapTransformation {
public CircleTransform(Context context) {
super(context);
}
@Override
protected Bitmap transform(BitmapPool pool, Bitmap source, int outWidth, int outHeight) {
return ImageUtils.getCircularBitmapImage(pool, source);
}
#
# Build configuration for Circle CI
#
general:
artifacts:
- /home/ubuntu/PROJECT_NAME/MODULE_NAME/build/outputs/apk/
dependencies:
override:
alias startintent="adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X shell am start $1"
alias apkinstall="adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X install -r $1"
alias rmapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X uninstall $1"
alias clearapp="adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X shell pm clear $1"
[user]
name = Marko Arsic
email = ADD_EMAIL_HERE
[alias]
A = add -A
a = add
aa = add --all
ae = add --edit
ai = add --interactive
amend = commit --amend -C HEAD
set rtp+=$GOROOT/misc/vim
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Maintainer:
" Amir Salihefendic
" http://amix.dk - amix@amix.dk
"
" Version:
" 5.0 - 29/05/12 15:43:36
"
@marsicdev
marsicdev / gradle.properties
Last active May 4, 2017 14:10
Global build gradle properties
# Global gradle settings.
# Store in /Users/USER/.gradle/gradle.properties
org.gradle.jvmargs=-Xmx2048M
org.gradle.deamon=true
org.gradle.configureondemand=true
org.gradle.parallel=true
// Swift 2
let triggerTime = (Int64(NSEC_PER_SEC) * 10)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, triggerTime), dispatch_get_main_queue(), { () -> Void in
self.functionToCall()
})
// Swift 3
unowned let unownedSelf = self
let deadlineTime = DispatchTime.now() + .seconds(10)
@marsicdev
marsicdev / app-build.gradle
Created May 4, 2017 14:08
Starter Android app gradle files (kotlin)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
def BOOLEAN = "boolean"
def STRING = "String"
def TRUE = "true"
def FALSE = "false"
def LOG_HTTP_REQUESTS = "LOG_HTTP_REQUESTS"
import java.util.*
fun main(args: Array<String>) {
println("Say hello to Kotlin".withUnderscore())
// ----- VARIABLES -----
// In our example, the first function, multiplyByTwo(),
// accepts three parameters, loops through them,
// multiplies them by two, and returns an array
// containing the result.
function multiplyByTwo(a, b, c) {
var outputArray = [];
for (var i = 0; i < arguments.length; i++) {
var currentElement = arguments[i];