Skip to content

Instantly share code, notes, and snippets.

View Potherca's full-sized avatar
🤔
I wonder what this button does…

Ben Peachey Potherca

🤔
I wonder what this button does…
View GitHub Profile
@Potherca
Potherca / class.__Function.php
Last active November 29, 2015 14:57
"Autoloading" PHP functions from separate files.
<?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 December 17, 2015 08:49
Symfony config file compare script

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 June 12, 2013 07:23
Simple demonstration how nth-child works
/* 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 July 30, 2013 02:41
Turn things of for the HTML input element.
<input type="text" name="some_name" autocomplete="off" autocorrect="off" autocapitalize="off">
@Potherca
Potherca / dabblet.css
Created August 22, 2013 14:16
Nested pseudo elements
/**
* 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 September 26, 2013 12:40
A "deeper" indented text effect with the :before and :after pseudo-elements.
/**
* A "deeper" indented text effect with the :before and :after pseudo-elements.
*/
html, body {
height: 100%;
}
body {
margin: 0;
@Potherca
Potherca / dabblet.css
Created September 26, 2013 13:34
Adaptation of "How to vertically and horizontally center text in an unordered list or div"
/**
* 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 December 24, 2015 19:49
Abstract for the PHPHOOLIGANS Talk

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 December 25, 2015 05:09
My views on a Tweet by JayTaph
@Potherca
Potherca / dabblet.css
Last active December 25, 2015 13:09
CSS Only Warning Sign
@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