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 | |
$string = "<iframe width=\"1280\" height=\"720\" src=\"http://www.youtube.com/embed/UoVCqOlWMZg?rel=0&hd=1\" frameborder=\"0\" allowfullscreen></iframe>"; | |
preg_match_all( '~ | |
# Match non-linked youtube URL in the wild. (Rev:20110825) | |
https?:// # Required scheme. Either http or https. | |
(?:www\.)? # Optional www subdomain. | |
(?: # Group host alternatives. | |
youtu\.be/ # Either youtu.be, | |
| youtube\.com # or youtube.com followed by | |
\S* # Allow anything up to VIDEO_ID, |
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: | |
Plugin URI: | |
Version: | |
Description: | |
Author: | |
Author URI: | |
Text Domain: | |
Domain Path: |
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
$.fn.serializeObject = function() { | |
var _POST = [], | |
obj = {}, | |
nameList = this.serializeArray(), | |
build = function ( hierarchy, value ) { | |
var __t = {}, name = hierarchy.shift(); | |
if( typeof hierarchy[0] != 'undefined' ) { | |
__t[name] = build( hierarchy, value ); | |
} else { | |
__t[name] = value; |
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 update | |
sudo apt-get install htop binutils cpp flex gcc libarchive-zip-perl libc6-dev libcompress-zlib-perl m4 libpcre3 libpcre3-dev libssl-dev libpopt-dev lynx make perl perl-modules openssl unzip zip autoconf2.13 gnu-standards automake libtool bison build-essential zlib1g-dev ntp ntpdate autotools-dev g++ bc subversion psmisc libmysqlclient-dev libcurl4-openssl-dev libjpeg62-dev libpng3-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libxslt1-dev libbz2-dev libxml2-dev libevent-dev libltdl-dev libmagickwand-dev imagemagick build-essential autoconf2.13 libbz2-dev libevent-dev libxml2-dev libcurl4-openssl-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libt1-dev libmcrypt-dev libmysqlclient-dev libxslt-dev | |
sudo mkdir /tmp/nginx && cd /tmp/nginx | |
sudo wget http://nsudp ginx.org/download/nginx-1.0.12.tar.gz | |
sudo tar -zxf nginx-1.0.12.tar.gz | |
sudo cd nginx-1.0.12 | |
#Check http://nginx.org/en/docs/install.html for more information | |
./configure --sbin-path=/usr/local/nginx/nginx --conf-path= |
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 | |
function array_map_recursive( $callback, $mixed ) { | |
if( is_array( $mixed ) || is_object( $mixed ) ) { | |
$return = is_array( $mixed ) ? array() : new stdClass; | |
foreach ($mixed as $key => $value){ | |
if( is_array( $mixed ) ) | |
$return[call_user_func( $callback, $key )] = array_map_recursive( $callback, $value ); | |
else | |
$return->{call_user_func( $callback, $key )} = array_map_recursive( $callback, $value ); | |
} |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: php-fpm | |
# Required-Start: $remote_fs $network | |
# Required-Stop: $remote_fs $network | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts php-fpm | |
# Description: starts the PHP FastCGI Process Manager daemon |
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
;;;;;;;;;;;;;;;;;;;;; | |
; FPM Configuration ; | |
;;;;;;;;;;;;;;;;;;;;; | |
; All relative paths in this configuration file are relative to PHP's install | |
; prefix (/server/php). This prefix can be dynamicaly changed by using the | |
; '-p' argument from the command line. | |
; Include one or more files. If glob(3) exists, it is used to include a bunch of | |
; files from a glob(3) pattern. This directive can be used everywhere in the |
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
;;;;;;;;;;;;;;;;;;; | |
; About php.ini ; | |
;;;;;;;;;;;;;;;;;;; | |
; PHP's initialization file, generally called php.ini, is responsible for | |
; configuring many of the aspects of PHP's behavior. | |
; PHP attempts to find and load this configuration from a number of locations. | |
; The following is a summary of its search order: | |
; 1. SAPI module specific location. | |
; 2. The PHPRC environment variable. (As of PHP 5.2.0) |
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
.SILENT: | |
workplace := $(CURDIR) | |
clean: | |
rm -rf server tmp | |
setup: | |
echo "Setting up NGINX" | |
mkdir -p tmp server conf sites |
OlderNewer