Skip to content

Instantly share code, notes, and snippets.

View kyuuki's full-sized avatar
🏯
I'd like to join

kyuuki kyuuki

🏯
I'd like to join
View GitHub Profile
require 'fileutils'
# 全部の .svn ディレクトリを削除
Dir::glob("../howm/**/.svn").each do |file|
puts file
s = File::stat(file)
if s.ftype == "directory"
# ディレクトリ削除
FileUtils.rm_r(file)
end
@kyuuki
kyuuki / .bash_aliases
Created November 28, 2016 21:34
.bash_aliases
# .bash_aliases
alias ls='ls -F'
alias ll='ls -l'
alias rm='rm -i'
if [ -x "`which vim`" ]; then
alias vi='vim'
fi
alias view='vi -R'
# -*- coding: utf-8 -*-
require 'win32ole'
module Worksheet
def [] y,x
self.Cells.Item(y,x).Value
end
def []= y,x,value
self.Cells.Item(y,x).Value = value
@kyuuki
kyuuki / .gitconfig
Last active October 22, 2016 07:40
[core]
editor = vi
excludesfile = ~/.gitignore_global
[user]
[alias]
tree = log --graph --all --format=\"%x09%C(cyan bold)%an%Creset%x09%C(yellow)%h%Creset %C(ma
genta reverse)%d%Creset %s\"
[color]
ui = auto
[log]
@kyuuki
kyuuki / gist:7094774
Created October 22, 2013 03:28
Java でデフォルト AES で暗号化、BASE64 したものをデコード
#!/usr/bin/env ruby
require 'openssl'
require 'base64'
key = "XXXXXXXXXXXXXXXX"
aes = OpenSSL::Cipher::AES.new("128-ECB")
aes.decrypt
aes.key = key
plain_text = ""
@kyuuki
kyuuki / resizeTextView.java
Created June 4, 2013 07:24
Android でテキストが 1 行に収まるように調整。
/**
* TextView のテキストサイズを 1 行に収まるように調整。
*
* https://gist.github.com/STAR-ZERO/2934490 を参考にした
*/
public static float resizeTextView(TextView textView, float minTextSize) {
float textSize = getAdjustTextSize(textView.getWidth(), textView.getText().toString(),
textView.getTextSize(), minTextSize);
// テキストサイズ設定 (setTextSize はデフォルトで sp 指定なので TypedValue.COMPLEX_UNIT_PX を指定すること!)
@kyuuki
kyuuki / erb_sample.rb
Created May 10, 2013 07:22
ERB sample
File.open("output.html", "w") do |f|
erb = ERB.new(File.read("template.html.erb"), nil, "-")
f.puts erb.result(binding)
end
@kyuuki
kyuuki / .bash_relaias
Created January 16, 2013 03:18
If it exists a command, make alias
which vim && alias vi='vim'