Skip to content

Instantly share code, notes, and snippets.

View Nkzn's full-sized avatar

Yukiya Nakagawa Nkzn

View GitHub Profile
@Nkzn
Nkzn / StateBottomNavigationView.java
Last active December 20, 2016 01:55 — forked from NikolaDespotoski/RichBottomNavigationView.java
Saving and restoring BottomNavigationView state (No Shadow settings)
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.NavigationView;
import android.support.v4.os.ParcelableCompat;
@Nkzn
Nkzn / StateBottomNavigationView.java
Created December 20, 2016 01:53
Based on nikola's RichBottomNavigationView, but is removed shadow
import android.content.Context;
import android.os.Build;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.CallSuper;
import android.support.annotation.NonNull;
import android.support.annotation.RequiresApi;
import android.support.design.widget.BottomNavigationView;
import android.support.design.widget.NavigationView;
import android.support.v4.os.ParcelableCompat;
@Nkzn
Nkzn / FakeButterKnife.java
Last active May 12, 2016 01:10
新人さんにButterKnifeを説明するために、bindの偽実装を擬似コードでそれっぽく書いたやつです。APTではなくReflectionで書いてしまったので、 https://github.com/eaglesakura/margarineknife/ に近い発想の実装になった。
class FakeButterKnife {
public static void bind(Activity activity) {
Class class = activity.getClass();
/*
* メンバ変数に付けたBindViewアノテーションを解決する
*/
Field[] fields = class.getDeclaredFields();
for(Field field: fields) {

Cordovaのリリースエンジニアリングのお話

  • Niigata.js #1
  • 2016.4.23(Sat.) @Nkzn

Cordovaって聞いたことありますか

https://cordova.apache.org/

@Nkzn
Nkzn / niigata_community.md
Created December 9, 2015 11:08 — forked from NPoi/niigata_community.md
新潟県内のコミュニティについて
@Nkzn
Nkzn / git-mr-diff.rb
Last active March 16, 2022 23:32
Make a markdown list with a range of commits. http://qiita.com/Nkzn/items/60b30f1c9d0e33dfc424
#! /usr/bin/ruby
# The MIT License (MIT)
# Copyright (c) 2016-2019 Yukiya Nakagawa <yn.airscope@gmail.com>
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OT
@Nkzn
Nkzn / fate.md
Last active August 29, 2015 14:23
これから始めるFate世界

オススメ順は最後に。

本編

  • Fate/stay night
  • TVアニメ(セイバールート) 2006年
@Nkzn
Nkzn / ListActivity.java
Created May 8, 2015 07:47
できるかなと思ったらできちゃったやつ
public class ListActivity extends AppCompatActivity {
@InjectView(R.id.list_view)
ListView listView;
public void onCreate(Bundle savedInstanceState) {
super(savedInstanceState);
ButterKnife.inject(this);
Observable.just(
R.string.listitem1,
@Nkzn
Nkzn / currying.swift
Created January 8, 2015 04:23
カリー化の練習
// カリー化されていない関数
func uncurriedAdd(let a:Int, let b:Int) -> Int {
return a + b
}
uncurriedAdd(1, 2) // 3
uncurriedAdd(2, 23) // 25
uncurriedAdd(4, 2) // 6
// カリー化された関数
@Nkzn
Nkzn / agreement.md
Last active August 29, 2015 14:07
Google Play デベロッパー販売 / 配布契約書が9/25付で更新されてたので、diff取ってみたよー(読みやすさのため、見出しだけ勝手にMarkdown付けました)

Google Play デベロッパー販売 / 配布契約書

定義

「認定携帯通信会社」とは、自社のネットワーク上で対象端末のユーザーに販売された対象製品について販売手数料を受け取ることを認められた携帯電話会社を意味します。

「ブランド表示」とは、各当事者がその時点で所有して(またはライセンス許諾を受けて)いる各当事者の商標名、商標、サービスマーク、ロゴ、ドメイン名、およびその他のブランド識別表示を意味します。