Skip to content

Instantly share code, notes, and snippets.

import Foundation
extension String
{
var length: Int {
get {
return countElements(self)
}
}
@zaki50
zaki50 / FloatingActionButton.java
Last active August 29, 2015 14:03
Material Design の FloatingActionButton のためのクラスを作ってみた
/*
* Copyright (C) 2014 uPhyca 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
@wshaddix
wshaddix / gist:8797934
Created February 4, 2014 03:57
Gets the week number for a given date
main () {
// get today's date
var now = new DateTime.now();
// set it to feb 10th for testing
//now = now.add(new Duration(days:7));
int today = now.weekday;
@cyrilmottier
cyrilmottier / ResourcesAdditions.java
Last active January 12, 2024 17:55
Lightweight key-value pairs resources for Android applications.
package com.cyrilmottier.android.resourcesadditions;
import android.content.res.Resources;
import android.content.res.XmlResourceParser;
import android.os.Bundle;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;
/**
* @author Cyril Mottier
@yyaammaa
yyaammaa / gist:7480613
Last active June 30, 2017 02:50
Butter Knifeの紹介

Butter Knifeの紹介

Android用のView Injectionライブラリである Butter Knife について解説します (といいますか、サイトに書いてあることをほとんどそのまま日本語にしただけです) 。

概要

Butter Knifeは ActionBarSherlock などでお馴染みの Square のJake WhartonさんによるAndroid用のView Injectionライブラリです。

使い方

このライブラリの目的が、

  • Activity, ViewのfindViewByIdを楽に書く
@nobuoka
nobuoka / java-for-android-app.markdown
Last active May 14, 2023 14:47
Android アプリ開発勉強会のために書いた Java の入門文書

Android アプリ開発のための Java 入門

MEMO

  • declaration は 「宣言」 と訳しているが、「定義」 の方が適しているような気がしなくもない。
  • 「インスタンス」 と 「オブジェクト」 という言葉を使うことがあるが、本文書中ではどちらも同じ意味で使用している。
  • String オブジェクト」 という表現は、「String クラスのインスタンス」 を意味している。 (Java に限らず一般的な表現だと思う。)

はじめに

@daichan4649
daichan4649 / AndroidManifest.xml
Last active December 21, 2015 12:19
物理メニューキーがある端末でも、ActionBar の overflowメニュー を強制的に表示する (for Android)
<application
android:name="daichan4649.actionbartest.TestApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="daichan4649.actionbartest.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
@zaki50
zaki50 / volley_with_spdy.diff
Created May 23, 2013 18:43
adamrocker さんの volley サンプル https://github.com/adamrocker/volley を元に OkHttp を組み込んで SPDY でアクセスするための差分。 変更後のものは https://github.com/zaki50/volley/tree/with-OkHttp にあります。
diff --git a/VolleySample/libs/okhttp-1.0.2.jar b/VolleySample/libs/okhttp-1.0.2.jar
new file mode 100644
index 0000000..7592cdf
Binary files /dev/null and b/VolleySample/libs/okhttp-1.0.2.jar differ
diff --git a/VolleySample/libs/volley.jar b/VolleySample/libs/volley.jar
index 31c143c..762e993 100644
Binary files a/VolleySample/libs/volley.jar and b/VolleySample/libs/volley.jar differ
diff --git a/VolleySample/src/com/adamrocker/volleysample/MainActivity.java b/VolleySample/src/com/adamrocker/volleysample/MainActivity.java
index b2c1dd5..c2118c5 100644
--- a/VolleySample/src/com/adamrocker/volleysample/MainActivity.java
@granoeste
granoeste / EachDirectoryPath.md
Last active April 4, 2024 22:32
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@taichi
taichi / install_phabricator_to_ubuntu12.04.1.md
Last active February 12, 2016 06:08
phabricator を ubuntu12.04.01 LTS にインストールした。(2013/02)

phabricator を ubuntu12.04.01 LTS にインストールした。(2013/02)

参考資料

事前準備

Distributor ID: Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:        12.04