Skip to content

Instantly share code, notes, and snippets.

View johncongdon's full-sized avatar

John Congdon johncongdon

View GitHub Profile

Keybase proof

I hereby claim:

  • I am johncongdon on github.
  • I am johncongdon (https://keybase.io/johncongdon) on keybase.
  • I have a public key whose fingerprint is DFA0 91D5 A19F 1C10 4D4D 067C AD91 5449 071F 6AF3

To claim this, I am signing this object:

# Create Composer file and add MeetUp API PAckage
composer init --require="dms/meetup-api-client:~1.0"
# Install packages
composer install
@johncongdon
johncongdon / 0_reuse_code.js
Created February 28, 2014 22:22
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@johncongdon
johncongdon / gist:1986540
Created March 6, 2012 14:24
Does this caching scheme make sense?
/* Purpose: To have a Dependency Injected cache (we can change caching source easily)
* Question: Does throwing if not in cache make sense? This allows me to store FALSE as a value.
*/
class blah {
public function removeCachedKey($key) { }
public function putIntoCache($key, $value, $expirationTime = 3600)
{
$cache = self::$cache;
if ($cache && method_exists($cache, 'set')) {
@johncongdon
johncongdon / set_page_in_mysql.php
Created March 2, 2012 14:53
Storing data for general log
<?php
/*
* Set the current page name in a mysql variable
*
* This will be useful when the general_log is turned on and
* you want to drill down to a find out where these queries are running.
*/
$page = mysql_real_escape_string($_SERVER['REQUEST_URI']);
mysql_query("SET @page='$page'");
@johncongdon
johncongdon / ShowRequiredFields.php
Created February 23, 2012 21:25
Valid Required Fields
<?php
/**
* Changed based on feedback from rdohms
*/
$requiredFields = array(
'price',
'name',
'description',
'type',
'shippingCost',