Skip to content

Instantly share code, notes, and snippets.

View MikeGillihan's full-sized avatar
🏠
Working from home

Mike Gillihan MikeGillihan

🏠
Working from home
View GitHub Profile
# -----------------------------------------------------------------
# .gitignore for WordPress
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/MikeGillihan/9bd7610afd4b594d31ee12b81ac88687/raw/.gitignore
# to download this file
#
# By default all files are ignored. You must whitelist any
# mu-plugins, plugins, or themes you want to include in the repo.
#
...
/**
* Get all GiveWP donation forms
*
* @return array List of GiveWP forms
*/
public function list_forms() {
$list = array( '' => __( 'Select a Form', GoodModules::$text_domain ) );
$forms = get_posts( array(
@MikeGillihan
MikeGillihan / cloudSettings
Last active November 8, 2019 23:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-11-08T23:07:53.840Z","extensionVersion":"v3.4.3"}
# Stop syncing a node_modules directory (via symlink)
noicloud() {
mv node_modules node_modules.nosync
ln -s node_modules.nosync/ node_modules
}
alias nocloud=noicloud
@MikeGillihan
MikeGillihan / HeartThis.php
Created December 26, 2017 22:15
Filter the output of the HeartThis for the front page
add_filter( 'heart_this_hearts', 'custom_heart_this_hearts' );
/**
* Filter the output of the HeartThis for the front page
*
* @param $output
* @param bool $post_id
*
* @return string
*/
function custom_heart_this_hearts( $output, $post_id = false ) {
@MikeGillihan
MikeGillihan / CopyAsanaTasks.php
Created December 15, 2016 04:06 — forked from AWeg/CopyAsanaTasks.php
main changes: - Asana has own SSL cert -> had to add to lines of code - copies subtasks and up to 11 subtasks of subtasks - copies tags -> only tagnames not followers/descriptions
function asanaRequest($methodPath, $httpMethod = 'GET', $body = null)
{
$apiKey = 'ASANA_API_KEY_HERE'; /// Get it from http://app.asana.com/-/account_api
$url = "https://app.asana.com/api/1.0/$methodPath";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC ) ;
curl_setopt($ch, CURLOPT_USERPWD, $apiKey);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
{
"bold_folder_labels": true,
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"caret_style": "phase",
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"fade_fold_buttons": false,
"font_face": "Source Code Pro",
"font_options":
@MikeGillihan
MikeGillihan / hide-themes.php
Last active January 30, 2016 22:16
Hide themes in theme picker
<?php
add_filter( 'wp_prepare_themes_for_js', 'PE_hide_themes' );
/**
* Prevents themes from being displayed on the Theme picker
* @param array $themes Available themes
*/
function PE_hide_themes( $themes ) {
// List of themes to be hidden
$hidden_themes = array(
@MikeGillihan
MikeGillihan / link.html
Created January 9, 2016 18:39
WP Customizer Direct Link
@MikeGillihan
MikeGillihan / javascript_resources.md
Last active September 14, 2015 22:14 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage