Skip to content

Instantly share code, notes, and snippets.

@stevetrask
stevetrask / c-cookie.js
Created May 21, 2018 08:10
Cookie disclaimer
<div>
<input id="resources-input" placeholder="Search for products">
</div>
<div id="type-refinement">
</div>
UPDATE wp_posts SET `post_content` = REPLACE (`post_content`, 'src="http://www.your-site.com', 'src="https://www.your-site.com');
@mixin font-face($family, $filename, $font-weight: normal, $font-style: normal) {
@font-face {
font-family: "#{$family}";
src: url("/wp-content/themes/starkers/fonts/bookmania/#{$filename}.eot?#iefix") format("embedded-opentype"), url("/wp-content/themes/officialwatches/fonts/starkers/#{$filename}.woff") format("woff"), url("/wp-content/themes/starkers/fonts/#{$filename}.ttf") format("truetype");
font-weight: $font-weight;
font-style: $font-style;
}
}
@include font-face("bookmania", "bookmania-light", $font-weight: 100);
<?php
function checkRemoteFile($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(curl_exec($ch)!==FALSE)
{
<nav>
<ul>
<li class="c-nav_logo">
<a href="/"><img src="/img/logo-lrg.svg" alt="logo" /></a>
</li>
{% for nav in site.data.navigation %}
{% if nav.children != null %}
<li class="c-nav_dropdown-trigger">
<a href="{{ nav.href }}">{{ nav.title }}</a>
<ul class="c-nav_dropdown">
if($('#partner-form').length > 0) {
validator = $('#partner-form').validate({
errorPlacement: function(error, element) {
error.insertBefore(element.prev("label"));
},
rules: {
first_name: {
required: true
},
<?php $user = get_user_by( 'email', 'name@email.com' );
echo 'User is ' . $user->first_name . ' ' . $user->ID; ?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); echo '?' . filemtime( get_stylesheet_directory() . '/style.css'); ?>" type="text/css" media="screen, projection" />
@stevetrask
stevetrask / form.html
Created November 16, 2016 20:45
Formspree with ajax
<form id="sales-form" method='POST'>
<div class="c-mainform_group">
<div class="c-mainform_col">
<div>
<label for="name">Full name<sup>*</sup></label>
<input type="text" name="name" id="name" />
</div>
<div>
<label for="email">Email address<sup>*</sup></label>
<input type="email" name="email" id="email" />