Skip to content

Instantly share code, notes, and snippets.

View gsomoza's full-sized avatar

Gabriel Somoza gsomoza

View GitHub Profile
@gsomoza
gsomoza / pre-push.bash
Created July 23, 2015 09:36
Git pre-push hook for Ant
#!/bin/bash
# FILE: .git/hooks/pre-push
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
read -p "You're about to push $current_branch. Did you already build with Ant? [y|n] " -n 1 -r < /dev/tty
echo
if echo $REPLY | grep -E '^[Yy]$' > /dev/null
then
exit 0 # push will execute
{$R+}
{$mode TP} { Modo de compatibilidad con Turbo Pascal 7 }
{$PACKRECORDS 1}
program fileAccess;
const
BUENOS_AIRES = 'BSAS.DAT';
ARCHIVO_INFO = 'INFO.TMP';
ASC_A = 65;
ASC_R = 82;
program aeropuerto;
uses crt;
const
OPCIONES = ['A','D','P','F'];
type
RegEvento = record
nroVuelo:integer;
@gsomoza
gsomoza / ssh-copy-id.sh
Created February 14, 2012 10:30
Shell implementation of ssh-copy-id
#!/bin/sh
usage () {
echo "Usage: $0 [-i [identity_file]] [user@]machine"
exit 1
}
# Parse options
while getopts ":i:" o
do case "$o" in
@gsomoza
gsomoza / v20151009133517_AddStaticRoute.php
Created October 17, 2015 14:14
Pimcore Migrations Samples
<?php
namespace Migrations;
use Pimcore\Migrations\Migration\AbstractMigration;
use Pimcore\Model\Staticroute;
/**
* Migration v20151009133517_AddStaticRoute
* @author Gabriel Somoza <gabriel@somoza.me>
*/
@gsomoza
gsomoza / gist:5270172
Last active December 15, 2015 13:49
Useful Git Aliases
[alias]
# Usage: git nff {merge-branch}
# Checks out {merge-branch}, pulls, and merges recursively with the branch where this command was executed.
# In other words: it merges the current branch into {merge-branch}.
nff = !bash -c 'cb="$(git rev-parse --abbrev-ref HEAD)" && git checkout "$1" && git pull && git merge --no-ff $cb' -
# Usage: git cbranch
# Returns the name of the current branch
cbranch = rev-parse --abbrev-ref HEAD
@gsomoza
gsomoza / GabrielSomoza_ImageCdn_Model_Varien_Image.php
Last active December 18, 2015 05:49
ImageMagick Support for OnePica_ImageCdn
<?php
/**
* Overrides for OnePica_ImageCdn
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0), a
* copy of which is available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
Verifying that +somoza is my blockchain ID. https://onename.com/somoza
@gsomoza
gsomoza / gist:be935827f23e98e1218064fc2c34b256
Created September 9, 2016 13:31
Slim Magento 1 DB Dump
mysqldump --no-data -h localhost -u root -p schema | gzip > structure.sql.gz
mysqldump --no-create-info -h localhost -u root -p
--ignore-table=schema.adminnotification_inbox \
--ignore-table=schema.aw_core_logger \
--ignore-table=schema.dataflow_batch_export \
--ignore-table=schema.dataflow_batch_import \
--ignore-table=schema.log_customer \
--ignore-table=schema.log_quote \
--ignore-table=schema.log_summary \
--ignore-table=schema.log_summary_type \
<?php
interface RequestAuthorizer
{
public function __construct(AccessToken $accessToken);
public function isAuthorized(RequestInterface $request): bool;
public function authorize(RequestInterface $request): void;
}
class AccessTokenMiddleware