Skip to content

Instantly share code, notes, and snippets.

View dalemoore's full-sized avatar

Dale Moore dalemoore

View GitHub Profile
@brettsnippets
brettsnippets / flexbox.css
Created June 29, 2013 06:38
Flexbox "Cross Browser" Sample
.content {
display: -webkit-box; /* OLD - iOS 6-, Safari 3.1-6 */
display: -moz-box; /* OLD - Firefox 19- (buggy but mostly works) */
display: -ms-flexbox; /* TWEENER - IE 10 */
display: -webkit-flex; /* NEW - Chrome */
display: flex;
-webkit-flex-direction: column;
-moz-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
@gglnx
gglnx / custom-post-type-rewrite.php
Last active December 15, 2015 07:19
Changes the permalink for a custom post type
<?php
/**
* Plugin Name: Custom URIs for Podlove Publisher
* Description: Changes the URIs for the episode custom post type of the Podlove Publisher
* Author: Dennis Morhardt
* Version: 1.0
* Author URI: http://www.dennismorhardt.de/
*/
/**
@jfloff
jfloff / mamp.md
Last active October 31, 2025 18:50
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@mchrislay
mchrislay / select-text-woo-checkoutt.php
Created January 24, 2013 02:05
Add Select Radio Buttons + Text Field option to WooCommerce Checkout Page
<?php
/**
* Outputs a rasio button form field
*/
function woocommerce_form_field_radio( $key, $args, $value = '' ) {
global $woocommerce;
$defaults = array(
'type' => 'radio',
'label' => '',
<?php
/**
* Selectively add classes to certain blocks
*
* Implements alpha_preprocess_block
*/
function sil_alpha_preprocess_block(&$var) {
$block_id = $var['block']->module . '-' . $var['block']->delta;
$classes = &$var['attributes_array']['class'];
switch ($block_id) {
@nearestnabors
nearestnabors / index.html
Created November 12, 2012 00:08
A CodePen by Rachel Nabors. Parallax backgrounds with walk cycle - Multiple background images with CSS3 animation create a multi-depth parallax affect. This is what parallax was meant for.
<div class="foreground"></div>
<div class="midground">
<div class="tuna"></div>
</div>
<div class="background">
</div>
@hissy
hissy / gist:3613306
Last active June 26, 2023 22:56
[WordPress] change next / previous post link ordering
<?php
/**
* Customize Adjacent Post Link Order
*/
function my_custom_adjacent_post_where($sql) {
if ( !is_main_query() || !is_singular() )
return $sql;
$the_post = get_post( get_the_ID() );
$patterns = array();
@gagarine
gagarine / template.tpl.php
Created July 29, 2012 21:11
Working with drupal theme_menu_tree
<?php
/**
* Theme_menu_tree doesn't provide any context information
* THIS SUCKS
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
*/
function MYTHEME_menu_tree(&$variables) {
@steffenr
steffenr / .htaccess
Created June 15, 2012 10:05
Drupal htaccess optimizations
# KILL THEM ETAGS
# http://www.askapache.com/htaccess/apache-speed-etags.html
FileETag none
# set expires header
<FilesMatch "\.(ico|jpg|jpeg|png|gif|js|css|swf|woff|eot|svg|ttf)$">
Header set Expires "Tue, 16 Jun 2020 20:00:00 GMT"
</FilesMatch>
# turn on gzip compression
@antoniofrignani
antoniofrignani / gist:2867425
Created June 4, 2012 09:31
[WP] - Add featured thumbnail to admin post / page columns
// http://wpsnipp.com/index.php/functions-php/updated-add-featured-thumbnail-to-admin-post-page-columns/
if (function_exists( 'add_theme_support' )){
add_filter('manage_posts_columns', 'posts_columns', 5);
add_action('manage_posts_custom_column', 'posts_custom_columns', 5, 2);
add_filter('manage_pages_columns', 'posts_columns', 5);
add_action('manage_pages_custom_column', 'posts_custom_columns', 5, 2);
}
function posts_columns($defaults){
$defaults['wps_post_thumbs'] = __('Thumbs');