Skip to content

Instantly share code, notes, and snippets.

@thodeveloper
thodeveloper / AppModel.php
Created February 18, 2016 07:32 — forked from ReedD/AppModel.php
A CakePHP model function to find and sort by the distance from a given a latitude and longitude coordinate with the option to restrict to a given radius.
<?php
App::uses('Model', 'Model');
App::uses('String', 'Utility');
class AppModel extends Model {
/**
* @author Reed Dadoune
* distanceQuery
@thodeveloper
thodeveloper / nginx.conf
Created November 17, 2015 03:12 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
—– BEGIN LICENSE —–
K-20
Single User License
EA7E-940129
3A099EC1C0B5C7C5 33EBF0CF BE82FE3B

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
:: UPDATE YUM ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum update -y
:: INSTALL WEBSERVER :::::::::::::::::::::::::::::::::::::::::::::::::::::::::
sudo yum install httpd24
sudo service httpd start
sudo chkconfig httpd on
chkconfig --list httpd