Skip to content

Instantly share code, notes, and snippets.

@twentyfortysix
twentyfortysix / composer.json
Last active January 3, 2024 16:41
Wordpress Bedrock composer settings
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "scott.walkinshaw@gmail.com",
@courtneymyers
courtneymyers / acf_modifications.php
Created February 28, 2018 18:36
Reduces initial height of Advanced Custom Fields WYSIWYG fields to 100px, and enables autoresizing of WYSIWYG field, as text is entered. Best practice would be to include this function in a site-specific plugin.
<?php
/*
* -----------------------------------------------------------------------------
* Advanced Custom Fields Modifications
* -----------------------------------------------------------------------------
*/
function PREFIX_apply_acf_modifications() {
?>
<style>
@ediamin
ediamin / wpautop.js
Created February 27, 2017 09:49
JavaScript version of WordPress wpautop function
// source: https://github.com/andymantell/node-wpautop
function _autop_newline_preservation_helper (matches) {
return matches[0].replace( "\n", "<WPPreserveNewline />" );
},
function wpautop(pee, br) {
if(typeof(br) === 'undefined') {
br = true;
}
@ppelleti
ppelleti / svg-to-dxf.pl
Created May 4, 2016 02:22
Convert SVG files to DXF files on Mac OS X
#!/usr/bin/perl -w
# svg-to-dxf.pl - convert SVG files to DXF files on Mac OS X
# by Patrick Pelletier, public domain (or cc0)
# based on the commands suggested here:
# https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Other_2D_formats
# assumes Inkscape.app is installed in /Applications
# and pstoedit is installed in PATH, such as via "brew install pstoedit"
use Cwd qw(abs_path);
@wpscholar
wpscholar / remote-media-loader.php
Last active April 5, 2022 08:57
Load media from a remote site so you don't have to download the uploads directory.
<?php
/**
* Loads media from a remote site when on a local dev environment.
* Eliminates the need to download the uploads directory from the remote site for testing purposes.
*/
if ( 'mydomain.dev' === $_SERVER['HTTP_HOST'] ):
add_filter( 'upload_dir', function ( $uploads ) {
$uploads['baseurl'] = 'http://mydomain.com/wp-content/uploads';
@natelandau
natelandau / .bash_profile
Last active July 27, 2024 05:39
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@isGabe
isGabe / wp_custom_title_placeholder_text.php
Last active February 25, 2019 21:28
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
@gre
gre / easing.js
Last active June 27, 2024 15:37
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {