Skip to content

Instantly share code, notes, and snippets.

View FaHuSchmidt's full-sized avatar

Fabian Schmidt FaHuSchmidt

View GitHub Profile
@bshaffer
bshaffer / gist:328103
Created March 10, 2010 17:19
Doctrine_Query_Extra
<?php
/*
* Extended Doctrine Query class providing a few additional functions
* for wrapping your where clauses more efficiently
*/
class Doctrine_Query_Extra extends Doctrine_Query
{
protected $_startClause = false;
/**
@JCook21
JCook21 / gist:3824561
Created October 3, 2012 02:22
Singleton class for logging to Graylog
<?php
use Monolog\Logger;
use Monolog\Handler\GelfHandler;
use Gelf\MessagePublisher;
/**
* Class to configure and return a Monolog instance
*
* @author Jeremy Cook
*/
@JCook21
JCook21 / gist:3824584
Created October 3, 2012 02:26
Error handling file to log all PHP errors to Graylog2
<?php
/**
* This file sets up exception and error handlers to log errors to our Graylog2
* server.
*
* @author Jeremy Cook
*/
//Add the autoloader generated by composer for dependencies.
require_once 'path/to/composer/autoload.php';
@EpokK
EpokK / ngEnter.js
Last active January 7, 2022 13:57
ngEnter directive if you can use submit form(https://twitter.com/ririlepanda)
app.directive('ngEnter', function() {
return function(scope, element, attrs) {
element.bind("keydown keypress", function(event) {
if(event.which === 13) {
scope.$apply(function(){
scope.$eval(attrs.ngEnter);
});
event.preventDefault();
}
@FaHuSchmidt
FaHuSchmidt / symfony_project_docker.md
Last active November 9, 2018 14:41
Create Symfony project with Docker

Create a Symfony project

...with Docker as only dependency.

No local installations of PHP or composer needed!

This example uses Symfony Flex and symfony/skeleton which contains just the minimum parts of a Symfony project. You'll find further informations at Symfony docs: https://symfony.com/doc/current/setup/flex.html

Create project via composer

@networkingcat
networkingcat / yet_another_motion_automation.yaml
Last active November 17, 2024 13:33 — forked from quallenbezwinger/motion_controlled_scenes_enhanced.yaml
Homeassistant blueprint for motion-activated light scene
blueprint:
name: Yet Another Motion Automation
description: >
# YAMA V10
Turn on lights or scenes when motion is detected.
Four different scenes can be defined depending on time of day.