Skip to content

Instantly share code, notes, and snippets.

View cgutierrez's full-sized avatar

Chris Gutierrez cgutierrez

View GitHub Profile
<html><head><script async="" src="https://ssl.google-analytics.com/ga.js"></script><script>var _gaq = _gaq || [];_gaq.push(['sp._setAccount', 'UA-18767921-3']);_gaq.push(['sp._setCustomVar', 1, 'i', 'johnnys.pizza.12']);_gaq.push(['sp._setCustomVar', 2, 'n', '66487']);_gaq.push(['sp._setCustomVar', 3, 'r', 'DirectBusinessIntegration']);_gaq.push(['sp._setCustomVar', 4, 'uses-iframe', 'yes']);_gaq.push(['sp._setCustomVar', 5, 'primary-font', '']);_gaq.push(['sp._trackPageview', 'web-menu-menusapi']);</script><script src="https://menus.singleplatform.co/static/js/lib/wedge/wedge-0.0.0.min.js"></script><script type="text/javascript" src="https://menus.singleplatform.co/storefront/xsl/menu2.xsl.js?callback=businessView.transformCallResponseHandler&amp;menuIntegrate=false"></script><link rel="stylesheet" type="text/css" href="https://fonts.googleapis.com/css?family=Roboto:400,400italic,700,700italic,500"><link rel="stylesheet" type="text/css" href="https://menus.singleplatform.co/static/css/font/Roboto/GoogleRobot
{"v":"5.6.10","fr":50,"ip":0,"op":700,"w":1200,"h":1000,"nm":"Venn-Diagram","ddd":0,"assets":[{"id":"comp_0","layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Arrowhead","parent":2,"sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":406,"s":[0]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":420,"s":[100]},{"i":{"x":[0.833],"y":[0.833]},"o":{"x":[0.167],"y":[0.167]},"t":489,"s":[100]},{"t":499,"s":[0]}],"ix":11},"r":{"a":0,"k":90,"ix":10},"p":{"a":0,"k":[31,43.663,0],"ix":2},"a":{"a":0,"k":[-1072.141,-1688.583,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":406,"s":[100,100,100]},{"i":{"x":[0.833,0.833,0.833],"y":[0.833,0.833,0.833]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,0.167]},"t":420,"s":[100,100,100]},{"t":499,"s":[100,100,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,
@cgutierrez
cgutierrez / git-yesterday.sh
Created August 25, 2016 15:14
Create a commit log of all the repositories in a directory
#!/usr/bin/env sh
PROJECTS_DIR=$HOME/Desktop/Werk/mode
LOG_FILE=$PROJECTS_DIR/commits.txt
AUTHOR='Chris Gutierrez'
# store the current dir
CUR_DIR=$(pwd)
#hey user
@cgutierrez
cgutierrez / .bash_profile.local
Last active November 13, 2015 16:02
Preserve current working directory for sshing in to a vagrant instance
function vagrant_working_dir {
current_dir=`pwd`
echo ${current_dir/$HOME\/Desktop\/Werk/\/vagrant}
}
alias vssh='LOCAL_WORKING_DIR=`vagrant_working_dir` vagrant ssh -- -oSendEnv=LOCAL_WORKING_DIR'
@cgutierrez
cgutierrez / SassMeister-input.scss
Created November 11, 2015 03:19
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
@function map-fetch($map, $keys...) {
@each $key in $keys {
$map: map-get($map, $key);
}
@return $map;
@cgutierrez
cgutierrez / mkdir.js
Created December 14, 2012 19:23
recursive mkdir
function mkdir(dir, mode, callback) {
var fs = require('fs');
var path = require('path');
if (typeof mode === 'function') {
callback = mode;
mode = null;
}
@cgutierrez
cgutierrez / base64.lua
Created November 20, 2012 20:31
db notifications
#!/usr/bin/env lua
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de>
-- licensed under the terms of the LGPL2
-- character table string
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
@cgutierrez
cgutierrez / action.php
Created October 10, 2012 02:42
Lithium Global CSRF Protection
use lithium\action\Dispatcher;
use lithium\storage\Session;
use lithium\security\validation\RequestToken;
use lithium\action\Response;
Dispatcher::applyFilter('run', function($self, $params, $chain) {
$request = $params['request'];
$excludes = array('get', 'head', 'options');
@cgutierrez
cgutierrez / aop.php
Created August 25, 2012 18:39
Lithium Presentation Examples
<?php
class Email {
protected $logger;
public function __construct(Logger $logger = null) {
$this->setLogger($logger);
}
@cgutierrez
cgutierrez / calculate_filter.php
Created May 11, 2012 03:01
Blackbe.lt - Lithium Method Filters
<?php
PriceCalculator::applyFilter('calculate', function($self, $args, $chain) {
// code here will get executed before the calculation has occurred
extract($args); //$qty, $item
$total = $chain->next($self, $args, $chain);
if (date('n') === "6") {