Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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 / 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 / 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 / mouse_move.rb
Created March 19, 2015 10:43
Windowsマウス移動スクリプト
# coding: utf-8
require 'Win32API'
get_cursor_pos = Win32API.new("user32", "GetCursorPos", ['p'], 'v')
$set_cursor_pos = Win32API.new("user32", "SetCursorPos", ['i']*2, 'v')
input_point = " " * 8
get_cursor_pos.Call(input_point)
x, y = input_point.unpack("LL")
puts "grid: #{x}, #{y}"
require 'auto_click'
### parameter
line_length = 90 # カケアミ一本あたりの長さ
interval_x = 5 # カケアミ間の幅(x軸)
interval_y = 3 # カケアミ間の幅(y軸)
times_x = 125 # x軸方向に何本線を引くか
times_y = 5 # y軸方向に何本線を引くか
start_point_x = 50 # 始点(x軸)
start_point_y = 300 # 始点(y軸)
@smison
smison / Guardfile
Last active August 29, 2015 14:17
*.javaの更新を監視してguardで自動ビルド/実行するGuardfile(http://qiita.com/smison/items/598899fa8e03646d1f4e)
require 'guard'
guard 'shell' do
watch(/(.*).java/){|m| `echo; javac #{m[0]}; java #{m[1]}; echo; echo;`}
end