Skip to content

Instantly share code, notes, and snippets.

@psteinweber
psteinweber / functions.php
Created Jun 18, 2018 — forked from luizbills/example.php
Google Tag Manager in Elementor Canvas
View functions.php
// 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 Jun 13, 2018
Embed Responsively
View iframe.html
<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 Jun 13, 2018
Create symbolic link for network drive (add this to login items)
View gist:2cd6e21af719ef705afe45baac60888b
ln -s /Volumes/Name ~/Desktop
@psteinweber
psteinweber / template.html
Created Mar 24, 2017 — 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.
View template.html
<!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 {
View mailchimp-single-line-fname-email.html
<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;">
View mailchimp-single-line-email.html
<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 Aug 29, 2015
Register custom images sizes in wordpress functions.php and make them accessible via the media manager. #wordpress #php
View Register image sizes.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 Aug 29, 2015
Remove a class on devices > Android 2.3 #js #android
View Detect android.js
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');
}
}
View Font Awesome checkbox.css
label {
font-weight: 400;
}
label p {
margin-top: -40px;
margin-left: 40px;
}
input[type="checkbox"] {
@psteinweber
psteinweber / functions.php
Last active Jan 3, 2016
#wordpress #thesis Custom header logo
View functions.php
/* ==========================================================================
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');
You can’t perform that action at this time.