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
/** | |
* US STATE RELATED FUNCTIONS | |
**/ | |
/** | |
* Return an array af state names and abbreviations | |
* | |
* @return (array) state names and abbreviations | |
**/ |
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 'rubygems' | |
require 'bundler/setup' | |
require 'open-uri' | |
require 'httparty' | |
class Foo | |
def self.do_it |
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
function generateCsv($data, $delimiter = ',', $enclosure = '"') { | |
$handle = fopen('php://temp', 'r+'); | |
foreach ($data as $line) { | |
fputcsv($handle, $line, $delimiter, $enclosure); | |
} | |
rewind($handle); | |
while (!feof($handle)) { | |
$contents .= fread($handle, 8192); | |
} | |
fclose($handle); |
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
# 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/ |
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
public function DownloadDocx() | |
{ | |
$this->_extension = "docx"; | |
$args = func_get_args(); | |
$newName = trim($args[0]); | |
ob_flush(); | |
if (!empty($newName)) { | |
$fileName =$_SERVER['DOCUMENT_ROOT'] . '/wills/docs/' .$newName; | |
} else { | |
throw new Exception("Invalid document 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
<button class="download-pdf" onclick="document.location.href='doc.pdf';_gaq.push(['_trackEvent', 'PDFs', 'Download', 'Doc Name']);"> Doc Name </button> |
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
#==================# | |
# General WP stuff # | |
#==================# | |
.htaccess | |
wp-content/uploads/ | |
wp-admin/ | |
wp-includes/ | |
wp-content/plugins/ | |
wp-content/blogs.dir/ |
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
## OS and Utility Stuff ## | |
#==================# | |
# OS Files # | |
#==================# | |
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 |
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
cat non_search_logs.json | python -m json.tool > formatted.json |
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
Find common problems in wordpress hacks | |
Finds eval or base64 decode | |
grep -ri "eval" [path] | |
grep -ri "base64_decode" [path] | |
Recently modified files | |
find -type f -ctime -0 | more |
OlderNewer