Skip to content

Instantly share code, notes, and snippets.

View Magnacarter's full-sized avatar

Adam Carter Magnacarter

  • React and WordPress Dev
  • United States
View GitHub Profile
@fjarrett
fjarrett / unautop-func.php
Last active April 6, 2022 16:57
Inverse behavior to the wpautop() function found in WordPress
<?php
/**
* Replaces paragraph elements with double line-breaks.
*
* This is the inverse behavior of the wpautop() function
* found in WordPress which converts double line-breaks to
* paragraphs. Handy when you want to undo whatever it did.
*
* @see wpautop()

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@fjarrett
fjarrett / gist:4887016fd3f69463ccb5
Created December 18, 2014 02:26
Custom user registration jQuery
/* globals fjarrett */
jQuery( function( $ ) {
$( document ).on( 'click', 'form #submit-registration', function (e) {
$.ajax({
type: 'POST',
url: fjarrett.ajaxurl,
data: {
action: 'fjarrett_user_registration',
registration_token: $( '#registration_token' ).val(),
@fjarrett
fjarrett / gist:1c4a5917fb180028d710
Last active August 29, 2015 14:11
Custom user registration via AJAX
<?php
/**
* Process user registration via AJAX
*
* A custom user registration process that listens for a
* specific type POST request that will create a new user
* on the blog.
*
* @action wp_ajax_nopriv_fjarrett_user_registration
@fjarrett
fjarrett / gist:1c122226e56e6f352b4e
Last active August 29, 2015 14:11
Custom user registration form
<form method="post">
<p>
<label for="user_login">Username</label>
<input type="text" name="user_login" id="user_login" placeholder="Username" required>
</p>
<p>
<label for="user_pass">Password</label>
<input type="password" name="user_pass" id="user_pass" minlength="12" placeholder="Password" autocomplete="off" required>
@fjarrett
fjarrett / gist:2ecec35b53641e672743
Last active August 29, 2015 14:11
Custom user registration process
<?php
/**
* Process user registration
*
* A custom user registration process that listens for a
* specific type POST request that will create a new user
* on the blog.
*
* @action wp
@Magnacarter
Magnacarter / .bash_profile
Last active November 1, 2022 19:32
Bash profile with great shortcuts.
source ~/.profile
# ------------------------------------------------------------
# Set paths
# ------------------------------------------------------------
export PATH="/usr/local/bin:$PATH"
export PATH="$PATH:$HOME/.composer/vendor/bin"
export PATH=~/.npm-global/bin:$PATH
# ------------------------------------------------------------