Skip to content

Instantly share code, notes, and snippets.

@Ocramius
Ocramius / User.php
Last active February 16, 2024 14:57
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
@unixweb
unixweb / benzinpreis-info.json
Created September 3, 2018 14:48
Benzinpreis Info mit clever-tanken.de
[{"id":"de7f592f.426b4","type":"tab","label":"benzinpreise","disabled":false,"info":""},{"id":"17602fbb.76d9e","type":"html","z":"de7f592f.426b4","name":"","property":"payload","tag":"span","ret":"text","as":"single","x":610,"y":220,"wires":[["d073b7f3.18f4e","60def84f.1b22d"]]},{"id":"90a570f5.03e88","type":"inject","z":"de7f592f.426b4","name":"","topic":"tank1","payload":"","payloadType":"date","repeat":"","crontab":"00 12 * * *","once":false,"onceDelay":0.1,"x":150,"y":220,"wires":[["b2894f43.dcb4e8"]]},{"id":"b2894f43.dcb4e8","type":"http request","z":"de7f592f.426b4","name":"Bavaria Petrol - Munich","method":"GET","ret":"txt","url":"https://www.clever-tanken.de/tankstelle_details/33072","tls":"","x":390,"y":220,"wires":[["17602fbb.76d9e"]]},{"id":"d073b7f3.18f4e","type":"function","z":"de7f592f.426b4","name":"Parse Value","func":"msg.payload = msg.payload[38];\nreturn msg;","outputs":1,"noerr":0,"x":790,"y":220,"wires":[["9c0741c7.a33d58","8874821d.3c10b8"]]},{"id":"c1b8c77f.44295","type":"googlehome-no
@mathiasverraes
mathiasverraes / TestFrameworkInATweet.php
Last active May 23, 2022 12:28
A unit testing framework in a tweet.
<?php
function it($m,$p){echo ($p?'✔︎':'✘')." It $m\n"; if(!$p){$GLOBALS['f']=1;}}function done(){if(@$GLOBALS['f'])die(1);}
@shuairan
shuairan / install_taiga_uberspace.md
Last active July 28, 2021 12:58
Taiga.io Backend und Frontend auf Uberspace installieren
@crittermike
crittermike / ExampleModuleController.php
Last active June 17, 2021 12:55
Example of overriding a route controller in Drupal 8
<?php
/**
* @file
* Contains \Drupal\example_module\Controller\ExampleModuleController.
*/
// THIS FILE BELONGS AT /example_module/src/Controller/ExampleModuleController.php
namespace Drupal\example_module\Controller;
@nzjrs
nzjrs / skype-notify.py
Created June 3, 2011 13:14
Python script to make Skype co-operate with GNOME3 notifications
#!/usr/bin/env python
# Python script to make Skype co-operate with GNOME3 notifications.
#
#
# Copyright (c) 2011, John Stowers
#
# Adapted from skype-notify.py
# Copyright (c) 2009, Lightbreeze
#
#
@lstrojny
lstrojny / app--code--local--Varien--Autoload.php
Created April 16, 2013 11:27
Replace Magento autoloader with composer based autoloader. Note: you are losing the ability to use the compiler.
<?php
/**
* Classes source autoload
*/
class Varien_Autoload
{
/** @var \Composer\Autoload\ClassLoader */
private static $autoloader;
/** @var self */
@MaZderMind
MaZderMind / gist:f03298fa38f456c8ca6f32f269f5d12d
Last active May 4, 2017 13:28
Was hab ich eigentlich heute getan (git)
~/C/foobar $ git config --global alias.today "log --pretty=format:'%ad - %s' --date=format:'%H:%M:%S' --author-date-order --reverse --all --since=7:00 --author=`whoami`"
~/C/foobar $ git today
11:39:51 - FOOBAR-137: Gestaltung des Backend-Editors
11:52:50 - FOOBAR-137: Anzeigenamen-Suffix konfigurierbar machen
11:59:10 - FOOBAR-42: ermögliche das Abbrechen des Anlegen eines Dingsbums
<?php
use UI\App;
use UI\Window;
use UI\Point;
use UI\Size;
use UI\Area;
use UI\Controls\Box;
use UI\Draw\Pen;
use UI\Draw\Brush;
use UI\Draw\Path;
@trehn
trehn / damazon.py
Last active November 22, 2016 08:47 — forked from zakx/damazon.py
#!/usr/bin/python
# setup: pip install requests beautifulsoup4
from decimal import Decimal
import requests
from bs4 import BeautifulSoup
import sys
import getpass