Skip to content

Instantly share code, notes, and snippets.

View benhuang1024's full-sized avatar
:octocat:
Student from all

Ben benhuang1024

:octocat:
Student from all
  • ShangHai China
View GitHub Profile
@benhuang1024
benhuang1024 / .gitattributes
Last active May 5, 2019 04:34
更改项目语言
*.css linguist-language=php
*.less linguist-language=php
*.sass linguist-language=php
*.js linguist-language=php
*.html linguist-language=php
@benhuang1024
benhuang1024 / varTurn
Last active January 19, 2019 14:45
字符串蛇形驼峰互转
<?php
function camelize($uncamelized_words,$separator='_')
{
$uncamelized_words = $separator. str_replace($separator, " ", strtolower($uncamelized_words));
return ltrim(str_replace(" ", "", ucwords($uncamelized_words)), $separator );
}
function uncamelize($camelCaps,$separator='_')
{
return strtolower(preg_replace('/([a-z])([A-Z])/', "$1" . $separator . "$2", $camelCaps));
}
@benhuang1024
benhuang1024 / php.js
Last active January 19, 2019 14:18
locutus php.js 声明引入
var array = require('locutus/php/array');
var bc = require('locutus/php/bc');
var ctype = require('locutus/php/ctype');
var datetime = require('locutus/php/datetime');
var exec = require('locutus/php/exec');
var filesystem = require('locutus/php/filesystem');
var funchand = require('locutus/php/funchand');
var i18n = require('locutus/php/i18n');
var info = require('locutus/php/info');
var json = require('locutus/php/json');
@benhuang1024
benhuang1024 / .gitignore
Last active May 23, 2019 09:17
laravel git 过滤配置
# Originate benhuang1024/.gitignore
# other
vendor/
.vagrant
# IDE
.idea/
.vscode
nbproject/private/
_ide_helper.php
@benhuang1024
benhuang1024 / vagrant-homestead-php7-redis.sh
Created July 25, 2018 11:16 — forked from aNd1coder/vagrant-homestead-php7-redis.sh
Installing PHP REDIS PHP7 Branch On Fresh Install Homestead PHP7 Branch
vagrant@homestead:~$ sudo apt-get update
vagrant@homestead:~$ git clone -b php7 https://github.com/phpredis/phpredis.git
vagrant@homestead:~$ sudo mv phpredis/ /etc/
vagrant@homestead:~$ cd /etc/phpredis
vagrant@homestead:/etc/phpredis$ phpize
vagrant@homestead:/etc/phpredis$ ./configure
vagrant@homestead:/etc/phpredis$ make && make install
# Note This is an Extension You Need to Enable to Make it Work in Php 7
# This First Command Will Allow You To Call PHPREDIS Facade in Browser