Skip to content

Instantly share code, notes, and snippets.

View STAR-ZERO's full-sized avatar

Kenji Abe STAR-ZERO

View GitHub Profile
@STAR-ZERO
STAR-ZERO / proguard-rules.pro
Created July 19, 2014 16:59
ActiveAndroidのProGuard設定
-keep public class com.activeandroid.** { *; }
-keep public class * extends com.activeandroid.Model
-keepattributes *Annotation*
@STAR-ZERO
STAR-ZERO / GestureView.h
Last active August 29, 2015 14:04
GestureRecognizerで移動、拡大・縮小、回転
#import <UIKit/UIKit.h>
@interface GestureView : UIView <UIGestureRecognizerDelegate>
@end
@STAR-ZERO
STAR-ZERO / gist:5a8e9fac5e78d7980de0
Created August 5, 2014 14:54
AnsibleからVagrantにアクセスするための設定

AnsibleからVagrantにアクセスするための設定

Vagrant側の設定

IPアドレスを設定しておく

config.vm.network "private_network", ip: "192.168.33.10"
@STAR-ZERO
STAR-ZERO / gist:ab2ee83c829b9dc2e219
Created November 27, 2014 06:01
AppExtensionを含むアプリのTestFlightへのアップロード
#! /bin/sh
# TestFlight upload notes
while getopts "m:" opts
do
case $opts in
m)
NOTES=$OPTARG ;;
esac
done
@STAR-ZERO
STAR-ZERO / Resize iOS Image Directory.jsx
Last active August 29, 2015 14:10
iOSで@3xの画像から@1x@2xの画像にリサイズするPhotoshopスクリプト
// フォルダを指定して一括リサイズ
function resizeImage(file, destFolder) {
try {
var doc = open(file, OpenDocumentType.PNG)
if (doc == null) {
throw "Something is wrong with the file. Make sure it's a valid PNG file.";
}
@STAR-ZERO
STAR-ZERO / gist:d5e1c6dfbd825d98cecb
Created February 5, 2015 04:52
複数のOptionalをunwrap
import Foundation
func unwrap2<T1, T2>(a: T1?, b: T2?) -> (T1, T2)? {
switch (a, b) {
case (let .Some(a), let .Some(b)):
return (a, b)
default:
return nil
}
}

HomebrewでPostgreSQL

インストール

$ brew install postgresql

初期化

@STAR-ZERO
STAR-ZERO / first_coding_2012.js
Created January 1, 2012 14:59
first coding 2012
function happyNewYear() {
alert('A Happy New Year');
}
@STAR-ZERO
STAR-ZERO / cat.rb
Created January 25, 2012 04:39
Ruby first
class Cat
def initialize
@word = 'にゃんにゃん'
end
def nyan
print @word
print "\n"
end
end
@STAR-ZERO
STAR-ZERO / fizzbuzz.rb
Created April 12, 2012 11:27
RubyでFizzBuzz
(1..100).each {|i|
if i % 15 == 0 then
p "Fizz Buzz"
elsif i % 5 == 0 then
p "Buzz"
elsif i % 3 == 0 then
p "Fizz"
else
p i
end