Skip to content

Instantly share code, notes, and snippets.

View jdsteinbach's full-sized avatar
💭
💻

James Steinbach jdsteinbach

💭
💻
View GitHub Profile
@jdsteinbach
jdsteinbach / SassMeister-input-HTML.html
Created August 24, 2015 23:12
Generated by SassMeister.com.
<div class="container">
<div class="content">Content</div>
<div class="sidebar">Sidebar</div>
</div>
@jdsteinbach
jdsteinbach / SassMeister-input-HTML.html
Created August 24, 2015 23:11
Generated by SassMeister.com.
<div class="container">
<div class="content">Content</div>
<div class="sidebar">Sidebar</div>
</div>
@jdsteinbach
jdsteinbach / SassMeister-input.scss
Created August 5, 2015 22:55
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$config: (
margin: 20px,
padding: 10px 0,
color: red
);
@jdsteinbach
jdsteinbach / SassMeister-input.scss
Created August 3, 2015 22:46
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$green: #6AB86A;
div {
&::after {
content: #{lighten($green,10%)};
@jdsteinbach
jdsteinbach / wp-template.md
Last active August 29, 2015 14:25
WP Template Patterns: `sprint()` & `printf()`

Documentation

If you're not familiar with these PHP functions, read this documentation: printf() / sprintf().

Benefits of s/printf()

Cleaner Validation

All template code requires validation: if a variable (or array key/value) doesn't exist or doesn't contain data, we don't want to print empty HTML. Writing "pure" PHP with s/printf() for markup makes validation logic easier to see and shorter to write.

@jdsteinbach
jdsteinbach / index.php
Last active August 29, 2015 14:24
Self-Hosted Faux-API Script for Cotton Bureau Shirt Sales Data
<?php
header('Content-Type: application:json');
header("Access-Control-Allow-Origin: *");
/* CONFIG - EDIT THESE VARIABLEs TO YOUR HEART'S CONTENT */
$shirt_url = 'https://cottonbureau.com/products/your-shirt';
$cache_duration = 60; // in minutes
$notification_email = 'test@test.com';
@jdsteinbach
jdsteinbach / SassMeister-input-HTML.html
Created July 1, 2015 15:41
Generated by SassMeister.com.
<p class="output">
The output number is
</p>
@jdsteinbach
jdsteinbach / SassMeister-input-HTML.html
Created July 1, 2015 15:41
Generated by SassMeister.com.
<p class="output">
The output number is
</p>
@jdsteinbach
jdsteinbach / SassMeister-input.scss
Last active August 29, 2015 14:23
Generated by SassMeister.com.
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$future-proof: true;
$future-properties: rotate scale translate;
@function generate-single-property($arg) {
$start-pos: str-index($arg, '(');
@jdsteinbach
jdsteinbach / SassMeister-input-HTML.jade
Created June 23, 2015 15:33
Generated by SassMeister.com.
.brand-red I'm red!
.brand-blue I'm blue!
.brand-orange I'm orange!
.brand-yellow I'm yellow!