Skip to content

Instantly share code, notes, and snippets.

@pistatium
pistatium / PolyArea.java
Last active August 29, 2015 14:11
多角形の面積を計算する的な
/**
* Copyright (c) 2014 pistatium
*
* This software is released under the MIT License.
*
* http://opensource.org/licenses/mit-license.php
*/
import java.util.*;
import java.lang.Math;
@meoyawn
meoyawn / EmptyRecyclerView.java
Created November 1, 2014 11:20
RecyclerView doesn't have an emptyView support, we gotta fix that
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.util.AttributeSet;
import android.view.View;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class EmptyRecyclerView extends RecyclerView {
@Nullable View emptyView;
@ec84b4
ec84b4 / gist:d56c00fb5fd2dfaf279b
Last active June 26, 2018 06:22
recycler view header adapter
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
/**
* Created by khaled bakhtiari on 10/26/2014.
* <a href="http://about.me/kh.bakhtiari">
*/
@hkurokawa
hkurokawa / postNewReviewsHipchat.sh
Last active March 10, 2016 06:54
Post Google Play App. Reviews to HipChat
verifyCmd() {
for cmd in ${@}; do
if [ -z "$(which $cmd)" ]; then
echo "$cmd not found in PATH: $PATH"
return 1
fi
done
}
: ${GOOGLE_BUCKET_ID?"Need to set GOOGLE_BUCKET_ID"}
@kijtra
kijtra / prefectures.json
Last active February 27, 2018 21:54
都道府県のJSONデータ
{
"01": {
"id": "01",
"name": "北海道",
"short": "北海道",
"kana": "ホッカイドウ",
"en": "hokkaido",
"area": {
"id": 1,
"name": "北海道・東北"
@alexfu
alexfu / DividerItemDecoration.java
Last active February 9, 2023 05:09
An ItemDecoration that draws dividers between items. Pulled from Android support demos.
/*
* Copyright (C) 2014 The Android Open Source Project
*
* 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
@grantland
grantland / post.md
Last active February 9, 2023 05:09
RecyclerView item onClick

RecyclerView item onClick

RecyclerView does not have an OnItemClickListener like it's predecessor, ListView. However, detecting item clicks is pretty simple.

Set an OnClickListener in your ViewHolder creation:

private class MyAdapter extends RecyclerView.Adapter<MyAdapter.ViewHolder>  {

    public static class ViewHolder extends RecyclerView.ViewHolder
@kunst1080
kunst1080 / gist:388fdea590b7bbf99e7f
Last active October 20, 2015 05:29
PlayFramework学習のための関連のリンクまとめ
@wbroek
wbroek / genymotionwithplay.txt
Last active February 12, 2024 03:22
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
@nolanlawson
nolanlawson / completion-for-gradle.md
Last active April 5, 2024 07:43
Gradle tab completion for Bash. Works on both Mac and Linux.

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]