Skip to content

Instantly share code, notes, and snippets.

@seikai
seikai / gist:6914463
Last active December 25, 2015 03:59
BundleIDの書き分け
#!/bin/bash
defines=( DEBUG=1 'HOST=@"http://localhost"' )
#Project名==Target名
PROJECT_NAME="ProjectName"
#BuindleIDのプレフィックス部分
PREFIX="com.sample"
UIImage *image;
NSMutableString *imageName = [[NSMutableString alloc] initWithString:@"Default"];
BOOL isPad = ( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad );
if( isPad )
{
BOOL isLandscape = UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation]);
NSString *imageOrientation = (isLandscape) ? @"Landscape" : @"Portrait";
@seikai
seikai / hideStatusbar.m
Last active December 24, 2015 06:48
hide statusbar on ios7
//viewDidLoad
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
// for iOS 7
[self prefersStatusBarHidden];
[self performSelector:@selector(setNeedsStatusBarAppearanceUpdate)];
} else {
// for under iOS 6
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide];
}
@seikai
seikai / template
Last active December 18, 2015 10:59
amd class define template
define([
"require"
],
function (require) {
/**
* @exports Klass
* @constructor
*/
var Klass = function(){
@seikai
seikai / index.html
Created April 25, 2013 06:36
Google Realtime Api Tutorial + Eclipse Orion (original : https://developers.google.com/drive/realtime/realtime-quickstart)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Google Drive Realtime quickstart</title>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<!-- Load the Realtime libraries. -->
<script type="text/javascript"
src="https://apis.google.com/js/api.js"></script>
@seikai
seikai / DoctrineOrmServiceProvider.php
Last active December 13, 2015 20:38
DoctrineOrmServiceProvider
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\DBAL\Types\Type;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\MemcacheCache;
use Doctrine\Common\Cache\ApcCache;
use Doctrine\Common\Cache\RedisCache;
use Doctrine\Common\Cache\XcacheCache;
@seikai
seikai / rmsvndir.sh
Last active December 11, 2015 21:49
.svnの削除
#!/bin/sh
find . -name ".svn" -delete
@seikai
seikai / log.txt
Last active December 11, 2015 21:38
Homebrew+rbenv+rails install log
brew install rbenv
brew install ruby-build
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
rbenv rehash
brew install readline
brew link readline
CONFIGURE_OPTS="--with-readline-dir=/usr/local" rbenv install 1.9.3-p194
rbenv global 1.9.3-p194
rbenv rehash
@seikai
seikai / scheme.html
Last active December 11, 2015 21:38
Javascriptで遷移を監視して該当スキーマが無ければストアへ
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Test</title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=0" />
</head>
<body>
@seikai
seikai / install.sh
Last active December 11, 2015 21:38
Redmineインストールメモ 環境:CentOS6.3 / Ruby1.9.3-p362 / Apache+Passenger
vi /etc/sysconfig/selinux
setenforce 0
getenforce
vi /etc/sysconfig/iptables
/etc/init.d/iptables restart
yum upgrade
yum update
yum groupinstall "Development Tools"