Skip to content

Instantly share code, notes, and snippets.

@smison
smison / livereloadx.txt
Last active August 29, 2015 14:17
livereloadx導入までの道のり
- goemonを使ってみようとする
- 参考
- Installing Go from source https://golang.org/doc/install/source
$ cd ~
$ git clone https://go.googlesource.com/go
$ cd go
$ git checkout -b go1.4.1
$ cd go/src
$ ./all.bash
@smison
smison / android_studio_memo.txt
Last active August 29, 2015 14:16
AndroidStudioメモ
- 基本操作
- Windowのキーボード移動: Alt+Space > M
- プレビューの表示
- http://hipopocroco.hatenablog.com/entry/2014/05/27/234647
- ComponentTreeも同様にこの「Design」表示時に現れる
- ショートカット
http://qiita.com/sugoi_wada/items/db449d5cbb5c83cb586c
- コメントアウト: Ctrl + /
- 定義に移動: Ctrl + b
@smison
smison / blender_memo.txt
Last active August 29, 2015 14:16
Blenderメモ
- CLIPSTUDIO PAINTとの連携
- fbx, objで保存してCLIPSTUDIO PAINTにdropすればok
- ショートカット
- tab: オブジェクトモードとエディットモードの切替え
- /: LocalMode
- h(alt+h): Hide(unHide)
- z: WireFlame <-> Solid
- テンキー(alphabet部では不可)
@smison
smison / tex_memo.tex
Last active December 12, 2015 13:23
Tex memo
\documentclass{jsarticle}
\usepackage{amsmath}
\usepackage{amsfonts}
\begin{document}
$\forall x \in \mathbb{R} \big( P(x) \big)$
$\text{card}(\mathbb{Z}) = \text{card}(\mathbb{Q})$
\end{document}
@smison
smison / twitter_image_post_notice.rb
Last active August 29, 2015 14:16
実行当日にTwitterにpng/jpgを投稿していなければメール送信するスクリプト
#! /usr/local/bin/ruby
#coding: utf-8
### requires ##################################################
require 'twitter'
require 'uri'
require 'open-uri'
require 'nokogiri'
require 'mail'
###############################################################
@smison
smison / resize.bat
Last active August 29, 2015 14:16
同じディレクトリのpng画像を長辺900pxにリサイズするbatファイル(http://qiita.com/smison/items/d32eb72be807e099dfa0)
setlocal enabledelayedexpansion
for %%f in (*.png) do (
REM 画像の縦幅を取得
for /f "usebackq tokens=*" %%i in (`identify -format '%%h' %%f`) do @set HEIGHT=%%i
REM 画像の横幅を取得
for /f "usebackq tokens=*" %%i in (`identify -format '%%w' %%f`) do @set WIDTH=%%i
if !HEIGHT! GEQ !WIDTH! (
@smison
smison / contribution_notice.rb
Last active November 1, 2017 00:51
Githubにcontributeしていないとメール通知するスクリプト(http://qiita.com/smison/items/8e25c6dd84c64f0711c3)
#! /usr/local/bin/ruby
# === parameters ================================
USER_NAME = 'XXXXX' # Gtihubのユーザ名
MAIL_ADDR_FROM = 'XXXXX@XXXXX' # 通知メールのfrom
MAIL_ADDR_TO = 'XXXXX@XXXXX' # 通知メールのto
# === requires ==================================
require 'nokogiri'
require 'open-uri'
@smison
smison / mecab
Created February 27, 2015 02:49
ruby-mecabインストール手順
### mecab, ruby-mecab導入
http://sourceforge.jp/projects/sfnet_mecab/downloads/mecab/0.97/mecab-0.97.tar.gz/
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
$ sudo yum install mecab
$ sudo yum install mecab-devel
$ sudo rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm
$ sudo yum install -y groonga-tokenizer-mecab
「$ mecab -v」でバージョンを確認して、
同じバージョンのmecab-rubyをダウンロードする(バージョンが違うとmake出来ないので注意)
$ wget http://mecab.googlecode.com/files/mecab-ruby-0.996.tar.gz
require 'fssm'
watch_dir = '~/watch_action'
def create_action(base, file)
puts 'hoge'
end
def update_action(base, file)
puts 'hoge'
@smison
smison / getActiveWindowTitle.rb
Last active November 26, 2015 11:08
windowsでアクティブなウィンドウのタイトルを取得する
$ gem install win32-api
※参考 http://stackoverflow.com/questions/14220386/ruby-win32-api-getfocus-and-getwindowtext
require 'win32/api'
include Win32
while true do
hwnd = GetActiveWindow = API.new('GetForegroundWindow', 'V', 'L', 'user32').call
GetWindowText = API.new('GetWindowText', 'LPI', 'I', 'user32')
GetWindowTextLength = API.new('GetWindowTextLength', 'L', 'I', 'user32')
buf_len = GetWindowTextLength.call(hwnd)