Skip to content

Instantly share code, notes, and snippets.

@esperia
esperia / gulpfile.js
Created January 3, 2017 07:13
Auto-generate pdf for Lilypond.
var gulp = require('gulp');
var path = require('path');
var shell = require('gulp-shell')
gulp.task('default', ['watch']);
gulp.task('watch', function(){
gulp.watch('./**/*.ly', ['build']);
});
/**
* Jobs Plugin for Bukkit
* Copyright (C) 2011 Zak Ford <zak.j.ford@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
'use strict';
var exec = require('child_process').exec;
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
scripts: {
@esperia
esperia / Munsell.icls
Created September 29, 2014 02:56
Coloring to Logcat for Android Studio
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="Munsell" version="124" parent_scheme="Default">
<option name="LINE_SPACING" value="1.0" />
<option name="EDITOR_FONT_SIZE" value="12" />
<option name="EDITOR_FONT_NAME" value="Menlo" />
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="8b999f" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="323232" />
import android.content.Context;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.TextView;
/**
* サイズ自動調整TextView
*
*/
#!/usr/bin/env sh
CMDNAME=`basename $0`
if [ $# -ne 1 ]; then
echo "Usage: $CMDNAME [on|off]" 1>&2
exit 1
fi
if [ $1 = "on" ]; then
sudo sysctl -w net.inet.ip.forwarding=1
@esperia
esperia / TextToZenkakuTestCase.java
Created August 5, 2014 03:55
半角を全角に変換
package jp.co.kayo.android.test.util;
import android.test.AndroidTestCase;
public class TextToZenkakuTestCase extends AndroidTestCase {
private static final String CODES_SRC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=[]\\;',./`~!@#$%^&*()_+{}|:\"<>?゙゚アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン";
private static final String CODES_DEST = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-=[]¥;',./`~!@#$%^&*()_+{}|:”<>?゛゜アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン";
public static String toZenkaku(String src) {
package jp.co.kayo.android.ksapidemo.app.view;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.view.LayoutInflater;
import android.view.View;
@esperia
esperia / AsyncGenericHttpResponseHandler.java
Last active August 29, 2015 14:00
Require: [Android Asynchronous Http Client](http://loopj.com/android-async-http/). introduced:[Android Asynchronous Http Clientで大きな画像をダウンロードする方法 - Spica*](http://esperia.hatenablog.com/entry/2014/04/27/020516)
public abstract class AsyncGenericHttpResponseHandler<T> extends AsyncHttpResponseHandler {
private static final String LOG_TAG = AsyncGenericHttpResponseHandler.class.getSimpleName();
@SuppressWarnings("unchecked")
@Override
protected void handleMessage(Message msg) {
Object[] response;
if (msg.what == AsyncHttpResponseHandler.SUCCESS_MESSAGE) {
response = (Object[]) msg.obj;
brew install markdown
mkdir -p $HOME/Dev/markdown
curl -o $HOME/Dev/markdown/github.css -L https://gist.github.com/andyferra/2554919/raw/2e66cabdafe1c9a7f354aa2ebf5bc38265e638e5/github.css