Skip to content

Instantly share code, notes, and snippets.

View bloqhead's full-sized avatar

Daryn St. Pierre bloqhead

View GitHub Profile
@bloqhead
bloqhead / google-maps-decode.js
Last active November 17, 2016 15:33
Alter a map's marker location based on a human-readable address. This code needs to be repurposed, but here it is pulled raw from another project. In this example, the address is derived from the value of a text input. The context: a user went to a page and entered their address and zip. If their zip is not available in the system yet, they are …
var map = new google.maps.Map(document.getElementById('map'), {
center: {
lat: 27.7712671,
lng: -82.645638
},
zoom: 16,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
// Create the search box and link it to the UI element.
/** Debugging */
define( 'WP_DEBUG', true );
define( ‘WP_DEBUG_LOG’, true ); // dumps to wp-content
define( ‘WP_DEBUG_DISPLAY’, true ); // toggle based on your needs
@bloqhead
bloqhead / FEDC_Workshop_Notes.md
Created June 15, 2016 17:14
Notes for Ethan Marcotte's responsive web design workshop.

Ethan Marcotte

Exercise

  1. Global utility links
  2. Logo
  3. Main navigation (reduced to the 3 main links)
  4. Search

Misc Notes

  • "Device-agnostic"
@bloqhead
bloqhead / angler-mixin.scss
Last active April 20, 2016 21:01
Angler mixin for creating angled edges via pseudo elements.
//
// Angler Mixin
//
// Creates angled edges via pseudo elements.
//
// Usage:
//
// .button--type-1 {
// @include angler( -25px, 10%, ['before'|'after'], ['top'|'right'|'bottom'|'left'] );
// }
.bxslider {
//
// bxSlider FOUC prevention
//
// Hides the carousel items and displays the first one
// on initial load. bxSlider overrides the display of
// the carousel items once it is loaded.
//
// Reference: http://stackoverflow.com/a/19304079/415436
@bloqhead
bloqhead / hamburger.html
Created February 29, 2016 18:16
Creates a hamburger button with ease.
<button class="hamburger">
Menu
</button>
@bloqhead
bloqhead / featured-image-to-rss.php
Created January 28, 2016 16:46
This function inserts a post's featured image above the excerpt content in WordPress' RSS feeds. Why? When our marketing team is tying their clients' WordPress RSS feeds into HubSpot's email campaign feature, it only grabs the excerpt content, which has images stripped by default. This makes posts appear prettier and more uniform when HubSpot au…
@bloqhead
bloqhead / sass-globbing-fix.sh
Created January 5, 2016 17:45
There is a bug with `sass-globbing` version 1.1.1 that throws an error when it comes to file paths. To fix it, run the following command in your command line app of choice. To give props, see this comment on Github: https://github.com/chriseppstein/sass-globbing/issues/19#issuecomment-66501914
gem uninstall sass-globbing
gem install sass-globbing -v 1.1.0
@bloqhead
bloqhead / example.html
Last active October 28, 2015 14:16
Toggles corresponding content containers based on data attributes. Requires jQuery.
<style>
[data-target] {
display: none;
}
</style>
<nav>
<ul id="menu">
<li data-link="panel-1">Panel One</li>
<li data-link="panel-2">Panel Two</li>
@bloqhead
bloqhead / google-slideshow-shortcode.php
Last active May 27, 2025 21:16
Allows you to easily embed a Google Slides slideshow in WordPress as a shortcode.
<?php
/**
* Google Slides embed shortcode
* The slideshow must be set to public!
*/
add_shortcode( 'googleslideshow','google_slideshow' );
function google_slideshow( $atts, $content = '' ) {
$atts = shortcode_atts( array(