Skip to content

Instantly share code, notes, and snippets.

View benallfree's full-sized avatar

Ben Allfree benallfree

  • Reno, NV
View GitHub Profile
@benallfree
benallfree / masonry.patch
Created June 2, 2015 14:35
Pretty Pinterest Pins Masonry layout patch
Index: pretty-pinterest-pins.php
===================================================================
--- pretty-pinterest-pins.php (revision 1172836)
+++ pretty-pinterest-pins.php (working copy)
@@ -4,7 +4,7 @@
* @version 1.3
*/
/*
-Plugin Name: Pretty Pinterest Pins
+Plugin Name: Pretty Pinterest Pins Custom
@benallfree
benallfree / open-webinspector.applescript
Created October 30, 2015 13:27 — forked from uniphonic/open-webinspector.applescript
This is an AppleScript to automatically compile Cordova and open the Safari debugger. You can also use Automator to assign this script to a shortcut key.
#!/usr/bin/osascript
# AppleScript to automatically compile Cordova and open the Safari debugger
set maxWait to 20
set hasClicked to false
set x to 0
set device_name to "iOS Simulator"
# delay fix for yosemite
@benallfree
benallfree / gist:5282099
Created March 31, 2013 21:37
Demo of WP media uploader in metabox
jQuery(function($) {
var element_clicked = false;
$('#my-button').click(function() {
formfield = jQuery('#my-button').attr('name');
tb_show('', 'media-upload.php?type=image&TB_iframe=true');
element_clicked = true;
return false;
@benallfree
benallfree / nextend-facebook-connect.diff
Last active December 31, 2015 02:09
Patches nextend FB to use login_redirect filter
Index: nextend-facebook-connect.php
===================================================================
--- nextend-facebook-connect.php (revision 819180)
+++ nextend-facebook-connect.php (working copy)
@@ -132,13 +132,13 @@
AND type = \'fb\'', $user_info->ID));
set_site_transient($user_info->ID.'_new_fb_admin_notice',__('Your Facebook profile is successfully unlinked from your account.', 'nextend-facebook-connect'), 3600);
}
- new_fb_redirect();
+ new_fb_redirect($user_info);
@benallfree
benallfree / easy-theme-and-plugin-upgrades.diff
Created December 21, 2013 14:15
Zip files which do not contain a bare parent directory entry were not being detected correctly.
Index: modify-installer.php
===================================================================
--- modify-installer.php (revision 826618)
+++ modify-installer.php (working copy)
@@ -134,7 +134,7 @@
$contents = $archive->listContent();
foreach ( (array) $contents as $content ) {
- if ( preg_match( '|^([^/]+)/$|', $content['filename'], $matches ) ) {
+ if ( preg_match( '|^([^/]+)/|', $content['filename'], $matches ) ) {
@benallfree
benallfree / bootstrap-and-responsive-laravel.md
Last active August 3, 2016 06:42
Add Bootstrap theme & responsive support to Laravel

Add bootstrapper to composer.json and follow setup instructions and documentation

"require": {
    "patricktalmadge/bootstrapper": "dev-develop"
}

Add to app/config/app.php providers:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/user/public_html
ErrorLog /home/user/public_html/error.log
CustomLog /home/user/public_html/access.log combined
<Directory /home/user/public_html>
Options Indexes FollowSymLinks
AllowOverride All
@benallfree
benallfree / trellis-tools.sh
Created July 15, 2017 01:18
Command line tools installation
# If you need HomeBrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Install Yarn
brew install yarn
# Install Hugo
brew install hugo
# Sublime command line shortcut
<div>*|FEEDBLOCK:http://ctoguy.com/feed.rss?pw=asdf|*<br />
*|FEEDITEMS:[$count=4]|*
<h4><a href="*|FEEDITEM:URL|*">*|FEEDITEM:TITLE|*</a></h4>
<div style="clear: both; word-break: keep-all"><a href="*|FEEDITEM:URL|*"><img src="*|FEEDITEM:ENCLOSURE_URL|*" style="border: 0px initial;
width: 250px;
margin: 0px;
border-radius: 3px;
float: left;
margin-right: 15px;
@benallfree
benallfree / setup.sh
Last active August 15, 2018 01:03
Ubuntu LAMP++ (Ubuntu 18.04.1 LTS / Apache / PHP 7.2 / Beanstalk / Certbot / git / composer / git-lfs)
#!/bin/bash
SSHPK="..."
MYSQLP="..."
MYSQLDB="..."
USERP="..."
ufw allow http
ufw allow https
ufw allow mysql
ufw allow ssh
echo y | ufw enable