Skip to content

Instantly share code, notes, and snippets.

View christoph-hautzinger's full-sized avatar

Christoph Hautzinger christoph-hautzinger

View GitHub Profile
import React from 'react';
import ReactDOM from 'react-dom';
import ApolloApp from './apollo';
import StandortWidget from './StandortWidget/';
import ZeiterfassungWidget from './Zeiterfassung/ZeiterfassungWidget';
import KalenderWidget from './Zeiterfassung/KalenderWidget';
import ProjektstundenWidget from './Zeiterfassung/ProjektstundenWidget';
import MonatsuebersichtWidget from './Zeiterfassung/MonatsuebersichtWidget';
import AdminWidget from './Zeiterfassung/AdminWidget';
export const FIELD_STATUS = "status";
export const FIELD_DRINGLICHKEIT = "dringlichkeit";
const listConfig = {
url: "/aufgaben.json",
fields: {
[FIELD_STATUS]: {
label: "Status",
// can field be sorted
sort: true,
<?php
namespace App\Rechnungsdatenerzeugung\Application;
use App\Events\Domain\EventCreatorCapabilities;
use App\Events\Domain\EventRegistry;
use App\Rechnungsdatenerzeugung\Domain\BatchLauf\BatchLaufFertig;
use App\Rechnungsdatenerzeugung\Domain\BatchLauf\BestellungenFuerBatchLaufGefunden;
use App\Rechnungsdatenerzeugung\Domain\BatchLauf\KeineBestellungenFuerBatchLaufGefunden;
use App\Rechnungsdatenerzeugung\Domain\BatchLauf\NeuerBatchLaufAnfangen;
const path = require('path');
exports.createPages = ({ graphql, actions }) => {
const { createPage } = actions;
return new Promise((resolve, reject) => {
const storyblokEntry = path.resolve('src/templates/storyblok-entry.js');
resolve(
graphql(
'use strict';
export default class Calculation
{
/**
* 1 0 - 4.4 35-36 0.1 0.1
* 2 4.5 - 11.4 34-36 0.1 0.2
* 3 11.5 - 18.4 33-36 0.1 0.3
* 4 18.5 - 26.4 32-36 0.1 0.4
* 5 26.5 - 36.0 31-36 0.2 0.5
@christoph-hautzinger
christoph-hautzinger / MNRelationDeletionHelper.php
Created March 31, 2019 19:25
Doctrine Helper to delete m:n relations
<?php
namespace App\Model\Doctrine;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\Common\Collections\Collection;
class MNRelationDeletionHelper
{
protected $manager;
<?php
namespace App\Api;
use App\Entity\User\User;
/**
* @GraphQL\Type()
*/
class GraphQLUserEndpoint
<?php
namespace Conspecton\Bundle\FoundationBundle\EventListener;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernel;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Routing\RequestContextAwareInterface;
<?php
// attach file to mail (or do something else with the Swift_Message instance)
$systemMailer->send('App:message-with-pdf', [], null, function (\Swift_Message $message) {
$message
->attach(Swift_Attachment::fromPath('path to image here.jpg')
->setDisposition('inline'));
});
@christoph-hautzinger
christoph-hautzinger / sort.php
Created June 10, 2015 13:30
the way so sort with php uXsort()
<?php
// sorting numbers
$arrOfInt = [10, 20, 2, 23, 122];
usort($arrOfInt, function ($int1, $int2) {
return $int1 - $int2;
});
// sorting strings
$arrOfStr = ['acb', 'aax', 'cba', 'abc'];