This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// NSArray-Blocks.h | |
// Handy codebits | |
// | |
// If you want to keep block definitions terse, simple and dynamic, have no | |
// problems with the incompatible block pointer types and you don't mind | |
// compiler warnings about sending a message without matching signature, | |
// DO NOT IMPORT THIS FILE, seriously. | |
// | |
// Created by Sijawusz Pur Rahnama on 15/11/09. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- MySQL 创建超级用户 创建用户,并有localhost下所有数据库的超级权限 | |
mysql> grant all on *.* to monster@localhost identified by "123456"; | |
mysql> flush privileges; | |
- 删除用户 | |
mysql> use mysql; | |
mysql> delete from user where user = 'monster'; | |
- 创建 Repl 的用户 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Vim 配置文件 for Bash | |
filetype indent on | |
syntax on | |
set paste | |
set sw=2 | |
set ts=2 | |
set history=100 | |
set iskeyword+=_,$,@,%,#,- | |
set backspace=2 | |
set autoindent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# CentOS install php from souces | |
sudo yum install gcc-c++ httpd httpd-devel apr-devel libxml2-devel zlib zlib-devel mysql-devel openssl-devel | |
wget http://cn2.php.net/get/php-5.3.1.tar.gz/from/cn.php.net/mirror | |
tar -zxf php-5.3.1.tar.gz | |
cd php-5.3.1 | |
./configure --with-configure-file-path=/etc --with-config-file-scan-dir=/etc/php.d --with-mysql --with-mysqli --with-zlib --enable-so --with-apxs2 | |
sudo make && sudo make install | |
sudo cp php.ini-production /etc/php.ini | |
sudo vim /etc/php.ini | |
# 找到 include_path 设置为: include_path = "/usr/local/lib/php/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-file-aio |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'thread' | |
class ThreadPool | |
class Worker | |
def initialize | |
@mutex = Mutex.new | |
@thread = Thread.new do | |
while true | |
sleep 0.001 | |
block = get_block |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install libjpeg8-dev libmysqlclient-dev | |
curl -O http://www.php.net/get/php-5.3.5.tar.gz/from/a/mirror | |
curl -O http://mirror.bjtu.edu.cn/apache//httpd/httpd-2.2.17.tar.gz | |
tar zxf httpd-2.2.17.tar.gz | |
cd httpd-2.2.17 | |
./configure --prefix=/etc/apache2 --enable-so --enable-cgi --enable-info --enable-rewrite \ | |
--enable-speling --enable-usertrack --enable-deflate --enable-ssl --enable-mime-magic \ | |
--enable-dav --enable-vhost-alias --enable-proxy --enable-expires --enable-headers | |
make && sudo make install | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo adduser --system --no-create-home --disabled-login --disabled-password --group juggernaut | |
$ sudo mv ~/juggernaut2-for-init.d-startup.sh /etc/init.d/juggernaut | |
$ sudo chmod +x /etc/init.d/juggernaut | |
$ sudo update-rc.d -f juggernaut defaults |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(float)compareString:(NSString *)originalString withString:(NSString *)comparisonString | |
{ | |
// Normalize strings | |
[originalString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; | |
[comparisonString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; | |
originalString = [originalString lowercaseString]; | |
comparisonString = [comparisonString lowercaseString]; | |
// Step 1 (Steps follow description at http://www.merriampark.com/ld.htm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# This is a Rails init template with MongoDB projects | |
# | |
# Mongoid, Devise, Bootstrap, jQuery, Redis, Cells, will_paginate, Carrierwave, simple_form, Settingslogic, Thin | |
# | |
# Usage | |
# | |
# $ rails new app_name -m https://raw.github.com/gist/2168014 | |
# |
OlderNewer