Skip to content

Instantly share code, notes, and snippets.

View jnowland's full-sized avatar

James Nowland jnowland

View GitHub Profile
//Please note this does not currently work.
@each $section in council, household, business {
.#{$section} h2 {
//Step 1: I want this below varible to dynamically change to $council-light, $household-light, $business-light
color: $#{$section}-light; //this seems to be the problem of trying to append '-light' onto a varible name
//please note council-light, household-light, business-light are all predefined varibles with hex colours assigned.
<?php /* making sure we 'orderby' correctly */
query_posts( $query_string . '&orderby=date&order=DEC' ); ?>
<?php if ( have_posts() ) : ?>
<?php
/* Setup */
$display_year = '';
$format = 'd/m/Y';
$year_position = 2;
//Simple comment up here to explain that accordion is a accordion with 3 parts blah blah blah
.accordion {
.js & {
display: none;
}
.js .open + & {
display: block;
}
//dont use & unless it changes the order here.
li {

Templating in EE vs. Craft

Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.

Table of Contents

  1. Comments
  2. Conditionals
  3. Loops

Templating in EE vs. Craft

Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.

Table of Contents

  1. Comments{{ cycle(['odd','even'], loop.index0 }}

  2. Conditionals

# Ask for the administrator password upfront
sudo -v
# mkdir -p ~/Sites/Work/Clients
# mkdir -p ~/Sites/Work/Internal
# mkdir -p ~/Sites/Personal
# mkdir -p ~/Downloads/Torrents
mkdir -p /Volumes/Sites/Work/Clients
mkdir -p /Volumes/Sites/Work/Internal
@jnowland
jnowland / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jnowland
jnowland / 0-model-override.js
Created March 23, 2016 04:18 — forked from spencermefford/0-model-override.js
An alternative to extending Loopback's built in models. In our application, we wanted to create a custom role called "ecm-administrator" that would have the ability to create and manage users.
module.exports = function (app) {
var _ = require('lodash');
var User = app.models.User;
var Role = app.models.Role;
var RoleMapping = app.models.RoleMapping;
var ACL = app.models.ACL;
/*
* Configure ACL's
*/
@jnowland
jnowland / SassMeister-input.scss
Created February 26, 2017 09:20
Precise control over responsive typography for Sass
// ----
// libsass (v3.3.6)
// ----
// =========================================================================
//
// PRECISE CONTROL OVER RESPONSIVE TYPOGRAPHY FOR SASS
// ---------------------------------------------------
// Indrek Paas @indrekpaas
//