Skip to content

Instantly share code, notes, and snippets.

Matthew MacGregor matthew-macgregor

Block or report user

Report or block matthew-macgregor

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
View ornament_order.json
{
"EntryID": 180767,
"Orders": [
{
"DropShipFlag": 1,
"FromAddressValue": 2,
"BackWriting": "SXYDNACG",
"OrderAttributes": [{ "AttributeUID": 96 }, { "AttributeUID": 545 }],
"OrderItems": [
{
@matthew-macgregor
matthew-macgregor / hide-admin.php
Created Dec 19, 2016
Hide the admin panel from users without certain capabilities.
View hide-admin.php
<?php
/**
* Disable admin bar on the frontend of your website
* for subscribers.
*/
function themeblvd_disable_admin_bar() {
if ( ! current_user_can('edit_posts') ) {
add_filter('show_admin_bar', '__return_false');
}
@matthew-macgregor
matthew-macgregor / ajaxy.php
Created Dec 19, 2016
A couple of quick WP-Ajax examples.
View ajaxy.php
<?php
/*
Plugin Name: Ajax Demo
Plugin URI:
Description: Yes, this is an ajaxy plugin.
Author: Matsuzine
Version: 1.0
Author URI:
*/
@matthew-macgregor
matthew-macgregor / smartquotes.py
Last active Aug 7, 2016 — forked from davidtheclark/dumb_to_smart_quotes.py
Convert dumb quotes to smart quotes in Python
View smartquotes.py
#!/usr/bin/env python3
"""
Inspired by : https://gist.github.com/davidtheclark/5521432
Converts dumb quotes to smart quotes, -- to EM_DASH and ... to ELLIPSES.
"""
import sys
import re
import os
@matthew-macgregor
matthew-macgregor / MainActivity.java
Created Nov 14, 2015
Android Volley Example (for Stackoverflow issue 33686054)
View MainActivity.java
package com.example.matthew.testvolleypost;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
@matthew-macgregor
matthew-macgregor / calibre-install.sh
Last active Dec 28, 2015
Alternate Calibre Install.sh for Linux
View calibre-install.sh
#/bin/bash
# Description
# ----------------------------------------------------------------------
# Installs the binary of the Calibre ebook software on Linux.
# https://github.com/kovidgoyal/calibre
#
# Tested only on Ubuntu version 15.10. If you run this on another
# version of Linux, let me know the results!
#
You can’t perform that action at this time.