Skip to content

Instantly share code, notes, and snippets.

  • ア02 二松学舎大学文藝愛好会,二松維新「都市」,¥200.
  • ア06 水天宮前,水天, vol. 3,¥300.
  • ア19 京都ジャンクション,京都ジャンクション 第九作品集,¥300.
  • イ10 マゾヒスティック・リリィ・ワークス,ラフレシア・アルノルディ——ダメ百合短編集,¥400.
  • イ13 朝顔日誌,HOLE,¥100.
  • イ25 トリアトリエ,オッチャリ,¥400.
  • ウ30 薄禍企画,mint,vol. 01,¥500.
  • エ23 カモガワSFシリーズKコレクション,稀刊 奇想マガジン 創刊号——奇想コレクション綜解説,¥400.
  • エ31 あの日熱めの熱燗で,多重要素, 3.5号,¥100.
  • エ34 グローバルエリート,SFアンソロジー WORKセリエント(GE1),¥1500.
@hackugyo
hackugyo / paternalism.md
Created March 11, 2016 04:40
パターナリズム(SEP)
@hackugyo
hackugyo / destroy_circled.rb
Last active March 9, 2016 04:22
丸囲み文字が我慢できないときに、Rubyで置換するスクリプト
def destroy_circled(text, suffix = '. ')
text
.gsub('①', '1' + suffix)
.gsub('②', '2' + suffix)
.gsub('③', '3' + suffix)
.gsub('④', '4' + suffix)
.gsub('⑤', '5' + suffix)
.gsub('⑥', '6' + suffix)
.gsub('⑦', '7' + suffix)
.gsub('⑧', '8' + suffix)
@hackugyo
hackugyo / EllipsizingTextView.java
Created February 18, 2016 07:44 — forked from stepango/EllipsizingTextView.java
Android TextView not support ellipsize if your text fills more than i line. This implementation solved this problem and allow you to use Instagram style end of line mark "[...]"
/*
* Copyright (C) 2011 Micah Hainline
* Copyright (C) 2012 Triposo
* Copyright (C) 2013 Paul Imhoff
* Copyright (C) 2014 Shahin Yousefi
* Copyright (C) 2015 Stepan Goncharov
*
* 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
@hackugyo
hackugyo / test.sh
Last active February 5, 2016 03:44
Why?
echo "hoge" | echo $(cat -) `echo *$(cat -)*` fuga
# => hoge test.sh fuga
# not => hoge *hoge* fuga
@hackugyo
hackugyo / git_open_origin.sh
Last active February 2, 2016 10:13
現在のgitリポジトリのoriginのremoteをWebで開きます。
git_open_origin() {
(set -eu -o pipefail; \
commit_hash=${1:-""}; \
blob_where=${2:-""};
if [ -n "${commit_hash}" ]; then \
if [ -n "${blob_where}" ]; then \
commit_hash="/blob/${commit_hash}/${blob_where}"; \
else \
commit_hash="/commits/${commit_hash}"; \
fi; \
public class FontFitViewHolder extends RecyclerView.ViewHolder {
private final FontFitViewHolder self = this;
private Handler mHandler;
public BandCheckViewHolder(View v, int height) {
super(v);
mCardView = (CardView)itemView;
mTextView = (MultiLineEllipsizeTextView) v.findViewById(R.id.viewholder_fontfit_card);
}
@hackugyo
hackugyo / extract_between_parentheses.rb
Created January 6, 2016 18:19
与えられたカッコ(なんでも.開きと閉じとの定義を引数にくれればいい)内を抜き出します. ruby extract_between_parentheses.rb "「」" YOUR_FILE_NAME
# coding: utf-8
open_paren = Regexp.quote(ARGV[0][0])
close_paren = Regexp.quote(ARGV[0][1])
open(ARGV[1]).read.lines
.select {|x| x.include?(ARGV[0][0]) && x.include?(ARGV[0][1])}
.map{|x|
x
.gsub(/^(.*?)#{open_paren}/, "#{open_paren}")
.gsub(/#{close_paren}[^#{open_paren}]*$/, "#{close_paren}")
@hackugyo
hackugyo / ObservableUtils.java
Last active September 4, 2020 10:57
RxのgroupByが、groupっつってんのにKey / ValueのHashMapをすなおに返す方法がなさそう(途中で止まってしまう)ので、いったんPairのListの形でtoList().toBlocking().single()で吐き出させて、しかるのちにHashMapに入れるようにした。AbstractMap.SimpleEntryのかわりにPairを使ってもいい。
import java.util.AbstractMap;
import java.util.HashMap;
import java.util.List;
import rx.Observable;
import rx.functions.Func1;
import rx.functions.Func2;
import rx.observables.GroupedObservable;
@hackugyo
hackugyo / initializeFinalInstance.java
Last active December 9, 2015 07:46
Androidでstatic finalなインスタンスが複雑な場合、こうやって初期化する
static final String AUTH_TOKEN_TYPE;
static {
StringBuilder sb = new StringBuilder();
sb.append("oauth2:");
for (String scope : AUTH_SCOPES) {
sb.append(scope);
sb.append(" ");
}