Skip to content

Instantly share code, notes, and snippets.

View Basster's full-sized avatar

Ole Rößner Basster

View GitHub Profile
@Basster
Basster / MD5.php
Created May 23, 2012 11:40
Doctrine MySQL MD5 FunctionNode
<?php
namespace YourCompany\YourCustomer\YourBundle\DQL;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
use Doctrine\ORM\Query\Lexer;
/**
@Basster
Basster / sf2.bat
Created November 21, 2012 09:58
Symfony2 batch for Windows development
@ECHO off
SET params=
REM Merge all batch parameters into one string
:startloop
IF "%1"=="" GOTO endloop
SET params=%params%%1
SHIFT
GOTO startloop
:endloop
REM call symfony console with batch params
@Basster
Basster / jQueryConfirm.js
Created April 4, 2013 14:05
jQueryUi alert/confirm alternative
/**
* Creates a modal jQueryUi Dialog which displays a message.
* More or less a jQuery Styled alert().
*
* @param message The message to display
* @param [title] The title for the dialog box. Defaults to "Hinweis".
* @param [yesCallback]
* @param [noCallback]
*/
function jQueryConfirm(message, title, yesCallback, noCallback) {
@Basster
Basster / gist:8441857
Last active January 3, 2016 09:19 — forked from croxton/gist:4073583
Activate xdebug 2.2.3 for AMPPS on OSX
On AMPPS 2.2 xdebug.so is included for all shipped PHP versions but not at the correct folders.
To activate it, follow these steps:
1.) make sure xdebug.so can be found in these locations:
/Applications/AMPPS/php-5.3/lib/extensions/xdebug.so
/Applications/AMPPS/php-5.4/lib/extensions/xdebug.so
/Applications/AMPPS/php-5.5/lib/extensions/xdebug.so
As AMPPS just changes a symlink when changing PHP versions, you need to edit the config files for each of the versions:
# IntelliJ Project
.idea/*
# Temp and swap files
*~
*.swp
*.tmp
# Compiled source
*.com
@Basster
Basster / SymfonyConventionsExtraBundleInteropTemplateGuesser.php
Last active May 5, 2017 11:44
Let QafooLabsNoFrameworkBundle and FrameworkExtraBundle play nicely together
<?php
declare(strict_types=1);
namespace DI\View;
use QafooLabs\Bundle\NoFrameworkBundle\View\TemplateGuesser;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\RequestStack;
/**
@Basster
Basster / ServiceContainerTest.php
Created June 16, 2017 12:29
Class ServiceContainerTest boots up the kernel to test whether all service configurations are valid.
<?php
declare(strict_types=1);
namespace Tests\DI;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Class ServiceContainerTest boots up the kernel to test whether all service configurations are valid.
*/
@Basster
Basster / api.js
Created September 29, 2017 13:24
Router
@Basster
Basster / api.js
Created September 29, 2017 13:24
import $ from 'jquery';
import _ from 'lodash';
import Router from '../module/router';
export class Api {
getComments(typeface, callback) {
$.getJSON(Router.generate('typeface_comments', {'slug': typeface}), callback);
}
deleteComment(typeface, id, callback) {
import _ from 'lodash';
import React from 'react';
import ReactDOM from 'react-dom';
import Router from '../module/router';
import {api} from '../common/api';
import {Comment} from './comment';
import {Counter} from './counter';
import {TypefaceCommentForm} from './typeface-comment-form';
export class TypefaceComments extends React.Component {