Skip to content

Instantly share code, notes, and snippets.

View gmartellino's full-sized avatar

Gary Martellino gmartellino

  • Los Angeles, CA
View GitHub Profile
@gmartellino
gmartellino / wordpress-sync-staging.sh
Created February 1, 2013 16:13
Sync a WordPress staging site with production content (assuming they're on the same server)
#!/bin/sh
###########################################################
# SYNC UP A STAGED WORDPRESS SITE WITH PRODUCTION CONTENT
# Author: Gary Martellino
# Company: Toi (http://toi.io)
#
# script assumes only the theme is versioned or unique, there are
# two separate wordpress installs running: 1 in production, 1 for staging.
@gmartellino
gmartellino / beautiful_strings.php
Created February 1, 2013 08:29
Facebook Hacker Cup 2013 - Beautiful Strings Solution (PHP)
<?php
// Beautiful Strings: Facebook Hacker Cup 2013 - Problem 1
// Author: Gary Martellino < [email protected] >
function beautify_string($string){
$score = 0;
$string = strtolower($string);
$counts = array();
//count occurences of string values if between a-z