Skip to content

Instantly share code, notes, and snippets.

View youcune's full-sized avatar

なかにしゆう youcune

View GitHub Profile
@youcune
youcune / push.bas
Created April 20, 2013 07:13
Variant型の配列に要素を追加するVBA
' Variant型の配列に要素を追加する
Sub Push(ByRef v As Variant, e)
ReDim Preserve v(UBound(v) + 1)
v(UBound(v)) = e
End Sub
@youcune
youcune / pre-commit
Last active January 1, 2016 06:49
git commitしたときに全角チルダが含まれていたらコミットを拒否する。EUC/UTF-8対応。Windowsで見ると全角チルダが化けてしまうためチェックスクリプト化しました。.git/hooks/pre-commitに設置して使います。
#!/usr/bin/env perl
# git commitしたときに全角チルダが含まれていたらコミットを拒否する
# \x8F\xA2\xB7 : EUC-JPで全角チルダ
# \xEF\xBD\x9E : UTF-8で全角チルダ
use strict;
use warnings;
our @files = `git diff-index --name-status HEAD | cut -c3-`;
@youcune
youcune / romantable.txt
Last active March 19, 2024 01:37
AZIK配列のいつも使うGoogle日本語入力用ローマ字テーブル
~ ~
, 、
. 。
/ ・
: ー
; っ
[ 「
] 」
a あ
ba ば
@youcune
youcune / Lucida Grande+ヒラギノ角ゴ.xml
Created January 8, 2014 02:32
これを ~/Library/Application Support/Microsoft/Office/ユーザー テンプレート/個人用テーマ/Theme Fonts に設置すると、Mac版PowerPointでヒラギノ角ゴをデフォルトフォントにしたテーマが使えます。 参考 http://irritantis.info/2013/08/font_pattern_for_mac_powerpoint_theme/
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<a:fontScheme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Lucida Grande+ヒラギノ角ゴ"><a:majorFont><a:latin typeface="Lucida Grande"/><a:ea typeface="ヒラギノ角ゴ ProN"/><a:cs typeface=""/></a:majorFont><a:minorFont><a:latin typeface="Lucida Grande"/><a:ea typeface="ヒラギノ角ゴ ProN"/><a:cs typeface=""/></a:minorFont></a:fontScheme>
@youcune
youcune / example1.rb
Created March 25, 2014 07:51
Rubyでクラス変数の使い方の例
#!/usr/bin/env ruby
class Parent
def self.puts_var
puts self.class_variable_get(:@@CLASS_VAR)
end
def puts_var
puts self.class.class_variable_get(:@@CLASS_VAR)
end
@youcune
youcune / Rails-Gemfile
Last active August 29, 2015 13:59
いつも使うRailsアプリのテンプレートGemfile
source 'https://rubygems.org'
# Rails
gem 'rails', '4.1.0'
# Views
gem 'haml-rails'
# Assets
gem 'sass-rails'
@youcune
youcune / svn_status_to_delete.sh
Created June 25, 2014 02:25
SVN で ! がついているファイルを一括 svn delete
svn status | grep '^!' | cut -c 9- | xargs svn delete
@youcune
youcune / function-usage.js
Created June 28, 2014 12:44
Javascriptの無名関数
function myFunc(){
alert('HELLO');
}
myFunc();
// ↓ 同じ動きをする
var myFunc = function(){
alert('HELLO');
}
@youcune
youcune / revert-file.sh
Created August 13, 2014 01:45
Git で特定ファイルを特定コミットの状態にする
git checkout <revision> <path>
@youcune
youcune / Gemfile
Created August 24, 2014 03:17
http://yurie.sexy/ でつかっている Gemfile
source 'https://rubygems.org'
# Rails
gem 'rails', '4.1.4'
# Date
gem 'holiday_japan'
# Assets
gem 'coffee-rails'