Skip to content

Instantly share code, notes, and snippets.


Jason McCallister jasonmccallister

View GitHub Profile
jasonmccallister / appfog-php-apache-information
Created Oct 14, 2013
PHP Info and Apache Environment information for AppFog.
View appfog-php-apache-information
# Apache Environment Variables
The following environment variables are available through phpinfo().
jasonmccallister / db.php
Created Oct 26, 2013
My Craft db.php configuration for
View db.php
* Database Configuration
* All of your system's database configuration settings go in here.
* You can see a list of the default settings in craft/app/etc/config/defaults/db.php
if ($_SERVER['HTTP_HOST'] == '') {
jasonmccallister / cheatsheet
Created Feb 3, 2014
Craft Plugin Developement - Forms Cheatsheet
View cheatsheet
#Craft Plugin Developement - Forms Cheatsheet
My quick reference for working with forms while developing plugins for Craft.
* id
* class
* name
* checked
jasonmccallister / clearfix.twig
Created Feb 26, 2014
Used in a Craft/Twig for loop to add a clear fix div after three entries.
View clearfix.twig
{% if loop.index is divisibleby(3) %}
<div class="clearfix"></div>
{% endif %}
#!/usr/bin/env bash
echo ">>> Starting Install Script"
# Update
sudo apt-get update
# Install MySQL without prompt
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password password root'
sudo debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password root'
jasonmccallister / QuickPostWidget.php
Created Mar 15, 2014
Modify getTitle in craft/app/widgets/QuickPostWidget.php to display the section title in lower case to match the widget title text.
View QuickPostWidget.php
public function getTitle()
if (craft()->hasPackage(CraftPackage::PublishPro))
$section = $this->_getSection();
if ($section)
return Craft::t('Post a new {section} entry', array('section' => strtolower($section->name)));
View etc_nginx_global_php-restrictions.conf
# Don't throw any errors for missing favicons and don't display them in the logs
location = /favicon.ico {
log_not_found off;
access_log off;
# Don't log missing robots or show them in the nginx logs
location = /robots.txt {
allow all;
log_not_found off;
jasonmccallister /
Last active Aug 29, 2015 — forked from fideloper/
My custom for vagrant. Forked from
#!/usr/bin/env bash
if [ $EUID -ne 0 ]; then
echo "You must be root: \"sudo ngxvhost\""
exit 1
# May need to run this as sudo!
# I have it in /usr/local/bin and run command 'ngxvhost' from anywhere, using sudo.
jasonmccallister / nginx.repo
Created Mar 23, 2014
CentOS Nginx Rep for vagrant
View nginx.repo
name=nginx repo
jasonmccallister /
Created May 4, 2014
Bash file to quickly install CentOS firewall rules
# flush all rules
iptables -F
# block null packets
iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
# block syn-flood attacks
iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
# block XMAS packets
You can’t perform that action at this time.