Skip to content

Instantly share code, notes, and snippets.

@psteinweber
psteinweber / functions.php
Created June 18, 2018 12:45 — forked from luizbills/example.php
Google Tag Manager in Elementor Canvas
// please, replace the GTM-XXXX
add_action( 'wp_head', 'custom_add_google_tag_manager_head', 0 );
function custom_add_google_tag_manager_head () {
?>
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
@psteinweber
psteinweber / iframe.html
Created June 13, 2018 07:21
Embed Responsively
<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='http://alistapart.com/article/responsive-web-design/' style='border:0'></iframe></div>
@psteinweber
psteinweber / gist:2cd6e21af719ef705afe45baac60888b
Created June 13, 2018 07:13
Create symbolic link for network drive (add this to login items)
ln -s /Volumes/Name ~/Desktop
@psteinweber
psteinweber / template.html
Created March 24, 2017 17:12 — forked from tinabeans/template.html
A super-barebones single-column responsive email template, assuming a max-width of 540px. Read about it on the Fog Creek blog.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Single-Column Responsive Email Template</title>
<style>
@media only screen and (min-device-width: 541px) {
.content {
<div id="mc_embed_signup">
<!-- replace the line below -->
<form action="//yourformactionurlhere" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<!-- replace the line above -->
<div class="mc-field-group" style="display:inline;">
<input type="text" value="" name="FNAME" class="" id="mce-FNAME" placeholder="Your First Name">
</div>
<div class="mc-field-group" style="display:inline;">
<div id="mc_embed_signup">
<!-- replace the line below -->
<form action="[your-form-action-url-here]" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
<!-- replace the line above -->
<div class="mc-field-group" style="display:inline;">
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder ="Your Email" style="display:inline;">
</div>
@psteinweber
psteinweber / Register image sizes.php
Last active August 29, 2015 13:56
Register custom images sizes in wordpress functions.php and make them accessible via the media manager. #wordpress #php
/* ==========================================================================
Register image sizes
========================================================================== */
if ( function_exists( 'add_image_size' ) ) {
add_image_size( 'blog-featured', 940, 330, true ); // cropped
add_image_size( 'testimonial-thumb', 100, 100, false ); // not cropped
}
@psteinweber
psteinweber / Detect android.js
Last active August 29, 2015 13:56
Remove a class on devices > Android 2.3 #js #android
var ua = navigator.userAgent;
if( ua.indexOf("Android") >= 0 )
{
var androidversion = parseFloat(ua.slice(ua.indexOf("Android")+8));
if (androidversion < 2.3)
{
$('.class').css('display','none');
}
}
@psteinweber
psteinweber / Font Awesome checkbox.css
Last active January 4, 2016 02:39
#fontawesome checkboxes
label {
font-weight: 400;
}
label p {
margin-top: -40px;
margin-left: 40px;
}
input[type="checkbox"] {
@psteinweber
psteinweber / functions.php
Last active January 3, 2016 18:29
#wordpress #thesis Custom header logo
/* ==========================================================================
Custom header logo
========================================================================== */
function custom_header() { ?>
<a href="/"><img src="/media/image.jpg" alt="alt text"></a>
<?php
}
remove_action('thesis_hook_header', 'thesis_default_header');