Skip to content

Instantly share code, notes, and snippets.

View oneblackcrayon's full-sized avatar

Frederick Polk oneblackcrayon

View GitHub Profile
// -------------------------------------------------------------- //
// APPLICATION GLOBAL ------------------------------------------- //
// -------------------------------------------------------------- //
// These files need app-required.sass (theme and variables and mixins)
// to load. The files imported here are global CSS that will apply to
// all applications and, ideally, never need to be recompiled per app.
@import app-required.sass // import the stuff required for compile
// Styles
// Simple Responsive Grid
// based on Chris Eppstein's SASS responsive layouts
// http://chriseppstein.github.com/blog/2011/08/21/responsive-layouts-with-sass/
// -------------------------------------------------------------- //
// DESKTOP - LARGE - %desktop-large ----------------------------- //
// -------------------------------------------------------------- //
// 1024px and up to 1280px at which it becomes fixed
@media all and (min-width: 1024px)
<?php
/* Register custom post types on the 'init' hook. */
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 0.1.0
* @access public
@oneblackcrayon
oneblackcrayon / semantic-blog-entry-and-comments-code.html
Last active August 29, 2015 13:57
Semantic blog entry code for coding a blog entry page
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="content-language" content="en">
<link rel="stylesheet" href="assets/style.css">
<title>&nbsp;</title>
</head>
<body class="" role="document" aria-labelledby="document-desc">
/**
* Filter out hard-coded width, height attributes on all images in WordPress.
* https://gist.github.com/4557917
*
* This version applies the function as a filter to the_content rather than send_to_editor.
* Changes made by filtering send_to_editor will be lost if you update the image or associated post
* and you will slowly lose your grip on sanity if you don't know to keep an eye out for it.
* the_content applies to the content of a post after it is retrieved from the database and is "theme-safe".
* (i.e., Your changes will not be stored permanently or impact the HTML output in other themes.)
*

One Black Crayon logo

One Black Crayon

A very brief presentation on email services for RubyGems and businesses.

ActionMailer

Action Mailer is a framework for designing email service layers. These layers are used to consolidate code for sending out forgotten passwords, welcome wishes on signup, invoices for billing, and any other use case that requires a written notification to either a person or another system.

//NOTE: this uses fancybox 2
// found here: http://scottgale.com/blogsamples/fancybox-pinterest/index.html
// from: http://scottgale.com/blogsamples/fancybox-pinterest/index.html
$(document).ready(function () {
$('.fancybox')
.fancybox({
//set the next and previous effects so that they make sense
//the elastic method is confusing to the user
nextEffect: 'fade',
prevEffect: 'fade',
@oneblackcrayon
oneblackcrayon / jquery.scrollTo.and.highlight.anchor.js
Created April 18, 2014 22:54
When you want to highlight a navigation anchor with scrollTo
$(document).ready(function() {
$('nav.primary a').click(function(event) { // the elements you click to scroll
event.preventDefault();
var link = this; // you need this if you are using hash links on ex: a href="#link" to id="link"
$.smoothScroll({
offset: -160, // adjusts where the scroll will stop so the height of the scrolling element plus the height of the element you are scrolling to.
speed: 2000,
scrollTarget: link.hash
});
});
@oneblackcrayon
oneblackcrayon / find-replace-grep-regex.md
Created May 7, 2014 19:08
Find content between an HTML tag pair and replace everything outside of them.

In TextWrangler (GREP based):

Find field:

.*?<article>(.*?)</article>.*

Replace field:

\1\n
@oneblackcrayon
oneblackcrayon / main-html5-text.md
Last active August 29, 2015 14:02
Deciding which is semantically correct

One

    <header>
      <!-- stuff -->
    </header><!-- end /header -->
    <main>
      <header>
        <!-- main header stuff -->