Skip to content

Instantly share code, notes, and snippets.

View curtishenson's full-sized avatar

Curtis Henson curtishenson

View GitHub Profile
@curtishenson
curtishenson / CollapseSidebarAsset.php
Created February 22, 2024 00:23 — forked from wsydney76/CollapseSidebarAsset.php
Make sections of Craft 5 element indexes collapsible
<?php
namespace modules\main\web\assets\collapsesidebar;
use craft\web\AssetBundle;
/**
* Collapse Sidebar asset bundle
* Experimental!
*
@curtishenson
curtishenson / default.conf.tpl
Created May 29, 2019 18:04
Lando Craft Lemp Setup
server {
listen 80 default_server;
listen 443 ssl;
server_name localhost;
ssl_certificate /certs/cert.crt;
ssl_certificate_key /certs/cert.key;
ssl_verify_client off;
@curtishenson
curtishenson / recipe.md
Created October 20, 2013 19:24
Josh's Jamaican Jerk
  • 1C Yellow Onion - Finely Chopped
  • 1/2 C Scallions - Finely Chopped
  • 2t Tyme Leaves
  • 1t Salt
  • 2t Sugar
  • 1t Jamaican Allspice
  • 1/2t nutmeg
  • 1/2t Cinnamon
  • 1 Habanero
@curtishenson
curtishenson / new_gist_file
Created October 15, 2013 17:14
Create custom redactor buttons
https://plus.google.com/118380727306844395204/posts/UieLwg7XwRH
@curtishenson
curtishenson / new_gist_file
Created September 18, 2013 17:57
Nav level
If you wanted the top two levels though, here's how you'd set that up:
{% nav entry in craft.entries.section('pages').depth("<= 2").find() %}
@curtishenson
curtishenson / new_gist_file
Created September 10, 2013 23:04
Craft mobile detection
Craft already has built-in mobile detection.
From the templates:
{% if craft.request.isMobileBrowser() %}
From PHP:
if (craft() -> request -> isMobileBrowser())
@curtishenson
curtishenson / text-align-justify.css
Created August 28, 2013 23:12
Text Align Justify RWD. via http://www.barrelny.com/blog/text-align-justify-and-rwd/ No. of placeholders = max elements per row – 2
#Grid{
text-align: justify;
font-size: 0.1px; /*hide whitespace between elements*/
}
#Grid li{
display: inline-block;
width: 23%;
}
@curtishenson
curtishenson / gist:1487008
Created December 16, 2011 17:27
HTML5 links
HTML5 Tools, Folks, and Blogs
(Please limit your additions to true advocates of HTML5. )
Tools
HTML5 Boilerplate - http://html5boilerplate.com
Modernizr - http://www.modernizr.com/
HTML5 and CSS3 Readiness - http://html5readiness.com/
<?php
$id = get_cat_id('video');
$q = "cat=" . $id; query_posts($q);
if (have_posts()) : while (have_posts()) : the_post();
the_content();
endwhile; endif;
?>
<?php
// Check for a link to older posts
if ( get_next_posts_link() ) {
// If there is a link to older pages output this code
echo '<span class="old_posts">';
next_posts_link('Previous', '0');
echo '</span>';
} else {
// If there isn't a link output our own code
echo '<span class="no_old_posts">no older posts</span>';