Skip to content

Instantly share code, notes, and snippets.

View ger86's full-sized avatar
🏠
Working from home

Gerardo Fernández Moreno ger86

🏠
Working from home
View GitHub Profile
<?php
namespace App\Repository;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
use App\Repository\EntityStatsRepositoryInterface;
class EntityStatsRepositoryDecorator extends ServiceEntityRepository {
<?php
namespace App\Doctrine\EntityListener;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs;
use App\Entity\Post;
class PostEntityListener {
/**
* @inheritDoc
* @param OnFlushEventArgs $event
<?php
namespace App\Doctrine\EntityListener;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs;
use App\Entity\Post;
class PostEntityListener {
/**
* @inheritDoc
* @param OnFlushEventArgs $event
<?php
namespace App\Doctrine\EntityListener;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs;
use App\Entity\Post;
class PostEntityListener {
@ger86
ger86 / post.php
Last active February 8, 2019 13:15
<?php
/**
* @ORM\Entity
*/
class Post
{
...
/**
@ger86
ger86 / SendIOSPushNotification.php
Created January 24, 2019 11:45
A Symfony Service to send iOS Push Notifications.
<?php
namespace App\Service\PushNotification;
class SendIOSPushNotification {
/**
* Constructor
*
* @param string $iosPushNotificationsKey
const testA = [9, -3, 5, 2, 6, 8, -6, 1, 3];
const testASorted = quickSort(testA);
console.log(testASorted);
const testB = [-3, -2, -1, 0, 1, 2, 3];
const testBSorted = quickSort(testB);
console.log(testBSorted);
const testC = [3, 2, 1, 0, -1, -2, -3];
const testCSorted = quickSort(testC);
const defaultSortingAlgorithm = (a, b) => {
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;
};
//
// RNiBeacon.m
// RNiBeacon
//
// Created by MacKentoch on 17/02/2017.
// Copyright © 2017 Erwan DATIN. All rights reserved.
//
#import <CoreLocation/CoreLocation.h>
@ger86
ger86 / new.module.ios.js
Created January 16, 2019 15:39
React Native Beacons (1)
// @flow
import {
type BeaconRegion,
type AuthorizationStatus,
type BeaconsManagerIOS
} from './module.types';
const RN = require('react-native');
const BeaconsManager: BeaconsManagerIOS = RN.NativeModules.RNiBeacon;