Skip to content

Instantly share code, notes, and snippets.

View patrickbjohnson's full-sized avatar

Patrick patrickbjohnson

View GitHub Profile
.joe {
color: green;
}
... on ContentfulContentBlockGrid {
id
identifier
sectionTitle
displayCategory
contentBlocks {
id
body {
body
}
@patrickbjohnson
patrickbjohnson / paramHelper.js
Last active April 1, 2019 22:58
params helper
import _ from 'underscore';
/**
*
* @param {string} term
* Checks if the term exists or not. Primary a helper function.
* A term can be a full query parameter or just the name
* EX: 'thank-you' or 'thank-you=true'
*
*/
export const getUrlParam = term => {
@patrickbjohnson
patrickbjohnson / wp_mail_stuff.php
Created November 4, 2015 14:48
wp email when post is published
function test_post_publish( $post_id, $post, $update ) {
if (get_post_type( $post_id ) != 'report') return;
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return;
$post_status = get_post($post_id)->post_status;
if ($post_status != 'publish') return;
// If this is just a revision, don't send the email.
if ( wp_is_post_revision( $post_id ) ) return;
$post_title = get_the_title( $post_id );
@patrickbjohnson
patrickbjohnson / user-settings.json
Created September 8, 2015 14:50
Sublime Settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/Seti_UI/Scheme/Seti.tmTheme",
"font_options":
[
"gray_antialias"
],
"font_size": 18,
"ignored_packages":
@patrickbjohnson
patrickbjohnson / SassMeister-input-HTML.html
Created August 31, 2015 01:52
Generated by SassMeister.com.
<div class="portfolio-item">thing</div>
<div class="portfolio-item">thing</div>
<div class="portfolio-item">thing</div>
@patrickbjohnson
patrickbjohnson / SassMeister-input-HTML.html
Created August 30, 2015 00:53
Generated by SassMeister.com.
<div class="portfolio-item">thing</div>
<div class="portfolio-item">thing</div>
<div class="portfolio-item">thing</div>
@patrickbjohnson
patrickbjohnson / SassMeister-input.scss
Created September 30, 2014 01:45
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$font-size: 12;
@function em($target, $context: $font-size ){
@return ($target / $context) * 1em;
}
@patrickbjohnson
patrickbjohnson / SassMeister-input.scss
Last active August 29, 2015 14:06
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
$icon-names: (strategy '\e002') (twitter '\e003')(github '\e004');
@each $name, $pua in $icon-names {
@patrickbjohnson
patrickbjohnson / SassMeister-input.scss
Created September 19, 2014 21:18
Generated by SassMeister.com.
// ----
// Sass (v3.4.4)
// Compass (v1.0.1)
// ----
@function random-decimal($ceil){
$decimal: random($ceil) * 0.1;
@return $decimal;
}