Skip to content

Instantly share code, notes, and snippets.

View robertdevore's full-sized avatar
🐺
#LoneWolfLifestyle

Robert DeVore robertdevore

🐺
#LoneWolfLifestyle
View GitHub Profile
@ejntaylor
ejntaylor / functions.php
Created November 11, 2014 12:44
Get the icon image from the WordPress Plugin API
<?php
$bp_filetypes = array('128x128.png','128x128.jpg','256x256.png','256x256.jpg','logo.svg');
foreach ($bp_filetypes as $bp_filetype) {
$logo_item = $bp_filetype;
$url = 'http://ps.w.org/' . $pb_plugin_item[plugin_slug] . '/assets/icon-' . $logo_item;
//echo $url;
@whatnickcodes
whatnickcodes / chrome-cache-recovery.js
Last active November 23, 2016 05:32
Quick and dirty script to recover images from chrome cache. Just paste this into your console to automatically download all Scotch.io cached images
// Open chrome://cache/ and paste the following script in the console. Feel free to edit the filter variable
var filter = /cask\.scotch\.io(.)*\.(jpg|jpeg|png|gif)/g;
/*! jQuery v2.1.4 | (c) 2005, 2015 jQuery Foundation, Inc. | jquery.org/license */
!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.4",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);retu
@mariodian
mariodian / openbazaar
Last active December 5, 2016 10:33
OpenBazaar sysv service
#! /bin/bash
### BEGIN INIT INFO
# Provides: openbazaar
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/stop openbazaar server
# Description: Start the openbazaar server as a specified user
### END INIT INFO
@biswarupadhikari
biswarupadhikari / paypalCurrencySelectDropDown.html
Last active May 19, 2017 15:47
Paypal Currency Select Drop Down
<select name="currency_code">
<option value="">Select Currency</option>
<option value="AUD">Australian Dollar</option>
<option value="BRL">Brazilian Real </option>
<option value="CAD">Canadian Dollar</option>
<option value="CZK">Czech Koruna</option>
<option value="DKK">Danish Krone</option>
<option value="EUR">Euro</option>
<option value="HKD">Hong Kong Dollar</option>
<option value="HUF">Hungarian Forint </option>
@ahmadawais
ahmadawais / AA-Git-Commit-Log.md
Last active May 5, 2018 16:29
AA Git Commit Log
@bentasm1
bentasm1 / functions.php
Last active August 7, 2018 23:13
WC Vendors Pro - Commission Rate depending on how much a product sells for
/* WC Vendors Pro -- No % for commission, just a tiered fee structure */
add_filter( 'wcv_commission_rate', 'my_wcv_commission_rate', 10, 5 );
function my_wcv_commission_rate( $commission, $product_id, $product_price, $order, $qty ) {
// First, reduce price to qty1 to do calculations
$product_price = $product_price / $qty;
// Second, run through the price and apply the right commission fee
if ( $product_price > 48.99 ) {
$commission_fee = 3.36;
@trepmal
trepmal / user-meta-upload.php
Created June 1, 2012 20:32
User Meta Upload
<?php
/*
Plugin Name: User Meta Upload
Plugin URI: http://trepmal.com
Description: Add a file-upload form to the user edit profile page
Version: 0.1
Author: Kailey Lampert
Author URI: http://kaileylampert.com
Copyright (C) 2012 Kailey Lampert
@dbranes
dbranes / functions.php
Last active September 2, 2018 14:58
WordPress: Ajax (POST) to update post meta key
/**
* Update post meta key via ajax POST request
*
* @see http://wpquestions.com/question/showLoggedIn/id/10604
*
* On the remote site send a POST request to:
*
* http://example.tld/wp-admin/admin-ajax.php?action=update_post_meta
*
* with the following payload:
@lukecav
lukecav / functions.php
Last active September 4, 2018 03:59
Redirect to shop if cart is empty in WooCommerce
function cart_empty_redirect_to_shop() {
global $woocommerce;
if ( is_page('cart') and !sizeof($woocommerce->cart->cart_contents) ) {
wp_redirect( get_permalink( wc_get_page_id( 'shop' ) ) ); exit;
}
}
add_action( 'wp_head', 'cart_empty_redirect_to_shop' );
/**
* Block dependencies
*/
import icon from './icon';
import SelectTeam from '../select-team';
//import './style.scss';
import './editor.scss';
/**
* Internal block libraries