Skip to content

Instantly share code, notes, and snippets.

View challahan's full-sized avatar

Christopher Hallahan challahan

View GitHub Profile
@challahan
challahan / craft-cmd-cheat-sheet.md
Last active July 31, 2023 17:45
Craft CMS Templating Quick Reference / Cheat Sheet

Because I'm always looking these up:

Normal Fields

{{ entry.plainTextField }}

{{ entry.dateField|date('M j, Y') }}

Asset Fields (Images)

@challahan
challahan / doctype.html
Last active August 16, 2026 07:40
Default HTML5 Doctype Template
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Page Title Goes Here</title>
<meta name="description" content="Page Description Goes Here">
</head>
<body>
@jshawl
jshawl / Gruntfile.js
Last active January 18, 2023 13:52
Grunt + Sass + Autoprefixer
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
dist: {
options:{
style:'compressed'
},
files: {
'css/style.css' : 'scss/style.scss'
@mathiasbynens
mathiasbynens / toggleAttr() jQuery plugin
Created February 8, 2010 21:20
toggleAttr() jQuery plugin
/*!
* toggleAttr() jQuery plugin
* @link http://github.com/mathiasbynens/toggleAttr-jQuery-Plugin
* @description Used to toggle selected="selected", disabled="disabled", checked="checked" etc…
* @author Mathias Bynens <http://mathiasbynens.be/>
*/
jQuery.fn.toggleAttr = function(attr) {
return this.each(function() {
var $this = $(this);
$this.attr(attr) ? $this.removeAttr(attr) : $this.attr(attr, attr);