Skip to content

Instantly share code, notes, and snippets.

View baerkins's full-sized avatar
🌵

Shaun Baer baerkins

🌵
  • Philadelphia, PA
View GitHub Profile
@emaildano
emaildano / README.md
Last active June 6, 2017 08:06
AMIMOTO User Permissions

AMIMOTO User Permissions

Add ec2-user to nginx group

sudo usermod -a -G nginx ec2-user &&
exit

Update Owner & Permissions

@asugai
asugai / Install composer on Amazon AMI running on EC2
Last active March 22, 2024 03:37
Install composer on Amazon AMI running on EC2
$ cd ~
$ sudo curl -sS https://getcomposer.org/installer | sudo php
$ sudo mv composer.phar /usr/local/bin/composer
$ sudo ln -s /usr/local/bin/composer /usr/bin/composer
then you can run
$ sudo composer install
@paulhhowells
paulhhowells / recursively to find the first instance of a key and return its value.php
Last active December 16, 2015 06:09
PHP: search an array recursively to find the first instance of a key and return its value. array_find_first_recursive($needle, $haystack)
/*
* search an array recursively to find
* the first instance of a key and return its value
*
* useful when you do not know the location of a key nested (only once) in a multidimensional array
*
*/
function array_find_first_recursive($needle_key, array $haystack) {
if (array_key_exists($needle_key, $haystack)) {
@wpsmith
wpsmith / wps_enqueue_jquery.php
Last active March 19, 2018 20:55
PHP: Enqueue Google CDN jQuery with fallback to WordPress
<?php
add_action( 'wp_enqueue_scripts', 'wps_enqueue_jquery' );
/**
* Enqueue jQuery from Google CDN with fallback to local WordPress
*
* @link http://codex.wordpress.org/Function_Reference/wp_enqueue_script
* @link http://codex.wordpress.org/Function_Reference/wp_register_script
* @link http://codex.wordpress.org/Function_Reference/wp_deregister_script
* @link http://codex.wordpress.org/Function_Reference/get_bloginfo
* @link http://codex.wordpress.org/Function_Reference/is_wp_error
@helen
helen / repeatable-fields-metabox.php
Created January 11, 2012 04:42
Repeating Custom Fields in a Metabox
<?
/**
* Repeatable Custom Fields in a Metabox
* Author: Helen Hou-Sandi
*
* From a bespoke system, so currently not modular - will fix soon
* Note that this particular metadata is saved as one multidimensional array (serialized)
*/
function hhs_get_sample_options() {
/* ----------------------------------------------------------------------------------------------------
Super Form Reset
A couple of things to watch out for:
- IE8: If a text input doesn't have padding on all sides or none the text won't be centered.
- The default border sizes on text inputs in all UAs seem to be slightly different. You're better off using custom borders.
- You NEED to set the font-size and family on all form elements
- Search inputs need to have their appearance reset and the box-sizing set to content-box to match other UAs