Skip to content

Instantly share code, notes, and snippets.

View mayeco's full-sized avatar

Mario Young mayeco

  • Sevilla, Spain
View GitHub Profile
// An example controller binded to the form
function FormCntl($scope, $compile) {
// Consider using FosJsRouting bundle, if you want to use a Symfony2 route
$scope.formUrl = "http://url-to-fetch-my-form";
// Data from the form will be binded here
$scope.data = {};
// Method called when submitting the form
$scope.submit = function() {
@mayeco
mayeco / gist:1149f88664c3621c1b53
Last active August 29, 2015 14:26 — forked from avalanche123/gist:981817
GitHub Emoji
:+1:
:-1:
:airplane:
:art:
:bear:
:beer:
:bike:
:bomb:
:book:
:bulb:
@mayeco
mayeco / normalizer.php
Last active August 29, 2015 14:26 — forked from alexandresalome/normalizer.php
Normalizer for Doctrine entities
<?php
namespace Gitonomy\Bundle\CoreBundle\Serializer\Normalizer;
use Symfony\Bridge\Doctrine\RegistryInterface;
use Symfony\Component\Serializer\Normalizer\NormalizerInterface;
use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
class EntitiesNormalizer implements NormalizerInterface, DenormalizerInterface
{
@mayeco
mayeco / slides.md
Last active August 29, 2015 14:27 — forked from aaronwolen/slides.md
Pandoc template to generate reveal.js slideshows.

% Title % Name % Date

My first slide

List

@mayeco
mayeco / .bowerrc
Last active August 29, 2015 14:27 — forked from facultymatt/.bowerrc
{
"directory": "components"
}
@mayeco
mayeco / gist:11aabab4a4c2c1ad4906
Created December 14, 2015 18:48 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@mayeco
mayeco / nrpe-install-on-amazon-ami-ec2.md
Created February 14, 2016 04:45
Installing nagios NRPE on AWS EC2 Amazon AMI boxes

Installing nagios NRPE on AWS EC2 Amazon AMI boxes

Grab all of the NRPE items via yum

yum install nagios-plugins-all nagios-plugins-nrpe nrpe
chkconfig nrpe on

Update the Config for NRPE

update the config by checking allowed_hosts and

@mayeco
mayeco / User.php
Created January 31, 2017 15:42 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@mayeco
mayeco / git-docker-install.sh
Last active June 29, 2017 19:26
Install docker
#!/bin/sh
set -e
sudo yum remove -y docker docker-common container-selinux docker-selinux docker-engine docker-ce
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
@mayeco
mayeco / Ruby Lambdas.md
Created October 1, 2017 03:51 — forked from Integralist/Ruby Lambdas.md
Ruby lambdas

Lambda: standard

# Creating a lambda
l = lambda { |name| "Hi #{name}!" }

# Executing the lambda
l.call("foo") # => Hi foo!