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
View gist:4653971
<?
function print_if($string, $condition = null)
{
if (is_null($condition))
{
if (is_null($string) || empty($string))
{
return '';
}
View packing_slip_model.php
/**
* Determines the reconciliation status of the packing slip
*
* @return string $status The status of the packing slip. One of 'reconciled', 'partial', or 'unreconciled'
*/
function status()
{
// Get just the unreconciled item's first, because if it this is 0 we don't need to reconciled ones
$unreconciled_items = Actual_item_model::where(['packing_slip_id' => $this->id, 'merchant_invoice_line_item_id' => 0])->find();
View job_model.php
<?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;
@hipsterjazzbo
hipsterjazzbo / README.md
Last active Mar 18, 2019
Array intersect but good
View README.md

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
hipsterjazzbo / solarized-colors.sh
Last active Apr 13, 2019
Solarized Colors as Bash Variables (ansi colors, xterm-256)
View solarized-colors.sh
#!/bin/bash
BASE03="\[\033[38;5;234m\]"
BASE02="\[\033[38;5;235m\]"
BASE01="\[\033[38;5;240m\]"
BASE00="\[\033[38;5;241m\]"
BASE0="\[\033[38;5;244m\]"
BASE1="\[\033[38;5;245m\]"
BASE2="\[\033[38;5;254m\]"
BASE3="\[\033[38;5;230m\]"
@hipsterjazzbo
hipsterjazzbo / directives.graphql
Last active Aug 6, 2019
A list of all the directive definitions for version 3.7 of https://github.com/nuwave/lighthouse
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.
"""
You can’t perform that action at this time.