Skip to content

Instantly share code, notes, and snippets.

View fuka's full-sized avatar

y.fukazawa fuka

View GitHub Profile
@fuka
fuka / capnow.bat
Created November 22, 2021 10:15
adbコマンドでスクリーンショットを撮るバッチファイル
@echo off
rem ファイル名に日時を入れる
set dt=%date%
set tm=%time: =0%
set d=%dt:~0,4%%dt:~5,2%%dt:~8,2%
set t=%tm:~0,2%%tm:~3,2%%tm:~6,2%
set file_name=screenshot_%d%_%t%.png
@fuka
fuka / .editorconfig
Created January 11, 2021 16:58
Android Studio で新しいプロジェクトを作ったときに適用する editorconfig 設定
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
@fuka
fuka / Vagrantfile
Created November 3, 2019 12:27
asciidoctor-pdf-linewrap-ja の開発環境構築用
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# box
config.vm.box = "centos/7"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
@fuka
fuka / patch.rb
Last active September 21, 2019 09:50
Asciidoctor Diagramでditaaに日本語が含まれていたら後ろに半角スペースを挿入するExtension
require 'asciidoctor/extensions' unless RUBY_ENGINE == 'opal'
include Asciidoctor
Extensions.register do
preprocessor do
process do |document, reader|
new_lines = []
status = Status::OUTSIDE
@fuka
fuka / index.js
Last active June 7, 2018 12:32
amazon.co.jpのASINから商品名を取得する
const client = require('cheerio-httpcli');
const ids = [
'B06XDFJJRS',
'B00IOY56P8',
'B01FIG3SMC',
'B0186FEWLS',
];
ids.forEach(function(value) {
@fuka
fuka / document.adoc
Last active March 3, 2018 11:53
AsciiDoctor PDFで日本語フォントを変更するサンプル

日本語フォントを適用したPDFサンプル

日本国憲法

前文

@fuka
fuka / Util.java
Last active September 26, 2017 12:25
assetsにあるテキストファイルを読み込むロジック。全部まとめてメモリに読み込むので長大なテキストには向いていないことに注意。
/**
* @param context Context
* @param fileName ファイル名
* @param charset 文字コード
* @return 読み込んだテキスト
*/
public static String loadStringFromAssets(Context context, String fileName, String charset) throws IOException {
String str = null;
InputStream is = null;
@fuka
fuka / AndroidManifest.xml
Last active August 5, 2017 10:46
Firebase Cloud Messagingの中身をログに出力する
...
<receiver
android:name=".FirebaseDataReceiver"
android:exported="true"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</receiver>
...
@fuka
fuka / app.gradle
Created March 9, 2017 13:31
apkの名前をいい感じにする
applicationVariants.all { variant ->
variant.outputs.each { output ->
if (output.outputFile != null && output.outputFile.name.endsWith('.apk')) {
def nameSuffix = variant.buildType.hasProperty('versionNameSuffix') ? variant.buildType.versionNameSuffix : ""
def newName = "${APPLICATION_NAME}-${defaultConfig.versionName}${nameSuffix}.apk"
output.outputFile = new File(output.outputFile.parent, newName)
}
}
}
@fuka
fuka / config.toml
Created January 2, 2017 11:18
HugoにDiqsusを導入するためのコード片
# Disqus
disqusShortname = "backport"