Skip to content

Instantly share code, notes, and snippets.

View ericrasch's full-sized avatar

Eric Rasch ericrasch

View GitHub Profile
<h1>
This is the primary heading and there should only be one of these per page
</h1>
<p>
A small paragraph to <em>emphasis</em> and show <strong>important</strong> bits.
</p>
<ul>
<li>This is a list item
</li>
<li>So is this - there could be more
@ericrasch
ericrasch / dabblet.css
Created March 13, 2012 20:15
HTML Kitchen Sink (taken from BlueTrip CSS Framework) includes the major (and minor) HTML tags you might use on any given site. Now available on http://dabblet.com/gist/2031276
/**
* HTML Kitchen Sink
*/
background: #fff;
font: normal normal 14px/1.4 Arial, "Helvetica Neue", Helvetica, sans-serif;
/* background: linear-gradient(45deg, #f06, yellow); */
min-height:100%;
@ericrasch
ericrasch / dabblet.css
Created March 15, 2012 16:41
Horizontal Type Line Behind Text
/**
* Horizontal Type Line Behind Text
* Inspired by this discussion @ CSS-Tricks: http://css-tricks.com/forums/discussion/comment/51357#Comment_51357
* Available on jsFiddle: http://jsfiddle.net/ericrasch/jAXXA/
* Available on Dabblet: http://dabblet.com/gist/2045198
* Available on GitHub Gist: https://gist.github.com/2045198
*/
h2 {
font: 33px sans-serif;
@ericrasch
ericrasch / include-tweets.php
Created March 15, 2012 21:33
How to display your latest tweets in your WordPress site without a plugin
<?php
// How to display your latest tweets in your WordPress site without a plugin
// Source: http://dinolatoga.com/2010/07/31/how-to-display-your-latest-tweets-in-your-wordpress-blog-without-a-plugin/
include_once(ABSPATH . WPINC . '/feed.php');
//configuration
$username = "EricRasch"; // Just insert the username of the Twitter account you want to display
$feed = "http://twitter.com/statuses/user_timeline/$username.rss"; // Changed the code from dinolatoga.com to actually use the username variable
$num = 2; // Set the number of Tweets you want to display
@ericrasch
ericrasch / first-paragraph-class.php
Created March 29, 2012 21:26
WordPress: Add Class to first Paragraph in WordPress the_content; (add this to the functions.php in your Theme)
<?php
/* =BEGIN: Add Class to first Paragraph in WordPress the_content();
Source: http://webdevbits.com/wordpress/add-class-to-first-paragraph-in-wordpress-the_content/
---------------------------------------------------------------------------------------------------- */
function first_paragraph($content){
// Testing to see if the content is a Page or Custom Post Type of school, if so, display the text normally (without the class = intro).
if ( is_page() || ('school' == get_post_type() ) ) {
return preg_replace('/<p([^>]+)?>/', '<p$1>', $content, 1);
} else {
return preg_replace('/<p([^>]+)?>/', '<p$1 class="intro">', $content, 1);
@ericrasch
ericrasch / dabblet.css
Created June 12, 2012 19:42
Ordered List Item Style Prefix
/**
* Ordered List Item Style Prefix
* prefix ordered list item numbers with a static string using CSS
* Dabblet (by @EricRasch): http://dabblet.com/gist/2919680
* jsFiddle (by @EricRasch): http://jsfiddle.net/NUJJk/
* SCSS Mixin (by @JimmyNotJim): http://jsfiddle.net/KY9ua/
* forked from: http://jsfiddle.net/BoltClock/9VdB3/
* StackOverflow Q&A: http://stackoverflow.com/a/5568259/1428800
*/
body {
@ericrasch
ericrasch / index.html
Created June 21, 2012 16:23
A web page created at CodePen.io
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Responsive Breakpoint Hinting &middot; CodePen</title>
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/normalize.css">
@ericrasch
ericrasch / gist:3288425
Created August 7, 2012 19:02
List WordPress Custom Taxonomy with Posts
<?php
$taxonomyName = "cpt_rankings_cat"; // Set your custom taxonomy here.
// Alternate method for retrieving a term ID. Source: http://codex.wordpress.org/Function_Reference/wp_get_post_terms#Examples
$term_list = wp_get_post_terms($post->ID, $taxonomyName, array("fields" => "ids"));
// Source: http://codex.wordpress.org/Function_Reference/get_term_children#A_Basic_Example
$term_parent_ID = $term_list[0]; // Pulls the parent term ID from the call above.
@ericrasch
ericrasch / Preferences.sublime-settings
Created October 9, 2012 15:02 — forked from ericclemmons/Preferences.sublime-settings
SublimeText2 User Preferences (Railscasts)
{
"color_scheme": "Packages/Color Scheme - Default/Railscasts.tmTheme",
"theme": "Phoenix Dark.sublime-theme",
"file_exclude_patterns": [
".DS_Store",
"dump.rdb"
],
"folder_exclude_patterns":
[
".svn",
<?php
$ig_post_custom_fields = array (
"infographic" => array(
"name" => "is_infographic",
"std" => "",
"title" => "Is this an infographic post?",
"description" => "If you check this box, we'll add a Pin It share option.",
"type" => "checkbox"),
"image_url" => array(