Skip to content

Instantly share code, notes, and snippets.

Mike iLL Kilmer MikeiLL

View GitHub Profile
@MikeiLL
MikeiLL / url_check.py
Last active Mar 12, 2019
Check if a URL is valid and points to a live site or not.
View url_check.py
def valid_url(url):
if (url.lower() == 'none') or (url == ''):
return False
try:
s = requests.Session()
a = requests.adapters.HTTPAdapter(max_retries=5)
s.mount(url, a)
resp = s.head(url)
return resp.ok
except requests.exceptions.MissingSchema:
View WP Category Walker with Image
<?php
/**
* Walker Class for List Category which also pulls in image from ACF Field
* source: https://wordpress.stackexchange.com/a/170603/48604
*
*/
class List_Category_Walker extends Walker_Category {
@MikeiLL
MikeiLL / gist:0a543cc94efe5c8211c21616118d4db2
Created Oct 18, 2018
Apple Script to Email a bunch of people, not too fast, though.
View gist:0a543cc94efe5c8211c21616118d4db2
set myMessage to "I'm cleaning up our mailing list. Please hit me back (or go to our site) if you want to be on the new one.
Thanks and I hope you are doing wonderfully.
Many blessings, Mike.
http://www.madhappy.com
"
set mySubject to "New MadhaPPy email list"
View ip tables output
sudo iptables -L -n
Chain INPUT (policy DROP)
target prot opt source destination
f2b-ssh tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22
f2b-sshd tcp -- 0.0.0.0/0 0.0.0.0/0 multiport dports 22
DROP all -- 0.0.0.0/0 0.0.0.0/0 ctstate INVALID
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
LOG all -- 0.0.0.0/0 0.0.0.0/0 recent: UPDATE seconds: 3600 name: badguys side: source mask: 255.255.255.255 limit: avg 3/hour burst 5 LOG flags 0 level 4 prefix "iptables-recent-badguys: "
DROP all -- 0.0.0.0/0 0.0.0.0/0 recent: UPDATE seconds: 3600 name: badguys side: source mask: 255.255.255.255
View Using a Logged State Object
(function ($) {
$(document).ready(function ($) {
var mz_mbo_state = {
logged: mz_mindbody_schedule.loggedMBO, // from php
html: undefined,
target: undefined,
siteID: undefined,
nonce: undefined,
View convert googleDoc to CSV
"""
Import Google Doc and export to CVS formatted for WP import.
Python3
First use Requests to get the file as recommended: http://www.madhur.co.in/blog/2016/05/13/google-docs-spreadsheet.html
Check to make sure that the file headers are what we expect and if not, exit.
If headers do match, create rows in the new file, matching the needed columns with those from the import.
@MikeiLL
MikeiLL / acf-polylang.php
Created Apr 25, 2018 — forked from thierrypigot/acf-polylang.php
Add polylang support to ACF fields group
View acf-polylang.php
<?php
add_filter('pll_get_post_types', 'wearewp_add_acf_pll', 10, 2);
function wearewp_add_acf_pll( $post_types, $is_settings ) {
$post_types[] = 'acf-field-group';
return $post_types;
}
@MikeiLL
MikeiLL / composer-private-package-github-token.md
Created Apr 10, 2018 — forked from jeffersonmartin/composer-private-package-github-token.md
Generate a GitHub Personal Access Token for Private Composer Packages
View composer-private-package-github-token.md

Generate a GitHub Personal Access Token for Private Composer Packages

If you're trying to load a private repository with Composer/Laravel, we'll need to generate a GitHub Personal Access Token (similar to OAuth token) to access the repository during a composer install without entering credentials.

If you have used other Github packages from {my-org} before, you may be able to skip this step.

  1. Visit https://github.com/settings/tokens.

  2. Click Generate new token.

View Pupulate Donor Perfect Checkboxes Based on Query String Parameter
<script>
// Get the parameter from the Query String
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
@MikeiLL
MikeiLL / Useful WP Plugins
Last active Apr 26, 2018
Some go-to wordpress plugins
View Useful WP Plugins
simply-show-hooks
contact-form-7
contact-form-7-honeypot
custom-post-type-ui
debug-bar
duplicate-post
get-tweets-in-php
tinymce-advanced
tailor
really-simple-csv-importer
You can’t perform that action at this time.