Skip to content

Instantly share code, notes, and snippets.

Ben Peachey Potherca

Block or report user

Report or block Potherca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Potherca
Potherca / class.__Function.php
Last active Nov 29, 2015
"Autoloading" PHP functions from separate files.
View class.__Function.php
<?php
/**
* Provides __autoloading for functions placed in FUNCTION_DIR.
*
* This also allows for easy function aliassing in case of namespace conflicts.
* There are two requisites for this to work:
*
* 1. a constant named FUNCTION_DIR must be defined to point to the directory
* where you keep your functions
@Potherca
Potherca / README.md
Last active Dec 17, 2015
Symfony config file compare script
View README.md

When working on a Symfony project, someone else will make a change to a config file or add new functionality that also need to be configured on my local machine for the project to work.

As I got tired of having to manually figure out what was going on I wrote a shell script to do that for me.

This script will gather all .dev files for a given directory, check whether there is an accompanying file without the .dev extension and output the diff between both.

@Potherca
Potherca / dabblet.css
Created Jun 12, 2013
Simple demonstration how nth-child works
View dabblet.css
/* Simple demonstration how nth-child works */
span {
width: 5em;
border: 0.1em solid;
display: inline-block;
text-align: center;
}
span:nth-child(5n) {
display: none;
@Potherca
Potherca / gist:6109744
Created Jul 30, 2013
Turn things of for the HTML input element.
View gist:6109744
<input type="text" name="some_name" autocomplete="off" autocorrect="off" autocapitalize="off">
@Potherca
Potherca / dabblet.css
Created Aug 22, 2013
Nested pseudo elements
View dabblet.css
/**
* Nested pseudo elements
*
* According to [the spec](http://www.w3.org/TR/css3-content/#nesting) pseudo should be allowed to be nested.
*/
* {padding:1em;}
div {
content: 'A';
@Potherca
Potherca / dabblet.css
Created Sep 26, 2013
A "deeper" indented text effect with the :before and :after pseudo-elements.
View dabblet.css
/**
* A "deeper" indented text effect with the :before and :after pseudo-elements.
*/
html, body {
height: 100%;
}
body {
margin: 0;
@Potherca
Potherca / dabblet.css
Created Sep 26, 2013
Adaptation of "How to vertically and horizontally center text in an unordered list or div"
View dabblet.css
/**
* Adaptation of "How to vertically and horizontally center text in an unordered list or div"
* by Andy Howard
*
* Please visit the original article at:
* http://www.andy-howard.com/verticalAndHorizontalAlignment/index.html
*
* This version removes some of the unneeded HTML and CSS
*/
@Potherca
Potherca / abstract.md
Last active Dec 24, 2015
Abstract for the PHPHOOLIGANS Talk
View abstract.md

The goal of this talk is to get people thinking and talking more about common practices, instead of copy/pasting or cargo-culting.

This is done through the PHPHOOLIGANS format:

First the audience is presented with several rather opinionated viewpoints by means of provocative statements on things that occur in everyday PHP development, like: working with objects, type safe comparison and type hinting, Design Patterns, and PHP Frameworks. We call these "fights".

Next the PHPHOOLIGANS (Ben Peachey and Auke van Slooten) will engage the audience in an open discussion on these topics. This is done by challenging the audience to (individually or collectively) try to change the hooligans view on a subject. They are effectively told to "pick a fight".

The hooligans will try to defend their viewpoint through valid arguments and anecdotal evidence.

@Potherca
Potherca / bl.ocks.org
Last active Dec 25, 2015
My views on a Tweet by JayTaph
View bl.ocks.org
@Potherca
Potherca / dabblet.css
Last active Dec 25, 2015
CSS Only Warning Sign
View dabblet.css
@charset "UTF-8"
@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono);
/**
* CSS Only Warning Sign
*
* In an attempt to create this effect utilizing the Unicode "Warning Sign" character
* I quickly ran into trouble trying to get things cross-browser compatible. Something
* else that bothered me was the fact that there was no way to change the look of the
* sign, as that was implemented in the used font. In this attempt, the exclamation mark
You can’t perform that action at this time.