Skip to content

Instantly share code, notes, and snippets.

View interactiveRob's full-sized avatar

Rob Kirkner interactiveRob

View GitHub Profile
@interactiveRob
interactiveRob / hs-subject.html
Last active April 5, 2018 18:45
Hubspot Dynamic Subject Line
<!-- Hard Coded Subject Line for Client Approval-->
<table bgcolor="#ffffff" width="100%" style="color: #ffffff;max-width:100%; min-width: 320px;" cellspacing="0" cellpadding="0">
<tr>
<td style="padding: 40px 30px; width: 100%; max-width: 100%;">
<table align="center" width="100%" style="color: #ffffff;max-width:650px; min-width: 320px;" cellspacing="0" cellpadding="0">
<tr>
<td style="text-align: left; font:16px/18px Arial, Helvetica, sans-serif; color:#666666;">
<b>Subject:</b> {{ content.subject }}
</td>
</tr>
@interactiveRob
interactiveRob / class-list.js
Last active March 5, 2018 23:05
DOM - get list of classes, convert to CSS selector
jQuery(function($){
var classes = [];
$('.page-id-x [class]').each(function(){
$($(this).attr('class').split(' ')).each(function() {
if (this.length>0 && $.inArray(this.valueOf(), classes)==-1) {
classes.push( '.' + this.valueOf() );
}
});
});
console.log("LIST START\n\n"+ classes.join('{}' + '\n')+"\n\nLIST END");
@interactiveRob
interactiveRob / acf-name-list
Last active March 3, 2020 22:52
Get a list of ACF names from wordpress post editor console
var names = [];
document.querySelectorAll('.acf-field').forEach(function(field){
names.push( field.dataset.name );
});
console.log("LIST START\n\n"+ names.join('\n')+"\n\nLIST END");
@interactiveRob
interactiveRob / input-focus.css
Last active February 19, 2018 15:21
Remove user-agent blue border focus styling on input elements CSS
//-----------------------Remove User Agent Focus Styling-----------------------
input:focus, textarea, [contenteditable="true"]:focus {
outline: none;
}
@interactiveRob
interactiveRob / set-timeout.js
Last active March 9, 2018 20:27
run function after a delay
setTimeout(function(){
//do something after 600 milliseconds
}, 600);
@interactiveRob
interactiveRob / gist:1e7495dd50155e88dc7643388b225714
Last active April 12, 2018 15:56
Easy PHP check Day of Week
<?php
$day = date('D');
if($day == 'Mon' || $day == 'Wed' || $day == 'Fri'):
//do something
else:
endif;
?>
@interactiveRob
interactiveRob / .htaccess
Created April 18, 2018 14:26
.htaccess forbid all
Order deny,allow
Deny from all
@interactiveRob
interactiveRob / prevent clicks
Created May 1, 2018 16:45
jQuery prevent all link clicks on a page
$('a').each(function(){
$this = $(this);
$this.click(function(e){
e.preventDefault();
});
});
@interactiveRob
interactiveRob / basic_wp_enqueue.php
Created July 6, 2018 19:50
Basic WP enqueue scripts and Styles
/**
* Proper way to enqueue scripts and styles.
*/
function wpdocs_theme_name_scripts() {
wp_enqueue_style( 'style-name', get_stylesheet_uri() );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'wpdocs_theme_name_scripts' );
@interactiveRob
interactiveRob / mac-terminal.md
Last active November 16, 2021 04:29
Useful Mac Terminal Commands

Kill Processes

  • Bluetooth -- sudo killall blued
  • Webcam -- sudo killall AppleCameraAssistant; sudo killall VDCAssistant
  • Finder -- sudo killall Finder
  • Sound -- sudo killall coreaudiod
  • Fix Eternal Harddrive mounting issue -- sudo pkill -f fsck

Find Application Serial Keys

Panic Coda -- defaults read com.panic.Coda2 SerialNumber