Skip to content

Instantly share code, notes, and snippets.

View dwolke's full-sized avatar
👻
Hurz

Daniel Wolkenhauer dwolke

👻
Hurz
View GitHub Profile
@dwolke
dwolke / menu.phtml
Last active August 29, 2015 13:56 — forked from kaiohken1982/menu.phtml
Twitter bootstrap markup for ZF2-Navigation
<?php
/**
* Funzionalità iterativo-ricorsiva per la generazione del menù
*/
if(!function_exists('renderMenu')) {
function renderMenu($container, $obj, $step = 0) {
$html = '';
if(null !== $container && $container->count()) {
if(!$step) {
<?php
namespace HTMLPurifier\Controller\Plugin;
use Zend\Mvc\Controller\Plugin\AbstractPlugin;
class Purifier extends AbstractPlugin
{
public function __invoke($data)
{
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@dwolke
dwolke / ocp.php
Created June 25, 2014 01:33 — forked from ck-on/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter
0.1.5 2013-04-12 added graphs to visualize cache state, please report any browser/style bugs
# force HTTP to HTTPS - /etc/nginx/conf.d/nonssl.conf
server {
listen 80;
server_name jira.example.com;
access_log off;
return 301 https://$server_name$request_uri;
}
# /etc/nginx/conf.d/jira.conf
server {
<?php
/**
* Get the hash of the current git HEAD
* @param str $branch The git branch to check
* @return mixed Either the hash or a boolean false
*/
function get_current_git_commit( $branch='master' ) {
if ( $hash = file_get_contents( sprintf( '.git/refs/heads/%s', $branch ) ) ) {
return $hash;
} else {
@dwolke
dwolke / SublimeShortcuts.textile
Last active August 29, 2015 14:16 — forked from lucasfais/gist:1207002
Sublime Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@dwolke
dwolke / functions.php
Created June 26, 2015 17:23
Entfernt den Emoji Quatsch aus Wordpress
function disable_emojis() {
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
remove_action( 'wp_print_styles', 'print_emoji_styles' );
remove_action( 'admin_print_styles', 'print_emoji_styles' );
remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
remove_filter( 'comment_text_rss', 'wp_staticize_emoji' );
remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
}
@dwolke
dwolke / 2_keyboard_shortcuts.md
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.

Create documentation for your projects. Like so:


Most popular keyboard shortcuts within GistBox

  • Up/Down - Previous/Next Gist
  • Ctrl+e - Edit a selected Gist
  • Ctrl+s - Save Gist
@dwolke
dwolke / zf2-onDispatchError.php
Last active December 20, 2015 22:39
aktion bei 403, 404 usw.
public function onDispatchError(MvcEvent $e)
{
//url to redirect page to whatever...
var_dump($e->getRouter()->getRequestUri()->getPath());
$statusCode = $e->getResponse()->getStatusCode();
if ($statusCode == 404 || $statusCode == 500) {