Simple Horizontal Divider Item Decoration for RecyclerView
mRecyclerView.addItemDecoration(new SimpleDividerItemDecoration(
getApplicationContext()
));
NOTE: Add item decoration prior to setting the adapter
| // see: http://stackoverflow.com/a/823966/670623 | |
| public static Bitmap decodeFile(File f, int size) { | |
| try { | |
| // Decode image size | |
| BitmapFactory.Options opts1 = new BitmapFactory.Options(); | |
| opts1.inJustDecodeBounds = true; | |
| BitmapFactory.decodeStream(new FileInputStream(f), null, opts1); | |
| // The new size we want to scale to |
| .gradle | |
| /local.properties | |
| /.idea/workspace.xml | |
| /.idea/libraries | |
| /build | |
| /captures | |
| .DS_Store | |
| Thumbs.db |
| /* | |
| * Copyright (C) 2012 Sebastian Kaspari | |
| * | |
| * 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 |
| export PATH="/opt/android-sdk-linux/tools:${PATH}" |
| import android.os.Bundle; | |
| import android.support.multidex.MultiDex; | |
| import android.support.test.runner.AndroidJUnitRunner; | |
| public class MultiDexJunitRunner extends AndroidJUnitRunner { | |
| @Override | |
| public void onCreate(Bundle arguments) { | |
| MultiDex.install(getTargetContext()); | |
| super.onCreate(arguments); | |
| } |
| #!/bin/sh | |
| # remove image by pattern | |
| docker images | grep "^pattern" | awk '{print $3}' | xargs docker rmi | |
| # remove exited containers | |
| docker ps -q -f status=exited | xargs docker rm | |
| # get container/image label | |
| docker-label () { # [container/image] [label] |
| launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist | |
| launchctl unload /System/Library/LaunchAgents/com.apple.nsurlsessiond.plist | |
| sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlsessiond.plist | |
| sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist |
| # | |
| # Add Google Analytics tracking code to HTML response | |
| # | |
| # Usage: | |
| # set $tracking_id 'UA-12345678-9'; | |
| # include incl/analytics.conf; | |
| # | |
| # It needs nginx compiled with option --with-http_sub_module. | |
| # Uses optimized GA code from: http://mathiasbynens.be/notes/async-analytics-snippet | |
| # |
| # looping over array | |
| for i in "${arrayName[@]}"; do | |
| # do whatever on $i | |
| done | |
| # Switch-case | |
| case ${ENV} in | |
| "development") | |
| ;; | |
| "staging") |