Skip to content

Instantly share code, notes, and snippets.

View jondavidjohn's full-sized avatar

Jonathan D. Johnson jondavidjohn

View GitHub Profile
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $centralUrl );
curl_setopt( $ch, CURLOPT_FAILONERROR, 1 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_TIMEOUT, 3 );
curl_setopt( $ch, CURLOPT_POST, true );
curl_setopt( $ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC );
curl_setopt( $ch, CURLOPT_USERPWD, $authString );
SELECT entry_id, DATEDIFF(from_unixtime(field_id_162, '%Y-%m-%d'), from_unixtime(field_id_267, '%Y-%m-%d')) as days, CONVERT_TZ(from_unixtime(field_id_267, '%m/%d/%Y %h:%i %A'), 'GMT', 'CST') as start, from_unixtime(field_id_162, '%m/%d/%Y %h:%i %A') as end FROM exp_channel_data Where field_id_162 != '' AND field_id_729 != '' AND field_id_267 BETWEEN UNIX_TIMESTAMP('2015-01-01') AND UNIX_TIMESTAMP('2015-02-12')
@jondavidjohn
jondavidjohn / deploy.rb
Created March 8, 2012 18:00 — forked from ianmurrays/deploy.rb
Runs test locally before deploying on capistrano.
set :test_log, "logs/capistrano.test.log"
namespace :deploy do
before 'deploy:update_code' do
puts "--> Running tests, please wait ..."
unless system "bundle exec rake > #{test_log} 2>&1" #' > /dev/null'
puts "--> Tests failed. Run `cat #{test_log}` to see what went wrong."
exit
else
puts "--> Tests passed"