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 / 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 / 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 / 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 / Logging.php
Created December 21, 2015 18:24
PHP Logging Trait
<?php
/**
* Logging
*/
namespace Galonso\Logging;
/**
* Logging trait
*/
trait Logging
@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 / AdoDbDoctrineAdapter.php
Last active January 24, 2024 00:29
PHP AdoDb Doctrine Adapter
<?php
/**
* Class AdoDbDoctrineAdapter
*
*
* Intentaremos empalmar adodb con doctrine
*
* Metodos de ADODB:
*