Skip to content

Instantly share code, notes, and snippets.

Paul Ryley pryley

Block or report user

Report or block pryley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pryley
pryley / optionsframework_on_validate-example.php
Created Dec 1, 2012
Allow Facebook App ID/Secret verification with Options Framework
View optionsframework_on_validate-example.php
/** OPTIONS FRAMEWORK - FACEBOOK VERIFICATION
/ ================================================================================ */
// Verify Facebook App ID and Secret
add_action( 'admin_notices', 'pr_facebook_verify' );
function pr_facebook_verify() {
if ( get_option( 'fb_token' ) != '' ) {
$screen = get_current_screen();
@pryley
pryley / gist:7746379
Last active Dec 29, 2015
Frontend google analytics snippet
View gist:7746379
<?php
try {
if( $access_token ) {
// Set access token
$client->setAccessToken( $access_token );
// Assign variables
$slug_array = $filter_path_array = $filter_array = $data = array();
@pryley
pryley / Simple Custom Post Order - hook
Last active Aug 29, 2015
This adds a hook to the `Simple Custom Post Order` plugin `update_menu_order()` function.
View Simple Custom Post Order - hook
function update_menu_order() {
global $wpdb;
parse_str( $_POST['order'], $data );
if ( is_array( $data ) ) {
$id_arr = array( );
foreach ( $data as $key => $values ) {
View gruntfile
module.exports = function( grunt )
{
'use strict';
grunt.initConfig( {
clean: {
dist: [
'public/assets/css/*',
]
},
@pryley
pryley / UltimateMembersMods
Created May 4, 2015
This Wordpress plugin adds custom features and modifications to the Ultimate Member plugin family.
View UltimateMembersMods
<?php
/**
* Plugin Name: Ultimate Member Modifications
* Plugin URI: http://geminilabs.io
* Description: This plugin adds custom features and modifications to the Ultimate Member plugin family.
* Version: 1.0.0
* Author: Gemini Labs
* Author URI: http://geminilabs.io
* License: MIT License
*/
View gist:eb6e74dce9f38e5598b2
#!/bin/bash
THEPATH=${1%/}
THESIZE=$2
if [ -z $THEPATH ];
then THEPATH="/"
fi
[[ -n "$2" ]] || { echo -en "\n usage: getsize [path] [size (the min size in Mb)]\n example: getsize ~/Downloads 13\n\n"; exit 0 ; }
@pryley
pryley / deploy.rb
Created Feb 6, 2016
Capistrano global WP deploy config
View deploy.rb
set :application, 'myapp'
set :repo_url, "git@bitbucket.org:geminilabs/#{fetch(:application)}.git"
SSHKit.config.command_map[:composer] = '/srv/users/serverpilot/bin/composer'
set :wpcli, '/srv/users/serverpilot/bin/wp'
# Branch options
# Prompts for the branch name (defaults to current branch)
#ask :branch, -> { `git rev-parse --abbrev-ref HEAD`.chomp }
View print-r.php
<?php
/**
* Plugin Name: print__r()
* Description: print_r() alternative
* Version: 1.0.0
* Author: Paul Ryley
* Author URI: http://geminilabs.io
*/
/**
@pryley
pryley / delete-from-repo.md
Created May 6, 2016 — forked from scy/delete-from-repo.md
How to delete a file from a Git repository, but not other users' working copies
View delete-from-repo.md

How to delete a file from a Git repository, but not other users' working copies

Suppose you have, by mistake, added your IDE's project folder (you know, these .idea folders with all kinds of local paths and configuration data and settings in it) to the Git repository of your project. (We're talking about a whole folder here, but the same rules apply to individual files as well.)

Of course, you only realize that two days after the fact and have already pushed it, and your colleagues have already pulled it. They use the same IDE as you do, so whenever they change a setting or fix paths, they can either

  • commit that, causing nasty merge conflicts for you and others or
  • ignore the changes and carry around a modified file until the end of time without ever committing it.

Why .gitignore won't help

View keybase.md

Keybase proof

I hereby claim:

  • I am pryley on github.
  • I am pryley (https://keybase.io/pryley) on keybase.
  • I have a public key ASCIgelMI6dpyCg15fHavShFYmjSZ3ERl3GebPxokuGHOwo

To claim this, I am signing this object:

You can’t perform that action at this time.