A curated list of amazingly awesome PHP libraries, resources and shiny things.
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
<?php namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Http\Response; | |
class BasicWebAuth | |
{ | |
/** | |
* Name of the realm | |
* |
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
// --------------------------------------------------------------------------------- | |
// libs | |
var gulp = require('gulp'), | |
// tools | |
sass = require('gulp-sass'), | |
uglify = require('gulp-uglify'), | |
sourcemaps = require('gulp-sourcemaps'), | |
livereload = require('gulp-livereload'), |
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
Based on http://www.alphadevx.com/a/455-Installing-Supervisor-and-Superlance-on-CentOS | |
Vgrnt box used: https://github.com/tommy-muehle/puppet-vagrant-boxes/releases/download/1.0.0/centos-6.6-x86_64.box | |
sudo yum install python-setuptools | |
sudo easy_install supervisor | |
supervisord --version | |
echo_supervisord_conf | sudo tee /etc/supervisord.conf | |
sudo mkdir -p /etc/supervisord/conf.d/ | |
sudo vi /etc/init.d/supervisord |
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
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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
getPage = (url) -> | |
$.get url | |
.done (response, success, xhr) -> | |
results = $ JSON.parse(response).html | |
for result in results.find ".card--gridFlex" | |
d1 = $ result | |
profile_id = d1.find(".jsCard").attr "id" | |
continue if !profile_id | |
profile_id = profile_id.replace "profile_", "" | |
data = |
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
/** | |
* Suppress errors generated by specified WordPress plugins. | |
* | |
* Put this in /wp-content/mu-plugins/ | |
* | |
* @param string $errno The error number. | |
* @param string $errstr The error message. | |
* @param string $errfile Path to the file that caused the error. | |
* @param int $errline Line number of the error. | |
* @return bool True to suppress error reporting; false to use default error handler. |
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
<?php | |
/* | |
Plugin Name: TH Shipping Options | |
Plugin URI: NA | |
Description: TH Shipping Options plugin | |
Version: 1.0.0 | |
Author: Vj | |
Author URI: www.wooforce.com | |
*/ |
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
# FROM: http://forum.parallels.com/showthread.php?290399-Plesk-11-5-Easy-Install-Script-for-Multiple-PHP-CentOS-6-4-x64 | |
yum -y install gcc make gcc-c++ cpp kernel-headers.x86_64 libxml2-devel openssl-devel bzip2-devel libjpeg-devel libpng-devel freetype-devel openldap-devel postgresql-devel aspell-devel net-snmp-devel libxslt-devel libc-client-devel libicu-devel gmp-devel curl-devel libmcrypt-devel unixODBC-devel pcre-devel sqlite-devel db4-devel enchant-devel libXpm-devel mysql-devel readline-devel libedit-devel recode-devel libtidy-devel | |
phpconfigureflagscommon="--with-libdir=lib64 --cache-file=./config.cache --prefix=/usr/local/php-\$phpversion-\$phptype --with-config-file-path=/usr/local/php-\$phpversion-\$phptype/etc --disable-debug --with-pic --disable-rpath --with-bz2 --with-curl --with-freetype-dir=/usr/local/php-\$phpversion-\$phptype --with-png-dir=/usr/local/php-\$phpversion-\$phptype --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/usr/local/php-\$ph |
Use $this to refer to the current object. Use self to refer to the current class. In other words, use $this->member for non-static members, use self::$member for static members.
Source: When to use self vs this -stackoverflow