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
PEAR Channel Server hosted by GitHub
====================================
This is my PEAR Channel Server hosted by GitHub and powered by [Pirum](http://www.pirum-project.org):
[jsor.github.com/pear](http://jsor.github.com/pear)
Create your own PEAR Channel Server
-----------------------------------
@Potherca
Potherca / .bashrc
Created August 4, 2011 10:04
Add coloured branch or revision to prompt when in Git or SVN working directory.
# ------------------------------------------------------
# Enhance prompt when inside git repos
# http://railstips.org/blog/archives/2009/02/02/bedazzle-your-bash-prompt-with-git-info/
# ------------------------------------------------------
function parse_git_branch {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo -e '\E[0;34m'"\033[1m("${ref#refs/heads/}") \033[0m"
}
# ------------------------------------------------------
@Potherca
Potherca / dabblet.css
Created May 16, 2012 18:44
Floating Block on a Light Blue Small Tile Background
/**
* Floating Block on a Light Blue Small Tile Background
*/
body {
background: #CDE;
background: linear-gradient(45deg, #FFF, #AAF);
background-size: 0.75em 0.75em;
}
.grid {
@Potherca
Potherca / git-bisect-phpunit.sh
Created May 27, 2012 12:32 — forked from havvg/git-bisect-phpunit.sh
git bisect phpunit wrapper
#!/bin/bash
phpunit
EXIT_CODE="$?"
if [ $EXIT_CODE -eq "255" ]; then
# Wrapping the error code to 1, so bisect marks this build as "bad" and continues.
exit 1
fi
@Potherca
Potherca / dabblet.css
Last active February 18, 2020 13:23
My answer to Stackoverflow Question 1261955: Inherited Text-Decoration style
/**
* My answer to Stackoverflow Question 1261955: Inherited Text-Decoration style
*
* http://stackoverflow.com/questions/1261955/inherited-text-decoration-style/4377895#4377895
*/
@import url(http://fonts.googleapis.com/css?family=Droid+Sans|Droid+Sans+Mono);
body {
font-family: 'Droid Sans', sans-serif;
@Potherca
Potherca / README.md
Last active November 27, 2023 17:44
Create a branch on Github without access to a local git repo using http://hurl.eu/

Ever had the need to create a branch in a repo on Github without wanting (or being able) to access a local repo?

With the aid of [the Github API][1] and any online request app this is a piece of cake!

Just follow these steps:

  1. Open an online request app (like apirequest.io, hurl.it pipedream.com, reqbin.com, or webhook.site)
  2. Find the revision you want to branch from. Either on Github itself or by doing a GET request from Hurl: https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs/heads
  3. Copy the revision hash
  4. Do a POST request from Hurl to https://api.github.com/repos/<AUTHOR>/<REPO>/git/refs with the following as the POST body :
@Potherca
Potherca / CodingConvention-Dockblock.txt
Last active September 5, 2018 13:45
Dockblock explaining our coding convention - https://blog.pother.ca/VariableNamingConvention/
/**
* Note: The variable naming scheme used in this project is an adaption of
* Systems Hungarian. More details available here:
*
* https://blog.pother.ca/VariableNamingConvention/
*
* This style guide was originally created by Ben Peachey and Sander Krause.
*/
@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">