Category Archives: Mac OS X

Macにphp7+xdebugをインストールするメモ

インストール手順
brew install php70
brew install php70-xdebug
php -i | grep xdebug.ini
vim /usr/local/etc/php/7.0/conf.d/ext-xdebug.ini

設定内容
[xdebug]
zend_extension=”/usr/local/opt/php70-xdebug/xdebug.so”
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_host= localhost
xdebug.remote_port = 9001
xdebug.idekey = PHPSTORM
xdebug.remote_autostart=1
xdebug.remote_log=/var/tmp/xdebug.log

Mac OS Xにscutilコマンドでホスト名を変更するメモ

以下のコマンドでホスト名を変更
$ sudo scutil –set ComputerName NewNameFormacosx
$ sudo scutil –set HostName NewHostnameFormacosx

ホスト名の確認
$ scutil –get ComputerName
$ scutil –get HostName

/etc/hostsにホスト名を設定

$ echo 127.0.0.1 NewHostnameFormacosx >> /etc/hosts

ネットワークサービスを再起動
$ sudo dscacheutil -flushcache
$ sudo killall -HUP mDNSResponder

Macでバーチャルホストを構築するメモ

httpd.confを編集
$sudo vi /etc/apache2/httpd.conf

下記の行のコメントを外す
Include /private/etc/apache2/extra/httpd-vhosts.conf

httpd-vhosts.confを編集
$ sudo vi /etc/apache2/extra/httpd-vhosts.conf
追記
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName localhost
DocumentRoot /Library/WebServer/Documents
<Directory /Library/WebServer/Documents>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>

<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName resume_parse_manager.test.com
DocumentRoot /Users/kdfliuser/Zend/workspaces/resume_parse_manager/Public
<Directory /Users/kdfliuser/Zend/workspaces/resume_parse_manager>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
</Directory>
</VirtualHost>

Mac OSにmaven3.3.9をインストールするメモ

1.mavenのダウンロード
https://maven.apache.org/download.cgi

2.解凍
/usr/local/etc/maven-3.3.9

3.bash_profileの修正
$ vi ~/.bash_profile
export M2_HOME=/usr/local/etc/maven-3.3.9
export PATH=$PATH:$M2_HOME/bin
$ source ~/.bash_profile

4.versionの確認
$mvn -v

Macにphpredis-masterをインストールするメモ

1.phpredisのextensionパッケージをダウンロード
ダウンロードURL
https://nodeload.github.com/nicolasff/phpredis/zip/master

2.操作コマンド:
#cd phpredis-master/
#./configure –with-php-config=/usr/bin/php-config
#make
#sudo make install
# /usr/lib/php/extensions/no-debug-non-zts-20100525/

# extensionを置く場所
#vim /etc/php.ini
#追加
extension=redis.so

#apache再起動
#sudo apachectl restart

#確認
#php -m |grep redis

MacにPHP 5.6をインストールする

1.PHPリポジトリの追加

$ brew tap
homebrew/core
$ brew tap homebrew/versions
$ brew tap homebrew/dupes
$ brew tap homebrew/php

homebrew/phpダウンロード
https://github.com/Homebrew/homebrew-php
2.PHP5.6をインストール
$ brew search php56

$ brew install homebrew/php/php56

3.バージョンの確認
$ php -v

Macにbrewhomeでnginxをインストールする

1.操作コマンド
hematoMacBook-Pro:~ hechangmin$ brew search nginx
nginx
hematoMacBook-Pro:~ hechangmin$ brew install nginx
==> Installing nginx dependency: pcre
==> Downloading ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.
######################################################################## 100.0%
######################################################################## 100.0%
==> ./configure –prefix=/usr/local/Cellar/pcre/8.13 –enable-utf8 –enable-unic
==> make test
==> make install
/usr/local/Cellar/pcre/8.13: 111 files, 2.9M, built in 54 seconds
==> Installing nginx
==> Downloading http://nginx.org/download/nginx-1.0.8.tar.gz
######################################################################## 100.0%
==> Patching
patching file auto/lib/pcre/conf
patching file conf/nginx.conf
==> ./configure –prefix=/usr/local/Cellar/nginx/1.0.8 –with-http_ssl_module –with-pcre –conf-path=/usr/local/etc/nginx/nginx.conf –pid-path=/usr/local/var/run/nginx.pid –lock-path=/usr/local/var/ngi
==> make install
==> Caveats
In the interest of allowing you to run `nginx` without `sudo`, the default
port is set to localhost:8080.

If you want to host pages on your local machine to the public, you should
change that to localhost:80, and run `sudo nginx`. You’ll need to turn off
any other web servers running port 80, of course.

You can start nginx automatically on login running as your user with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/nginx/1.0.8/org.nginx.nginx.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.nginx.nginx.plist

Though note that if running as your user, the launch agent will fail if you
try to use a port below 1024 (such as http’s default of 80.)
Warning: /usr/local/sbin is not in your PATH
You can amend this by altering your ~/.bashrc file
==> Summary
/usr/local/Cellar/nginx/1.0.8: 6 files, 616K, built in 19 seconds
hematoMacBook-Pro:~ hechangmin$

別名を付ける
ln -s /usr/local/sbin/nginx /usr/bin/nginx

2.nginxのコマンド
nginx -V バージョンおよび配置ファイルを確認
nginx -v バージョンの確認
nginx -c filename 配置ファイルを指定
nginx -h ヘルプ
nginx -s [reloadreopenstopquit]

3.brewhomeのコマンド

brew search mysql
brew install mysql
brew info mysql
brew uninstall mysql

「Objective-C」ios開発でUICollectionViewを利用する方法のまとめ

利用方法
#pragma mark — UICollectionViewDataSource

//UICollectionViewCellの個数を表示
– (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 10;
}

//Sectionの個数表示の定義
-(NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
return 2;
}

//UICollectionViewのコンテンツを表示
– (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
BTCollectionCell *cell =[collectionView dequeueReusableCellWithReuseIdentifier:@”cell” forIndexPath:indexPath];

cell.imageView.image = [UIImage imageNamed:@”tupian”];
cell.titleLabel.text = [NSString stringWithFormat:@”第%d组,第%d个”,indexPath.section,indexPath.row];
cell.titleLabel.tag = 100+indexPath.row;

return cell;
}

#pragma mark –UICollectionViewDelegateFlowLayout

//UICollectionView の marginを定義
– (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
{
//ビュー全体の最上部
UIEdgeInsets top = {5,5,5,5};
return top;
}

//UICollectionViewのサイズを定義
– (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return CGSizeMake(140, 80);
}

#pragma mark –UICollectionViewDelegate

//UICollectionViewを選択した時呼び出すメソッド
– (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
BTCollectionCell *cell = (BTCollectionCell *)[collectionView cellForItemAtIndexPath:indexPath];

UILabel *label = (UILabel *)[cell viewWithTag:100+indexPath.row];
label.backgroundColor = RGBACOLOR(42, 183, 251, 1);
label.textColor = [UIColor whiteColor];

SRWare Iron 37.0.2000.0 Stable for MacOSのダウンロード

ダウンロード:
提供元サイトからダウンロード

Main improvements:
– 64-Bit Version
– PDF-Viewer (print preview now works correct)
– DirectWrite API
– Bug-/Securityfixes

OS X Mavericks 10.9.4 Update (Combo) のダウンロード

ダウンロード:
提供元サイトからダウンロード

OS X Mavericks 10.9.4 アップデートはすべての Mavericks ユーザに推奨され、お使いの Mac の安定性、互換性、およびセキュリティが改善される

1 / 812345...最後 »