Skip to content

Instantly share code, notes, and snippets.

View geekish's full-sized avatar

Hannah Chartier geekish

View GitHub Profile
@geekish
geekish / functions.php
Created April 16, 2014 22:05
Add Genesis "Theme Settings" page link to WordPress toolbar
<?php
//* Add Genesis "Theme Settings" to Toolbar
add_action( 'admin_bar_menu', 'genesis_adminbar_settings_link', 999 );
function genesis_adminbar_settings_link( $wp_admin_bar ) {
$args = array(
'id' => 'genesis_theme_settings',
'title' => 'Genesis Settings',
'href' => '/wp-admin/admin.php?page=genesis',
'parent' => 'site-name'
);
@geekish
geekish / hnnhme.conf
Last active February 11, 2017 16:46
YOURLS on nginx
server {
listen 80;
listen [::]:80;
server_name hnnh.me www.hnnh.me;
root /var/www/hnnh.me;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /yourls-loader.php;
@geekish
geekish / README.md
Last active November 15, 2016 19:39 — forked from frdmn/bash_aliases
Homebrew Nginx and PHP-FPM configuration

This is the configuration I use for nginx + PHP on my Macs. I use dnsmasq to handle *.devio.

nginx setup:

  • configuration is in /usr/local/etc/nginx.
  • Server conf files are in subfolder conf.d.
  • Include files (php-fpm.conf) are in subfolder inc.

DNS setup:

@geekish
geekish / pagekit.conf
Last active November 14, 2016 15:53
Pagekit Nginx conf
server {
listen 80;
server_name pagekit.dev ~^pagekit\.(.*)\.xip\.io;
root /home/vagrant/www/pagekit;
index index.php;
access_log /home/vagrant/log/pagekit-access.log;
error_log /home/vagrant/log/pagekit-error.log;
@geekish
geekish / !PhpFunctions.md
Last active October 13, 2017 15:34
Useful PHP functions

Useful PHP functions

Mostly for debugging. Useful enough to remember them but not enough to create a Composer package (yet).

If you want to use any of these, they are provided under the MIT license (see LICENSE.md). Some of the code here was adapted from answers found on Stack Overflow, and credit is given where due.

@geekish
geekish / RESUME.md
Last active February 15, 2017 17:08
My resume, as resumes should be - plain text. Short URL: http://git.io/vW3kG

Keybase proof

I hereby claim:

  • I am geekish on github.
  • I am geekish (https://keybase.io/geekish) on keybase.
  • I have a public key ASCn8xGqB38xu57maDrCbNHZ2PQSgOV603h8gg9Mvj23Qgo

To claim this, I am signing this object:

@geekish
geekish / README.md
Created December 8, 2016 00:59
Symfony Console interactive did you mean
[Symfony\Component\Console\Exception\CommandNotFoundException]  
  Command "mow" is not defined.                                   
  Did you mean this?                                              
      meow                  

That's a nice error message, but we can do better. This is an example.

Run composer install, then php console.php mow. Should give you:

@geekish
geekish / routes.php
Created January 18, 2017 17:37
Slim routes
<?php
use Psr\Http\Message\ResponseInterface as Response;
use Psr\Http\Message\ServerRequestInterface as Request;
use Slim\App;
$app = new App;
/**
* Prints json representation of routes your Slim app has
@geekish
geekish / MyGroup.php
Created May 17, 2017 17:38
Slim invokable class as group callable example (PR #2229)
<?php
namespace Example;
use Slim\App;
use SomeDependency;
class MyGroup
{
public function __construct(SomeDependency $dependency)