Skip to content

Instantly share code, notes, and snippets.

View u1aryz's full-sized avatar
Unemployed

u1aryz u1aryz

Unemployed
View GitHub Profile
@hogedigo
hogedigo / hello.go
Last active August 29, 2015 13:57
GAE/Goでmartini
package hello
import (
"github.com/codegangsta/martini"
"net/http"
)
func init() {
m := martini.Classic()
m.Get("/hello/:name", func(params martini.Params, w http.ResponseWriter) string {
diff -Nur support-v4-22.2.1/android/support/v4/animation/AnimatorCompatHelper.java support-v4-23.0.0/android/support/v4/animation/AnimatorCompatHelper.java
--- support-v4-22.2.1/android/support/v4/animation/AnimatorCompatHelper.java 2015-07-17 03:08:30.000000000 +0900
+++ support-v4-23.0.0/android/support/v4/animation/AnimatorCompatHelper.java 2015-06-23 08:43:44.000000000 +0900
@@ -17,6 +17,7 @@
package android.support.v4.animation;
import android.os.Build;
+import android.view.View;
abstract public class AnimatorCompatHelper {
@vvakame
vvakame / cakefile
Created December 24, 2011 02:34
My default Cakefile
util = require 'util'
fs = require 'fs'
exec = require('child_process').exec
spawn = require('child_process').spawn
callback = (child) ->
child.stdout.on 'data', (data) ->
util.print data
exec "notify-send Cakefile \"#{data}\""
child.stderr.on 'data', (data) ->
@vvakame
vvakame / ig-module.coffee
Created December 26, 2011 06:22
簡易 CommonJS の module っぽいやつ
# CommonJS の module っぽい何かを提供する っぽいだけ
root = global ? window
root.exports = root.exports || {}
exports = root.exports
createExports = (moduleName)->
exports[moduleName] = exports[moduleName] || {}
# global に展開
module.exports = function (grunt) {
grunt.initConfig({
clean:{
js:{
files:[
'<config:concat.src.dest>',
'<config:concat.tests.dest>',
'<config:min.dist.dest>'
],
(function(global) {
var Hoge, Fuga, SampleView;
Hoge = (function() {
function Hoge() {
}
Hoge.prototype.init = function(str) {
str = str || "hoge";
@vvakame
vvakame / sample.html
Created July 2, 2012 09:22
Sinon.JS + jQuery.ajax
<html>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript" src="http://sinonjs.org/releases/sinon-1.4.2.js"></script>
<script type="text/javascript" src="test.js"></script>
<body>
sample
</body>
<html>
@narusemotoki
narusemotoki / Main.java
Last active December 14, 2015 02:09
JavaのgetCanonicalName()、getName()、getSimpleName()が外部クラス、外部クラス内匿名クラス、内部クラス、内部クラス内匿名クラスでそれぞれどういう値を返すのかを調べました。
package ho.ge;
/*
結果
Main
Canonical: ho.ge.Main
Name: ho.ge.Main
Simple: Main
-----
Annoymous

PR: konifar/droidkaigi2016#108

もとの問題

アプリを起動(MainActivity)して任意のセッション詳細(SessionDetailActivity)を開いてSessionの状態を変更して戻る。このときMainActivityが破棄-再生成されていた場合にクラッシュする

構造的な問題

MainActivity-SessionsFragment-ViewPager-SessionsTabFragmentの構造のなかで、それぞれのコンポーネント間で直接onActivityResult()を呼び出して伝搬する方法を取っていた。

@daichan4649
daichan4649 / MainActivity.java
Created April 17, 2012 12:35
DialogFragment sample
package test.fragment;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentTransaction;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
public class MainActivity extends Activity {