Skip to content

Instantly share code, notes, and snippets.

View alexroper's full-sized avatar

Alex Roper alexroper

  • Portland, Oregon USA
  • 18:19 (UTC -07:00)
View GitHub Profile
@jgarber
jgarber / MIT-LICENSE.txt
Created April 4, 2012 14:57
Responsive video
Copyright (c) 2011 ZURB, http://www.zurb.com/
@lukeholder
lukeholder / environment.md
Last active October 13, 2015 13:17
Luke Holder's Development Environment

Luke Holder's Development Environment.

Hardware

  • 15" Retina Macbook Pro
  • Thunderbolt Display
  • Apple Wireless Keyboard
  • Magic Mouse

Lesson's learnt building the Guardian

Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?

Daithi O Crualaoich

  • Work with great people.
  • Deploy like crazy. This means the team has to control the infrastructure as well as code.
  • Design is not a service. Designers have to sit in the team.
  • Infrastructure is intrinsically unreliable. Discard and replace is the robust strategy.
  • Use your CDN for HTML too.
  • Don't always do as you are told.
@adamwiggall
adamwiggall / Keep Directories
Last active December 20, 2015 18:38
Often you have a directory in a git repo that you want to share amongst developers, but you don't want the contents tracked. As git ignores empty directories, if you just .gitignore the directory completely it will never get added to the repo and shared. The example shows how to use this technique for the cache folder in an expressionengine inst…
From the command line
$ touch your/path/to/expressionengine/cache/.gitkeep
In your .gitignore file
your/path/to/expressionengine/cache/*
!your/path/to/expressionengine/cache/.gitkeep
anonymous
anonymous / A-Pen-by-Aaron-Alexander.markdown
Created September 12, 2013 17:01
A Pen by Aaron Alexander.
@patpohler
patpohler / gist:7885310
Created December 10, 2013 03:27
Block bad traffic
#Block hotlinking
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|css)$ - [NC,F,L]
#Block comment spammers, bad bots and some proxies
RewriteCond %{REMOTE_HOST} 24.117.121.113 [OR]
RewriteCond %{REMOTE_HOST} ^211.138.198.* [OR]
RewriteCond %{REMOTE_HOST} 216.246.60.183 [OR]
RewriteCond %{REMOTE_HOST} 203.94.229.227 [OR]
@elivz
elivz / twig-calendar.twig
Created June 20, 2015 04:17
Event calendar using Craft & Twig
{% set allEvents = craft.entries('events') %}
{% for month, events in allEvents|group('startDate|date("F Y")') %}
{% set eventsByDate = events|group('startDate|date("j")') %}
<section id="{{ month|slugify }}" class="month{% if loop.first %} currentMonth{% endif %}">
<h1 class="monthName">{{ month }}</h1>
<div class="eventList">
<table class="calendar">
<thead>
@tristanisfeld
tristanisfeld / browsersync.js
Last active November 10, 2023 23:58
Gulp 4 - Multifile tasks w/ external config. Basic gulpfile template for use with multiple task files, using gulp-load-plugins
// =========================================================
// Gulp Task: browsersync
// NOTE: Using gulp v4
// Description: Sync sass, typescript, html, and browser
// using external config or add modify src
// npm install --save-dev browser-sync gulp-typescript gulpjs/gulp.git#4.0 gulp-load-plugins
// Options: node-sass gulp-sass || gulp-ruby-sass
// =========================================================
var config = require('../config.js');
var browserSync = require('browser-sync').create();
@aaronwaldon
aaronwaldon / 1) readme.md
Last active March 24, 2023 14:25
How to set up Gulp for Craft CMS. Includes SASS compilation and minification, JavaScript minification, livereloading, and browser sync.

How to set up Gulp with a Craft CMS project

I freaking love working with technologies like Gulp, and wanted to share how to get my current Craft front-end workflow set up. With a few tweaks, this can also be used with virtually any other sites (I've used it with Laravel, static sites, ExpressionEngine, etc).

Project Directory Structure

  • project root/
    • craft/
      • templates/
  • (your craft template files)
@khalwat
khalwat / load-balancer-app.php
Created February 26, 2018 17:25
Keep hashed directories consistent in a load balanced server environment with Craft CMS 3
<?php
/**
* Yii Application Config
*
* Edit this file at your own risk!
*
* The array returned by this file will get merged with
* vendor/craftcms/cms/src/config/app/main.php and [web|console].php, when
* Craft's bootstrap script is defining the configuration for the entire
* application.