Skip to content

Instantly share code, notes, and snippets.

Hazel Fidecaro hipsterjazzbo

Block or report user

Report or block hipsterjazzbo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
hipsterjazzbo / directives.graphql
Last active Aug 6, 2019
A list of all the directive definitions for version 3.7 of
View directives.graphql
directive @all(
Specify the class name of the model to use.
This is only needed when the default model resolution does not work.
model: String
Apply scopes to the underlying query.
hipsterjazzbo /
Last active Mar 18, 2019
Array intersect but good

PHP's array_intersect throws a fit if you only pass in one array cause it's a whiney baby. This one is good.

hipsterjazzbo /
Last active Apr 13, 2019
Solarized Colors as Bash Variables (ansi colors, xterm-256)
View gist:e033f437d81d25cb9265
// One means "Assign this value to this variable"
$number = 1; // This one is an integer (whole number)
$anotherNumber = "1"; // This one is a string
// Two means "Are these the same value?"
if ($number == $anotherNumber) {
// This will be true
View gist:e9e4ee4f8cab765c0638
$myStarSign = "Gemini";
if ($myStarSign == "Taurus") {
echo "Me too!";
} elseif ($mystarsign == "nah") {
echo "your dumb!";
} else {
echo "Too bad so sad...";
View gist:54e06d4ef79c61f2a19b
* Pass in a number and get it back as a string with an ordinal suffix (1 -> 1st, 2 -> 2nd etc)
function addSuffix($number)
if ($number == 1) {
return $number + 'st';
} elseif ($number == 2) {
View gist:b33d14ad9ff8970cd632
//TODO get URL from parameters and authenticate it with an expiring hash/timestamp
$url = '';
// Forward these headers from original request
$requestHeaders = [];
if (isset($_SERVER['HTTP_USER_AGENT'])) $requestHeaders[] = 'User-Agent: ' . $_SERVER['HTTP_USER_AGENT'];
if (isset($_SERVER['HTTP_RANGE'])) $requestHeaders[] = 'Range: ' . $_SERVER['HTTP_RANGE'];
# Fergus Staging Deploy Script
# Update git to staging
cd /var/www/fergus_internal_demo;
function bgtext {
echo -e $(tput setab 24)" $1"$(tput sgr0);
View Collection::group_by().php
public static function group_by(Array $objects, $group_by_property)
$grouped_objects = [];
foreach($objects as $object)
$property_value = $object->{$group_by_property};
View job_model.php
function new_recurring_instance($job_template_id)
$job_template = Job_template_model::find($job_template_id);
$new_job_instance = Job_model::create();
// Copy some fields from template
$new_job_instance->company_id = $job_template->company_id;
You can’t perform that action at this time.