Skip to content

Instantly share code, notes, and snippets.

View iyuuya's full-sized avatar
⚠️
REMOVED ALL MY REPOSITORIES

Yuya Ito iyuuya

⚠️
REMOVED ALL MY REPOSITORIES
View GitHub Profile
@iyuuya
iyuuya / gist:3231301
Created August 1, 2012 22:34
Objective-C における @Property@synthesize の簡単な説明
// ------------------------------------------------------------------------ //
#pragma mark - 定義ファイル側
@interface SomeClass : NSObject
{
// ここにメンバ変数を定義できるが、しなくてもよい
// (@synthesize 時に実体となる変数を定義できるため)
NSObject *_apple; // メンバ変数 _apple を定義しておく (後の例示の為)
}
require 'sdl'
require 'tk' if /darwin/ =~ RUBY_PLATFORM
SDL.init SDL::INIT_EVERYTHING
screen = SDL.set_video_mode 640, 480, 16, SDL::SWSURFACE
sleep 3
# coding: utf-8
class Game
def initialize
@rolls = []
end
def roll(pins)
@rolls << pins
@iyuuya
iyuuya / test.rb
Last active December 24, 2015 08:49
class Image < ActiveRecord::Base
belongs_to :imageable, polymorphic: true, foreign_key: 'xxx_id', foreign_type: 'xxx_type'
end
class User < ActiveRecord::Base
has_many :image_hoge, as: :imageable, class_name: 'Image'
end
> コードの海になんとやら!! <
@iyuuya
iyuuya / build-zsh.sh
Last active August 29, 2015 13:57 — forked from nicoulaj/build-zsh.sh
#!/bin/sh​
# Build Zsh from sources on Ubuntu.
# From http://zsh.sourceforge.net/Arc/git.html and sources INSTALL file.
# Some packages may be missing
sudo apt-get install -y git-core gcc make autoconf yodl libncursesw5-dev texinfo
cd /tmp
git clone git://zsh.git.sf.net/gitroot/zsh/zsh
@iyuuya
iyuuya / php-build-definitions-5.3.29.diff
Last active August 29, 2015 14:22
Build PHP 5.3.29 for Mac
```
diff --git a/share/php-build/definitions/5.3.29 b/share/php-build/definitions/5.3.29
index 5b185ec..e34db9d 100644
--- a/share/php-build/definitions/5.3.29
+++ b/share/php-build/definitions/5.3.29
@@ -1,3 +1,5 @@
+configure_option "--with-openssl=/usr/local/opt/openssl"
+
install_package "http://php.net/distributions/php-5.3.29.tar.bz2"
install_pyrus
class A; end
class B
def hoge
# do something
end
end
class C
def hoge(*vals)
@iyuuya
iyuuya / git-rebase--interactive.patch
Last active May 23, 2016 00:35
git rebase --interactiveのフォーマットを変更する
1185c1185
< git rev-list $merges_option --format="%m%H ${format:-%s}" \
---
> git rev-list $merges_option --format="%m%H %an <%ae> ${format:-%s}" \
@iyuuya
iyuuya / ip-or-basic-auth-httpd.conf
Last active May 23, 2016 11:08
Apache: IP制限orBasic認証設定
<VirtualHost *:80>
ServerName hoge.example.com
DocumentRoot /var/www/path/to/app/public
ErrorLog logs/hoge_error_log
CustomLog logs/hoge_access_log combined
<Directory "/var/www/path/to/app/public">
Options FollowSymLinks IncludesNoExec
AllowOverride FileInfo Indexes Limit Options
AuthType Basic