Skip to content

Instantly share code, notes, and snippets.

update
upgrade
install android-ndk
install gibo
install mackup
install android-sdk
install git
install zsh
@gin0606
gin0606 / UIDevice+GINUniqueIdentifier.h
Last active August 29, 2015 13:56
iOS7以降でuniqueIdentifierを取得(生成)する。
//
// Created by gin0606 on 2013/10/03.
//
#import <Foundation/Foundation.h>
@interface UIDevice (GINUniqueIdentifier)
- (NSString *)gin_uniqueIdentifier;
@end
@gin0606
gin0606 / Rakefile
Last active August 29, 2015 13:58
Upload to TestFlight and DeployGate from TravisCI
require 'yaml'
require 'xcodeproj'
APP_NAME = 'TestProject'
BUILD_CONFIFURATION = 'Release'
CODE_SIGN_IDENTITY = 'iPhone Distribution'
KEYCHAIN_NAME = "ios-build.keychain"
WORKING_DIRECTORY = `pwd`.chomp
WORKSPACE_PATH = "#{WORKING_DIRECTORY}/#{APP_NAME}.xcworkspace"
@gin0606
gin0606 / shinchoku.coffee
Last active August 29, 2015 13:58
hubot script
# Description:
# 進捗 is the most important thing in your life
#
# Dependencies:
# None
#
# Configuration:
# None
#
# Commands:
@gin0606
gin0606 / gist:10618604
Created April 14, 2014 05:30
Excelで作られたCSVをsqliteに適当に突っ込む奴
require 'fileutils'
require 'csv'
require 'sqlite3'
DB_FILE_NAME = 'tmp.sqlite';
FileUtils.rm(DB_FILE_NAME) if File.exist?(DB_FILE_NAME)
DB = SQLite3::Database.new(DB_FILE_NAME)
def create_table(file_name)
csv = CSV.open(file_name, 'r', encoding: "SJIS")
require 'xcodeproj'
APP_NAME = 'APP_NAME'
BUILD_CONFIFURATION = 'Release'
CODE_SIGN_IDENTITY = 'iPhone Distribution'
PROJECT_PATH = "#{Dir.pwd}/#{APP_NAME}/proj.ios_mac/#{APP_NAME}.xcodeproj"
project = Xcodeproj::Project.open(PROJECT_PATH)
SCHEME = project.targets.find{|elem| elem.name == 'APP_NAME'}
language: objective-c
before_install:
- brew update
- brew install android-sdk
- brew install android-ndk
- export ANDROID_HOME=/usr/local/opt/android-sdk
- export NDK_ROOT=/usr/local/opt/android-ndk
- echo y | android update sdk --filter tools,platform-tools,android-10,android-14 --no-ui --force
install:
- bundle install

諸事情でRakefileからbrewコマンドを叩いてるんだけど、何故かGemfileのSyntaxErrorが出る。

Rakefileの抜粋は以下

task :setup do
  next if not can_adhoc?
  sh "brew update"
  sh "brew install ant android-sdk android-ndk"
  sh "echo y | android update sdk --filter tools,build-tools-19.0.3,platform-tools,android-10,android-14 --no-ui --force"
@gin0606
gin0606 / gist:0d771faee1d9b0b3d9a7
Created May 15, 2014 05:42
build-toolsのバージョン上がるたびにファイル書き換えるの面倒で書いたけど、みんなどうしてるの
class AndroidSDKPackage
def initialize line
id_name = line[0].split('or').map { |l| l.strip }
@id = id_name[0].split(':')[1].strip
@name = id_name[1].delete('"')
@type = line[1].split(':')[1].strip
@description = line[2].split(':')[1].strip
end
attr_accessor :id, :name, :type, :description
end
class DeployGate
def self.invite user_name, api_fragment, app_id, token
invite_api_url = "https://deploygate.com/api/users/#{account_name}/#{api_fragment}/#{app_id}/members"
%x(curl '#{invite_api_url}' -F 'users=[#{user_name}]' -F 'token=#{token}' -F role=2)
end
def self.upload file_path, token
%x(curl 'https://deploygate.com/api/users/#{account_name}/apps' -F 'file=@#{file_path}' -F 'token=#{token}')
end
end