Skip to content

Instantly share code, notes, and snippets.

View DouglasdeMoura's full-sized avatar

Douglas Moura DouglasdeMoura

View GitHub Profile
@DouglasdeMoura
DouglasdeMoura / README.md
Created July 6, 2022 20:52 — forked from nikoheikkila/README.md
Fish Shell function for sourcing standard .env files

envsource

I've been using Fish shell for years which is great and all, but one thing that has got me frustrated is using it with .env files.

When attempting to run source .env in a project, I usually encounter this problem:

.env (line 2): Unsupported use of '='. In fish, please use 'set KEY value'.
from sourcing file .env
source: Error while reading file '.env'
@DouglasdeMoura
DouglasdeMoura / functions.php
Created April 12, 2016 14:30 — forked from hlashbrooke/functions.php
WordPress: Create a custom metabox that works in exactly the same way as the existing 'Featured Image' box on the post edit screen. In this case the image is called 'Listing Image' (with all the function and variable names correlating to that), but you can change the strings to whatever you need them to be.
<?php
add_action( 'add_meta_boxes', 'listing_image_add_metabox' );
function listing_image_add_metabox () {
add_meta_box( 'listingimagediv', __( 'Listing Image', 'text-domain' ), 'listing_image_metabox', 'post', 'side', 'low');
}
function listing_image_metabox ( $post ) {
global $content_width, $_wp_additional_image_sizes;
$image_id = get_post_meta( $post->ID, '_listing_image_id', true );
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(