Skip to content

Instantly share code, notes, and snippets.


Lawrence Brown lawrencebrown

View GitHub Profile
lawrencebrown / get_edit_post_link.php
Created Apr 8, 2020
Used at the bottom of posts for logged in users to edit
View get_edit_post_link.php
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
/* translators: %s: Name of current post. Only visible to screen readers */
__( 'Edit <span class="screen-reader-text">%s</span>', 'larryworld' ),
'span' => array(
lawrencebrown / the-content-wp-linlk-pages.php
Created Apr 8, 2020
Wordpress the_content filed, page links at bottom of post
View the-content-wp-linlk-pages.php
<div class="entry-content">
wp_link_pages( array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'larryworld' ),
'after' => '</div>',
) );
lawrencebrown / gets-array-and-echo.php
Last active Mar 21, 2020
Gets the_field and stores its arrays, then echo inserts them using square brackets.
View gets-array-and-echo.php
<?php $button = get_field('name_of_field'); ?>
<a href="<?php echo $button['url']; ?>"
target="<?php echo $button['target']; ?>">
<?php echo $button['title']; ?>
View New Mac Terminal Preference Changes
<-- Turns off bouncing applications in the dock -->
defaults write no-bouncing -bool TRUE;
killall Dock
<-- Change location of Screenshots folder - drag location from finder after the word location -->
defaults write location
killall SystemUIServer
View terminal commands
Renaming a mac user
sudo scutil --set ComputerName "newname"
sudo scutil --set LocalHostName "newname"
sudo scutil --set HostName "newname"
Then: Flush the DNS cache by typing: dscacheutil -flushcache
Then: Restart your Mac
View gist:6947808
<script type="text/javascript">
Froogaloop(this).addEvent('ready', ready);
function ready(playerID){
Froogaloop(playerID).addEvent('play', function(data) {play(playerID);});
function play(playerID){
alert(playerID + " is playing!!!");
View gist:6113398
<script type="text/javascript">
$(document).ready(function() {
$('body').css('display', 'none');
$('a').click(function() {
newLocation = this.href;
$('body').fadeOut(300, newpage);
function newpage() {
View gist:5690465
var adjustMenu = function() {
if (ww < 768) {
$(".toggleMenu").css("display", "inline-block");
if (!$(".toggleMenu").hasClass("active")) {
} else {
$(".nav li").unbind('mouseenter mouseleave');
$(".nav li a.parent").unbind('click').bind('click', function(e) {
View gist:5214397
<div class="pinterest">
<a href="{{ shop.url }}{{ product.url }}&media={{ product.featured_image | product_img_url: 'large' }}" class="pin-it-button" count-layout="horizontal">Pin It</a>
<script type="text/javascript" src=""></script>