Skip to content

Instantly share code, notes, and snippets.

@xtetsuji
xtetsuji / move-to
Last active April 10, 2018 06:33
move-to DIR FILE...: yet another mv command which gets destination and sources as its reverse order.
#!/bin/bash
# xtetsuji 2018/04/10
# Usage:
# move-to DIR FILE1 FILE2 ...
#
# mv FILE1 FILE2 ... DIR ; 移動元ファイル群と移動先の指定が逆なもの
#
# これは xargs で役立つ
# e.g.:
# 4並列、一度の移動プロセスで最大100ファイルを目的のディレクトリへ移動させる場合
@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
@kaiinui
kaiinui / eventbus.md
Last active March 3, 2017 03:54
Android開発いろいろ

EventBus

EventBus は必ず onStart()onStop() で呼ぶ。バックグラウンドで色々動かれて困る。 また、onStop() では super.onStop() よりも 先に 呼ぶ。

@Override
protected void onStart() {
 super.onStart();
@wangkuiyi
wangkuiyi / pre-commit-clang-format
Last active August 19, 2021 14:04
Git pre-commit hook that invokes clang-format to reformat C/C++/Objective-C source code.
#!/bin/bash
# git pre-commit hook that runs an clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
# modifications for clang-format by [email protected]
# This file is part of a set of unofficial pre-commit hooks available
# at github.
@kokudori
kokudori / gist:4e685d873ffa38545330
Created December 2, 2014 13:58
バグの定義について
Re: http://blog.goo.ne.jp/hishidama/e/701f48e62000243418c0a0f251f118b9
バグはそもそも複合的な概念なので、絶対的な基準で定義できるものではないと思います。
平たく言えば、文脈に依存するものなので、各々の文脈での「バグ」の定義が衝突することはありえます。
それが嫌な場合は各々の文脈の「バグ」を定義するしかないと思います。
少なくとも、何の前提もなく「バグ」と言った場合は日常用語だと思うので、そもそも論として科学的な議論の対象としては不適当だと思います。
その上で、「仕様を満たしているかどうか」をバグの基準とする考えは一般的ですし、異論はありません。
しかし、その定義もあらゆる意味での「バグ」を説明できているとは思えません。
また、私自身も失敗の観点から「バグ」を定義するやり方は筋悪だと思います。
@x7c1
x7c1 / LeftConverter.scala
Last active August 29, 2015 14:05
sample to put F[ \/[...] ] in for-yield and convert from F[E1 \/ A] to F[E2 \/ A]
import scala.language.higherKinds
import scalaz.{Functor, \/}
class LeftConverter[E1, E2](g: E1 => E2) {
def apply[A, F[_]](f: F[E1 \/ A])(implicit F: Functor[F]): F[E2 \/ A] =
F.map(f)(_.leftMap(g))
}
object LeftConverter {
def apply[E1, E2](g: E1 => E2): LeftConverter[E1, E2] = new LeftConverter(g)
@yamajun
yamajun / google_cardboard_note.md
Last active August 29, 2015 14:03
Google Cardboard作成時に得たノウハウを記録しておく。
@voluntas
voluntas / eval.rst
Last active November 25, 2024 08:17
評価制度の無い評価制度
@exoego
exoego / 転職先に訊きたいチェックリスト.md
Last active May 25, 2024 15:30
転職活動してて訊きたいことのメモ

制度

  • 有休…
  • 病休…
  • 育休…
  • 年収(月給、賞与など)…
  • 残業代…
  • 早朝/深夜手当…
  • 休出手当…
  • 住宅補助…
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')