Skip to content

Instantly share code, notes, and snippets.

View nickgs's full-sized avatar
👋

Nick Selvaggio nickgs

👋
  • Sego Solutions, LI Blockchain
  • Long Island
  • X @direct
View GitHub Profile
@nickgs
nickgs / watchdog.sublime-snippet
Created May 7, 2015 03:28
Drupal Watchdog Sublime Snippet
<snippet>
<tabTrigger>dlog</tabTrigger>
<content><![CDATA[
watchdog('${TM_FILENAME/([^.]*)\..*$/$1/}', '${1}Mylog %data', array('%data' => ${2}), ${3}WATCHDOG_ERROR, ${4}null);
]]></content>
</snippet>
//let drush have some memory.
if (drupal_is_cli()) {
ini_set('memory_limit', '2048M');
}
@nickgs
nickgs / gist:7649863
Created November 25, 2013 22:13
Landed cost item allocation
//our landed costs
ocn = 1000
fsc = 75
//our material cost
material_cost = 1000
unit_landed = (ocn / material_cost) + (fsc / material_cost); //this summation would loop for each cost code.
//unit_landed will be $1.075 a unit in this example.