Skip to content

Instantly share code, notes, and snippets.

View birnam's full-sized avatar

David Woods birnam

View GitHub Profile
@birnam
birnam / start.php
Created April 12, 2014 20:22
local env not correct
$env = $app->detectEnvironment(function () use ($app) {
// Possible Environments:
// - local
// - test
// - stage
// - production (default)
var_dump(gethostname());
preg_match("/karefirst\\/([a-z]+)/usm", __FILE__, $match);
@birnam
birnam / migrate up pfsh cigarette use
Created April 9, 2014 17:52
is this how to update a field in a migration that references other fields?
public function up()
{
$patientEvals = PatientEvaluation::all();
foreach ($patientEvals as $eval) {
$eval->pfsh['social_history']['tobacco_use'] =
$eval->pfsh['social_history']['cigarette_use'] + ' - ' +
$eval->pfsh['social_history']['tobacco_use'];
$eval->save();
@birnam
birnam / settimeout mobile test
Created July 22, 2013 15:25
settimeout mobile test
setTimeout(function() {
if (screen.width <= 699) {
document.location = "http://m.visitstatesboroga.com/";
}
}, 200);
@birnam
birnam / state savings
Created June 25, 2013 19:51
sample object access
var savings = {
"AR": 3.5,
"AK": 0.4,
"AL": 8.2
};
function getSavings(state) {
return savings[state];
}