Skip to content

Instantly share code, notes, and snippets.

Fitz Haile fitzhaile

Block or report user

Report or block fitzhaile

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View fblikebox.html
<script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php" type="text/javascript"></script>
<script type="text/javascript">FB.init("INSERT-YOUR-API-KEY");</script>
<fb:fan profile_id="INSERT-YOUR-PAGE-ID" connections="10" width="300" height="210" css="http://yoursite.com/path-to-your-stylesheet/style.css?5"></fb:fan>
@fitzhaile
fitzhaile / *.php
Created Sep 26, 2012
PHP: Get Twitter Timeline
View *.php
/**
* Simple Twitter status getter.
* @param string $handle User Twitter handle
* @param integer $count Desired number of tweets
* @return array Indexed array of tweets
*/
function dev_get_twitter_timeline($handle, $count = 3) {
// WP template tag
$save = get_stylesheet_directory() . '/assets/twitter.json';
$time = time();
@fitzhaile
fitzhaile / *.scss
Created Sep 26, 2012
SASS: Quotes Mixin
View *.scss
// Add quotes to an element.
//
// Parameters:
//
// * [optional] `size` -- Size, in em of the quotes
// * [optional] `padding` -- Top-left padding on lefthand quote
// * [optional] `left` -- Left quote glyph
// * [optional] `right` -- Right quote glyph
@mixin my-quotes($size: 1.3em, $padding:false, $left:'\201C', $right:'\201D') {
&:after, &:before { font-size: $size; }
@fitzhaile
fitzhaile / css-stats-ack.sh
Created Oct 2, 2012 — forked from pjkix/css-stats-ack.sh
shell script to generate some css file statistics
View css-stats-ack.sh
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@fitzhaile
fitzhaile / *.scss
Created Oct 3, 2012
SASS: Bordered Box Arrow
View *.scss
@import "compass/css3";
// Add outward pointing arrows (triangles) to the sides of a box that has borders. (CSS triangles obviously
// based on Chris Coyier's CSS triangle. http://css-tricks.com/snippets/css/css-triangle.)
//
// Parameters:
//
// * `direction` -- What side of the box and direction of the arrow
// * `flatten` -- An *even numbered* factor of flattening the triangle (MUST be a even number)
// * `arrowBaseLength` -- Width or height of the arrow's base
@fitzhaile
fitzhaile / is_blog.php
Created Oct 16, 2012 — forked from wesbos/is_blog.php
WordPress is_blog()
View is_blog.php
function is_blog () {
global $post;
$posttype = get_post_type($post );
return ( ((is_archive()) || (is_author()) || (is_category()) || (is_home()) || (is_single()) || (is_tag())) && ( $posttype == 'post') ) ? true : false ;
}
Usage:
<?php if (is_blog()) { echo 'You are on a blog page'; } ?>
View gist:4772339
<?php
function my_attachments( $attachments )
{
$args = array(
// title of the meta box (string)
'label' => 'My Attachments',
// all post types to utilize (string|array)
View gist:4772341
<?php $attachments = new Attachments( 'attachments' ); ?>
<?php if( $attachments->exist() ) : ?>
<h3>Attachments</h3>
<ul>
<?php while( $attachments->get() ) : ?>
<li>
ID: <?php echo $attachments->id(); ?><br />
Type: <?php echo $attachments->type(); ?><br />
Subtype: <?php echo $attachments->subtype(); ?><br />
URL: <?php echo $attachments->url(); ?><br />
@fitzhaile
fitzhaile / *.php
Last active Dec 12, 2015
WP: Typical Testimonials Markup
View *.php
<?php $testimonials = new WP_Query('post_type=testimonial'.ks_query('testimonials')); ?>
<div class="testimonials">
<?php while( $testimonials->have_posts() ): $testimonials->the_post(); ?>
<blockquote class="testimonial">
<?php the_content(); ?>
<footer>
<p>
<?php the_title(); ?>
</p>
@fitzhaile
fitzhaile / file_exists.rb
Last active Dec 14, 2015
Ruby: Custom file_exists Sass Function
View file_exists.rb
module Sass::Script::Functions
def file_exists(image_file)
path = Dir.getwd + "/" + image_file.value
Sass::Script::Bool.new(File.exists?(path))
end
end
You can’t perform that action at this time.