This file contains hidden or 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
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install composer | |
brew install homebrew/php/composer | |
### PHPCS | |
composer global require "squizlabs/php_codesniffer=*" | |
# Add to your .bash_profile |
This file contains hidden or 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
<?php | |
// refer: http://hustnaive.github.io/php/2015/08/21/php-detect-encoding.html | |
/** | |
* 检测字符串编码(注意:存在误判的可能性,降低误判的几率的唯一方式是给出尽可能多的样本$line) | |
* 检测原理:对给定的字符串的每一个字节进行判断,如果误差与gb18030在指定误差内,则判定为gb18030;与utf-8在指定误差范围内,则判定为utf-8;否则判定为utf-16 | |
* @param string $line | |
* @return string 中文字符集,返回gb18030(兼容gbk,gb2312,ascii);西文字符集,返回utf-8(兼容ascii);其他,返回utf-16(双字节unicode) | |
* @author fangl |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit backupGlobals="false" | |
backupStaticAttributes="false" | |
bootstrap="tests/bootstrap.php" | |
colors="true" | |
convertErrorsToExceptions="true" | |
convertNoticesToExceptions="true" | |
convertWarningsToExceptions="true" | |
processIsolation="false" | |
stopOnFailure="false" |
This file contains hidden or 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
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
# core | |
brew install coreutils | |
# key commands | |
brew install binutils | |
brew install diffutils | |
brew install ed --default-names | |
brew install findutils --with-default-names |
This file contains hidden or 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
#!/bin/sh | |
cd ~ | |
sudo yum install -y epel-release | |
sudo yum install -y man | |
sudo echo '[nginx] | |
name=nginx repo |
This file contains hidden or 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
const http = require('http'); | |
const pack = require('./pack.js'); | |
const crypto = require('crypto'); | |
const querystring = require('querystring'); | |
// 私有方法 | |
const neteaseAESECB = Symbol('neteaseAESECB'); | |
const getHttpOption = Symbol('getHttpOption'); | |
const makeRequest = Symbol('makeRequest'); | |
const onResponse = Symbol('onResponse'); |
This file contains hidden or 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
module.exports = function pack (format) { | |
// discuss at: http://locutus.io/php/pack/ | |
// original by: Tim de Koning (http://www.kingsquare.nl) | |
// parts by: Jonas Raoni Soares Silva (http://www.jsfromhell.com) | |
// bugfixed by: Tim de Koning (http://www.kingsquare.nl) | |
// note 1: Float encoding by: Jonas Raoni Soares Silva | |
// note 1: Home: http://www.kingsquare.nl/blog/12-12-2009/13507444 | |
// note 1: Feedback: [email protected] | |
// note 1: "machine dependent byte order and size" aren't | |
// note 1: applicable for JavaScript; pack works as on a 32bit, |
This file contains hidden or 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
#!/bin/sh | |
standard="OSR0" | |
phpcsVersion="2.9.1" | |
function phpcsEvnCheck() | |
{ | |
# check phpcs exist | |
which phpcs > /dev/null 2>&1 |
This file contains hidden or 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
#!/bin/bash | |
# | |
# Example of how to parse short/long options with 'getopt' | |
# | |
OPTS=`getopt -o vhns: --long verbose,dry-run,help,stack-size: -n 'parse-options' -- "$@"` | |
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi | |
echo "$OPTS" |
This file contains hidden or 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
apply plugin: 'java' | |
apply plugin: 'application' | |
sourceCompatibility = 1.8 | |
version = '1.0' | |
mainClassName='com.hello.Application' | |
jar { | |
manifest { |