Skip to content

Instantly share code, notes, and snippets.

View jimmyhillis's full-sized avatar

Jimmy Hillis jimmyhillis

View GitHub Profile
@jimmyhillis
jimmyhillis / image.php
Created January 27, 2013 02:45
Simple stub to use within a Wordpress template for building a full size image page, which will be seen whenever you view the permalink for any images in a Wordpress blog. Add this to your theme with the filename `image.php` to use this for all images. Might also consider using `attachment.php` or `single-attachment.php` depending on your situation.
<article class="article">
<?php $attachment_info = getimagesize($post->guid); ;?>
<div class="content">
<img src="<?php echo $post->guid; ?>" alt="<?php the_title(); ?>" title="<?php the_title(); ?>" <?php echo $attachment_info[3]; ?> />
</div>
<a href="<?php echo get_permalink($post->post_parent); ?>" title="<?php echo get_the_title($post->post_parent); ?>">Back to <?php echo get_the_title($post->post_parent); ?></a>
</article>
@jimmyhillis
jimmyhillis / disqus.jade
Last active December 10, 2015 04:58
Jade markup for integrating Disqus within a template
#disqus_thread
noscript Please enable JavaScript to view the
a(href='http://disqus.com/?ref_noscript') comments powered by Disqus
a(href="http://disqus.com", class="dsq-brlink") comments powered by
span(class="logo-disqus") Disqus
script
var disqus_shortname = 'shortname_here';
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
@jimmyhillis
jimmyhillis / _hash.js
Created December 19, 2012 10:33
Simple function to return the #hash_component and nothing else from a URL string which can contain as much or little of a URL in any order.
function _hash(url_string) {
var a = document.createElement('A');
a.href = url_string;
return a.hash.split('?')[0].split('&')[0];
}
@jimmyhillis
jimmyhillis / Preferences.sublime-settings
Created August 10, 2012 12:15
My stock and useful set of Sublime Text 2 Preferences
{
// Styles, themes, and typography
"bold_folder_labels": true,
"detect_indentation": false,
"ensure_newline_at_eof_on_save": true,
"font_face": "Source Code Pro ExtraLight",
"font_size": 13.0,
"highlight_modified_tabs": true,
// File management