Skip to content

Instantly share code, notes, and snippets.

View g-alonso's full-sized avatar

. g-alonso

  • Buenos Aires, Argentina
View GitHub Profile
@g-alonso
g-alonso / AdoDbDoctrineAdapter.php
Last active January 24, 2024 00:29
PHP AdoDb Doctrine Adapter
<?php
/**
* Class AdoDbDoctrineAdapter
*
*
* Intentaremos empalmar adodb con doctrine
*
* Metodos de ADODB:
*
@g-alonso
g-alonso / EventGenerator.php
Created December 31, 2015 22:43 — forked from rosstuck/EventGenerator.php
Simple EventGenerator trait that you might use with domain events
<?php
trait EventGenerator
{
protected $pendingEvents = array();
protected function raise($event)
{
$this->pendingEvents[] = $event;
}
@g-alonso
g-alonso / Logging.php
Created December 21, 2015 18:24
PHP Logging Trait
<?php
/**
* Logging
*/
namespace Galonso\Logging;
/**
* Logging trait
*/
trait Logging
@g-alonso
g-alonso / gist:d42386b95021cc560fb6
Created November 27, 2014 18:51
apt-yum-equivalent.txt
= Some yum usage for people who know "apt" =
If you are familiar with the apt package manager on Debian/Ubuntu this page should help you transfer your knowledge to working with yum on Fedora/RHEL/CentOS/etc.
Note that this page as currently written is by non-apt experts, so there may be some mistakes.
== General points ==
* Speed:
* data/CPU: apt on Debian deals with roughly ~37,000 packages[1] and an extra 6,500 "provides"[2]. yum on Fedora deals with roughly 24,000 packages, 143,000 provides and 3,100,000 file provides.
@g-alonso
g-alonso / angular.tree.view
Created April 9, 2014 14:20
Angular Tree View
http://jsfiddle.net/brendanowen/uXbn6/8/
<script type="text/ng-template" id="tree_item_renderer.html">
{{data.name}}
<button ng-click="add(data)">Add node</button>
<button ng-click="delete(data)" ng-show="data.nodes.length > 0">Delete nodes</button>
<ul>
<li ng-repeat="data in data.nodes" ng-include="'tree_item_renderer.html'"></li>
</ul>
</script>
@g-alonso
g-alonso / angularUpload.js
Last active August 29, 2015 13:57
Angular File Upload
// Module
// ------
var upload = angular.module('Upload', []);
// Directive
// ---------
upload.directive('fileChange', function () {
var linker = function ($scope, element, attributes) {
// onChange, push the files to $scope.files.
@g-alonso
g-alonso / misc.js
Last active August 29, 2015 13:57
Misc goes here...
//recursion
(function g(tree, element){
angular.forEach(tree, function(elm, k){
if(element.attribute_id == elm.attribute_id){
tree[k].repeated++;
}
g(tree[k].children, element);
});
})(scope.tree, element)
@g-alonso
g-alonso / oracle-snippets.sh
Created February 3, 2014 18:29
Oracle Snippets
/*Get Sequences*/
select iway_base.APP_ROLE_SEQ.currval from dual;
select iway_base.APP_ROLE_SEQ.nextval from dual;
@g-alonso
g-alonso / angular.modal.js
Last active October 28, 2023 15:02
Angular Modal
/**
*
*
* Angular Modal Service
*
* Requiere Bootstrap's modal (http://getbootstrap.com/javascript/#modals)
*
* Example:
*
* //1) Confirmation Modal
@g-alonso
g-alonso / dataFields.js
Last active January 2, 2016 02:49
Angular Select Multiple Directive
/*
Original Source: http://blog.boxelderweb.com/2013/08/22/angularjs-multi-select-widget/
Modif:
-03/12/2013
Gabriel Alonso (gbr.alonso@gmail.com)
Example: