Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike iLL Kilmer MikeiLL

View GitHub Profile
View Playing with SerialAPI
// -----------------------
// TypeScript [2.6.2]
// -----------------------
import MSeriesReceiverParser from './mSeriesReceiverParser'
const RECEIVER_VENDOR_ID = 0x0483
const RECEIVER_PRODUCT_ID = 0x5740
const DEVICE_NAME = 'USB Multi-Bike Reciever'
View dmesg
Password:
(None)
ARPT: 112558.838864: CNT(rts_tx)=0 CNT(frag_tx_cnt)=7 CNT(cts_rx_cnt)=0
ARPT: 112558.838868: DequeueTime: 0x4ab2a000 LastTxTime: 0x38dba137 PHYTxErr: 0x0000 RxAckRSSI: 0x0000 RxAckSQ: 0x0000
ARPT: 112558.838879: Raw[0] 1 Valid
ARPT: 112558.838882: [2] 0 IM
ARPT: 112558.838885: [3] 0 PM
ARPT: 112558.838887: [7-4] 0 Suppr
ARPT: 112558.838889: [14:8] 1 Ncons
ARPT: 112558.838891: [15] 0 Acked
View wp-events-plugin.com filters
<?php
add_filter( 'em_events_build_sql_conditions', 'my_em_scope_conditions',1,2);
function my_em_scope_conditions($conditions, $args){
if( !empty($args['scope']) && $args['scope']=='today-upcoming' ){
$start_date = date('Y-m-d',current_time('timestamp'));
$end_date = date('Y-m-d',current_time('timestamp'));
$start_time = date('H:i',current_time('timestamp'));
$end_time = '23:59';
View Disable Event Espresso
<?php
/*
Plugin Name: Disable Event Espresso
Plugin URI: http://www.mzoo.org
Description: Disables event espresso plugin files from calls to all but specified pages
Author: mZoo/Mike iLL
Version: 1.0
Author URI: http://www.mzoo.org
*/
@MikeiLL
MikeiLL / convert_svg_to_pdf.sh
Last active Oct 30, 2019 — forked from lisaah/convert_svg_to_pdf.sh
Simple shell script to convert all .svg in directory to .pdf
View convert_svg_to_pdf.sh
# Dependency:
# sudo apt-get install librsvg2-bin
# or brew install librsvg
find . -type f -name "*.svg" -exec bash -c 'rsvg-convert -h 800 "$0" > "$0".png' {} \;
@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,