Skip to content

Instantly share code, notes, and snippets.

View takahirom's full-sized avatar

Takahiro Menju takahirom

View GitHub Profile
@mstssk
mstssk / .gti.sh
Last active August 29, 2015 14:06
alias gti=~/.gti.sh
#!sh
# Re-concatenate command. Care quoted arguments.
command="git"
while [ "$1" != "" ]
do
space_contain=`echo $1 | grep "\s"`
if [ "" != "$space_contain" ]
then
command="$command \"$1\""
@esmasui
esmasui / ExampleActivity.java
Last active August 29, 2015 14:20
AndroidのInstanceStateの保存・復元をアノテーションでやる再発明
/*
* Copyright (C) 2015 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
@webdevwilson
webdevwilson / compare-and-copy-files.groovy
Created January 19, 2011 15:55
Groovy code to compare to directory trees and copy different files over
def path1 = new File(args[0]).absolutePath
def path2 = new File(args[1]).absolutePath
def different = compareDirs(path1, path2)
different.files.each {
println it.from
new AntBuilder().copy ( file: it.from.absolutePath, tofile : it.to.absolutePath )
}
println different.files.size() + ' of ' + different.count
@shikajiro
shikajiro / svg2png.groovy
Last active October 27, 2015 07:07
Android用のpng画像生成スクリプト。svg画像をmdpi, hdpi, xhdpi, xxhdpi, xxxhdpi毎のpng画像に変換する。要Inkscape
/* Copyright 2015 the original author or authors.
*
* 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
* distributed under the License is distributed on an "AS IS" BASIS,

CustomerActivity.java

public class CustomerActivity extends Activity implements ICustomerView, OnClickListener {

	private EditText mFirstNameEditText, mLastNameEditText, mIdEditText;
	private Button mSaveButton, mLoadButton;
	private CustomerPresenter mCustomerPresenter;

	@Override

protected void onCreate(Bundle savedInstanceState) {

@romainpiel
romainpiel / build.gradle
Created March 8, 2016 18:10
Start/stop genymotion devices just to run the tests
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.genymotion:plugin:1.0'
}
}
apply plugin: "genymotion"
@fiskurgit
fiskurgit / TutorialActivity.java
Last active April 18, 2016 07:16
How to do code the slick 'product' tour' view pager animations with fading background colours and parallax scrolling seen in newer Google products
package eu.fiskur.pennineway.tutorial;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.support.v7.app.ActionBarActivity;
@believe2200
believe2200 / draw.xml
Last active November 15, 2017 20:51
リップルで水面のようなボタンオンオフ
<ImageButton
android:id="@+id/imageView01"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_margin="3dp"
android:layout_weight="1"
android:background="@drawable/btn_main01"
android:elevation="3dp" />
@cattaka
cattaka / adb-screenshot.sh
Last active December 6, 2017 00:51 — forked from hkurokawa/adb-screenshot.sh
A shell script to take a screen shot of the android device, resize it and copy to clipboard
#! /bin/bash
## This script is for taking a screen shot of an Android device.
## If possible, it tries to resize the image file and then copy to the clipboard.
##
## The script passes unrecognized arguments to adb command, which means you can specify "-e" or "-d"
## to select which device to take a screenshot of.
if [ -z $(which adb) ]; then
echo "Error. adb must be installed and in PATH." 1>&2
@aprock
aprock / gist:2037883
Created March 14, 2012 17:00
manually serialize/deserialize android bundle
private String serializeBundle(final Bundle bundle) {
String base64 = null;
final Parcel parcel = Parcel.obtain();
try {
parcel.writeBundle(bundle);
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final GZIPOutputStream zos = new GZIPOutputStream(new BufferedOutputStream(bos));
zos.write(parcel.marshall());
zos.close();
base64 = Base64.encodeToString(bos.toByteArray(), 0);