Skip to content

Instantly share code, notes, and snippets.

View teshi04's full-sized avatar
🐟
sakana

Yui Matsuura teshi04

🐟
sakana
View GitHub Profile
' 2121/01/27 公安局ビル襲撃ダイアグラム
@startuml
title Raid a Public-Security-Bureau
start
:Nuts cracker task01\nSword Get;
:Rats task01\nBreak into underground parking;
:Nuts cracker task02\nLaunch Spid Loan;
fork
package jp.tsur.android
import android.content.Context
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
import android.graphics.RectF
import android.util.AttributeSet
import android.view.View
# cd後にls
function cd
builtin cd $argv; and ls
end
@teshi04
teshi04 / MainActivity.java
Last active August 29, 2015 14:23
画面のスクロールに合わせてFloatingActionButtonを隠したり出したりするやつ
CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) fab.getLayoutParams();
params.setBehavior(new ScrollFABBehavior());
fab.setLayoutParams(params);
@teshi04
teshi04 / image
Created February 9, 2015 19:02
昔書いたやつ
## picasso
https://github.com/square/picasso
- 機能が豊富
- 複雑な画像の変形処理を最小のメモリ消費で実現できる
- 自動でメモリ・ファイルキャッシュをやってくれる
- デバッグ機能がある。読み込まれた画像がネットワーク・メモリ・ディスクのどこから読まれたのか分かるように画像の上に印が表示されるようにする機能と、詳細なログが出力される機能がある。
## UniversalImageLoader
https://github.com/nostra13/Android-Universal-Image-Loader
@teshi04
teshi04 / DeviceOwnerWriteActivity.java
Last active June 13, 2018 18:35
Device owner using NFC on Android Lollipop
MessageDigest digest = null;
try {
digest = MessageDigest.getInstance("SHA-1");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
byte[] apkBytes = new byte[0];
try {
apkBytes = IOUtils.toByteArray(getAssets().open("app-debug.apk"));
@teshi04
teshi04 / gist:f6225ecb521a81352c4a
Last active August 29, 2015 14:08
Image Loader Library Demo
package jp.tsur.imageloaderlibrary;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.NetworkImageView;
export ANDROID_HOME="$HOME/android_sdk"
PATH="${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:${PATH}"
SLICE_SIZE = 100
def get_all_friends(screen_name)
client = twitter_client
all_friends = []
client.friend_ids(screen_name).each_slice(SLICE_SIZE).each do |slice|
client.users(slice).each do |friend|
all_friends << friend
end
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">