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
// sunny-demo/sunny-demo.php | |
<?php | |
/** | |
* Sunny Demo | |
* | |
* A demo to show how to write a plugin interacting with CloudFlare | |
* Client API base on WordPress Plugin Boilerplate. | |
* | |
* @package Sunny_Demo |
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 | |
// sunny-demo/admin/class-sunny-demo-admin.php | |
class Sunny_Demo_Admin { | |
// Some code is skipped!!!!!!! | |
/** | |
* Initialize the plugin by loading admin scripts & styles and adding a | |
* settings page and menu. |
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
# Install dependencies | |
# | |
# * checkinstall: package the .deb | |
# * libpcre3, libpcre3-dev: required for HTTP rewrite module | |
# * zlib1g zlib1g-dbg zlib1g-dev: required for HTTP gzip module | |
apt-get install checkinstall libpcre3 libpcre3-dev zlib1g zlib1g-dbg zlib1g-dev && \ | |
mkdir -p ~/sources/ && \ | |
# Compile against OpenSSL to enable NPN |
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
$ adduser deployer | |
$ gpasswd -a deployer sudo | |
$ gpasswd -a deployer www-data | |
$ sudo usermod -g www-data deployer |
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
$ curl --data "author=YourName&email=you@your-domain.com&url=http://www.your-domain.com&comment=Testing-Zero-Spam&comment_post_ID=123456789" http://your-domain.com/wp-comments-post.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
<?php | |
// Skipping lots of array elements above..... | |
$settings['your_tab_slug']['user_email'] = array( | |
'name' => __( 'Your Email', $this->plugin_name ), | |
'type' => 'email' | |
); | |
$settings['your_tab_slug']['user_plan'] = array( | |
'name' => __( 'Select a plan', $this->plugin_name ), |
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 cat your_domain.crt COMODORSADomainValidationSecureServerCA.crt COMODORSAAddTrustCA.crt AddTrustExternalCARoot.crt > ssl-bundle.crt | |
$ sudo chmod 600 /etc/nginx/ssl |
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
add_action( 'phpmailer_init', 'wph_phpmailer_init' ); | |
function wph_phpmailer_init( PHPMailer $phpmailer ) { | |
$phpmailer->IsSMTP(); | |
$phpmailer->SMTPAuth = true; // enable SMTP authentication | |
$phpmailer->Port = 587; // set the SMTP server port | |
$phpmailer->Host = 'smtp.mandrillapp.com'; // SMTP server | |
$phpmailer->Username = 'MANDRILL_USERNAME'; // SMTP server username | |
$phpmailer->Password = 'MANDRILL_API_KEY'; // SMTP server password | |
} |
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
gem 'turbolinks' | |
gem 'jquery-turbolinks', '~> 2.1.0' | |
# Pages Theme - Gems for twitter LESS -> CSS and JS support | |
gem 'therubyracer', '~> 0.12.2', platforms: :ruby | |
gem 'yui-compressor', '~> 0.12.0' | |
gem 'less-rails', '~> 2.6.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
require 'json' | |
require 'net/http' | |
def fetch(url) | |
resp = Net::HTTP.get_response(URI.parse(url)) | |
data = resp.body | |
JSON.parse(data) | |
end | |
results = fetch "https://cdn.rawgit.com/github/gemoji/master/db/emoji.json" |
OlderNewer