Nginx brew install nginx PHP brew install php71 brew install homebrew/php/php71-pcntl brew install homebrew/php/php71-xdebug MySQL brew install mysql
PHP Composer
https://getcomposer.org/ Installation curl -sS https://getcomposer.org/installer | php mv composer.phar /usr/local/bin/composer Use Chinese Packagist composer config -g repo.packagist composer https://packagist.phpcomposer.com
TMux
Installation brew install tmux Short cut https://www.cnblogs.com/kaiye/p/6275207.html Key C-b Send the prefix key (C-b) through to the application. C-o Rotate the panes in the current window forwards. C-z Suspend the tmux client. ! Break the current pane out of the window. \” Split the current pane into two, top and bottom. \# List all paste…
doctrine createQueryBuilder count and not exists
$qb = $this->o->createQueryBuilder(‘o’); $sub = $this->em->createQueryBuilder(); $sub->select(“o.id”); //notice this : cause e.offer is foreign key of o.id $sub->from(ExcludedByOffer::class, “e”); $sub->andWhere(‘e.offer = o.id’) ->andWhere(‘e.aff = :aff’); $qb->select(‘count(o.id)’) ->where(‘o.adv=:adv’) ->andWhere($qb->expr()->not($qb->expr()->exists($sub->getDQL()))) ->setParameters([‘adv’ => $adv, ‘aff’ => $aff ]); return $qb->getQuery()->getSingleScalarResult(); 参考 https://stackoverflow.com/questions/31536137/doctrine-not-exists-subquery/31536545 https://stackoverflow.com/questions/9214471/count-rows-in-doctrine-querybuilder
Mac os 上用C++进行MYSQL开发配置
下载boost: https://sourceforge.net/projects/boost/?source=typ_redirect 安装boost: 解压安装 ./bootstrap.sh ./b2 ./b2 install 在github下载安装mysql-connector-cpp: git clone https://github.com/mysql/mysql-connector-cpp cd mysql-connector-cpp/ cmake . make clean make make install 在xcode中进行项目配置 3.项目配置 3.1 Header Search Paths加 /usr/local/include /usr/local/mysql/include 3.2 Library Search Paths加 /usr/local/lib /usr/local/mysql/lib 3.1 Other Linker Flags加 -lmysqlcppconn -lm -lmysqlclient -lz 参考: http://dev.mysql.com/doc/connector-cpp/en/connector-cpp-installation-source-distribution.html http://blog.csdn.net/abcjennifer/article/details/16983929 http://www.cnblogs.com/lchb/articles/3510082.html
Xcode + yaml-cpp 开发配置
下载安装: yams-cpp release 0.5.3, 支持 yaml 1.2标准, 比老版本语法更优雅 https://github.com/jbeder/yaml-cpp 解压至yaml-cpp-release-0.5.3 复制代码 cd yaml-cpp-release-0.5.3 mkdir build cd build cmake .. make make install 复制代码 确认include文件安装到/usr/local/include中,文件夹为 yaml-cpp 创建测试文件: main.cpp内容如下 复制代码 #include #include #include <yaml-cpp/yaml.h> #include int main(int argc, const char * argv[]) { // insert code here… YAML::Node config = YAML::LoadFile(“config.yaml”); const std::string username = config[“username”].as(); const…
MACOS 免费软件下载
常用工具: Homebrew: http://brew.sh/ Homebrew brew-cask: https://github.com/caskroom/homebrew-cask Firefox: http://www.firefox.com.cn/ Evernote: https://www.yinxiang.com/download/ QQ: http://im.qq.com/download/ QQ输入法: http://pc.qq.com/mac.html 微信:https://search.itunes.apple.com/WebObjects/MZContentLink.woa/wa/link?mt=11&path=mac%2fWeChat 企业微信:http://work.weixin.qq.com/#indexDownload 开发工具: JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html PHPStorm: https://www.jetbrains.com/phpstorm/ sequelpro: http://www.sequelpro.com/download composer: sourcetree: https://www.sourcetreeapp.com/download/ homebrew安装软件 brew top phinze/homebrew-cask brew install brew-cask brew cask install google-chrome brew install wget brew install mysql brew install nginx brew install homebrew/php/php56 brew install homebrew/php/php56-intl brew install phpunit
批量转换目录下所有文件到UTF8
#!/bin/sh for i in * do iconv -f GBK -t UTF-8 $i >tmp cp tmp $i done rm tmp
jQuery如何获取动态添加的元素
在一个页面中, 动态添加一些inpu 后, 通过一般的原有方法$(‘.month-calculate’) 无法取到元素, 但是在Firebug的控制台中是可以取到的.. 1 如: $(‘.month-calculate’).change(function(){ console.info(‘yes’); }); 和 $(‘.month-calculate’).bind(‘change’,function () { console.info(‘yes’); }); 都不起作用. 而 $(‘.xxx’).live方法在 jQuery 1.9后被取消. 只能用以下方法了: 1 2 3 $(‘.tableBlock’).on(‘change’,’.month-calculate’,function () { console.info(‘yes’); }); 注意: .tableBlock 是 .month-calculate的父元素.