Skip to content

Instantly share code, notes, and snippets.

Avatar

William Turrell wturrell

View GitHub Profile
@wturrell
wturrell / tailwind.config.js
Created May 14, 2019
Example Tailwind CSS config (possibly faulty)
View tailwind.config.js
/*
Tailwind - The Utility-First CSS Framework
A project by Adam Wathan (@adamwathan), Jonathan Reinink (@reinink),
David Hemphill (@davidhemphill) and Steve Schoger (@steveschoger).
Welcome to the Tailwind config file. This is where you can customize
Tailwind specifically for your project. Don't be intimidated by the
length of this file. It's really just a big JavaScript object and
@wturrell
wturrell / gulpfile.js
Created Feb 2, 2019
Gulp 4.0.0 + SASS, minification, TailwindCSS, PHP and BrowserSync support
View gulpfile.js
"use strict";
// Gulp 4.0.0 + SASS, minification, TailwindCSS, PHP and BrowserSync support
// (assumes you have your .scss + .css files in a /css directory)
// william@wturrell.co.uk
var gulp = require('gulp'),
sass = require('gulp-sass'),
cssnano = require('gulp-cssnano'),
php = require('gulp-connect-php'),
@wturrell
wturrell / composer.json
Created Mar 3, 2017
Working composer.json for Drupal stackexchange question 230267
View composer.json
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0+",
"authors": [
{
"name": "",
"role": ""
}
@wturrell
wturrell / composer.json
Created Mar 3, 2017
Working composer.json for Drupal stackexchange question 230267
View composer.json
{
"name": "drupal-composer/drupal-project",
"description": "Project template for Drupal 8 projects with composer",
"type": "project",
"license": "GPL-2.0+",
"authors": [
{
"name": "",
"role": ""
}
@wturrell
wturrell / apt-add-dotdeb-nginx-repo.yml
Created Mar 2, 2017
Ansible playbook for adding DotDeb/Debian repositories for jessie-nginx-http2 support
View apt-add-dotdeb-nginx-repo.yml
---
# Add the DotDeb repositories needed to install an http2 compatible Nginx
# see: https://www.dotdeb.org/instructions/
#
# Note
# - as we're doing multiple steps we turn update_cache off until the end
# to save time.
# - apt_repository install things in /etc/apt/sources_list.d/
- hosts:
- [insert your host name(s) here]
@wturrell
wturrell / drupal_repo_test.php
Last active Oct 31, 2016
Test for content-length mismatch problems with Drupal repository
View drupal_repo_test.php
<?php
// Test for content-length mismatch problems with Drupal repository
// (adapted from mickaelperrin/test.php)
// william@wturrell.co.uk 20161031
$test_urls = [
'http://cgit.drupalcode.org/drupal/plain/.csslintrc?h=8.2.1',
'http://cgit.drupalcode.org/drupal/plain/.htaccess?h=8.2.1',
@wturrell
wturrell / ampp3d-sample-chart.js
Created Jun 7, 2014
Ampp3d DimpleJS custom scatterplot example
View ampp3d-sample-chart.js
ampp3d.chartConfigs.chart_scottish_referendum_1 = {
margins: {
top: 10,
right: 10,
left: 30,
bottom: 80
},
api_version: 1,
type: 'scatter-plot', // 'scatter-plot', 'line' or 'column'
data: '/wp-content/uploads/2014/06/scotland-full-data.csv',
@wturrell
wturrell / ampp3d-fetchdb.sh
Last active Aug 29, 2015
Ampp3d Wordpress sync script - production to dev
View ampp3d-fetchdb.sh
#########################################################
# Remote MySQL Backup and Download
# Author: Brian Strickland
#
# 1) Log into a remote server
# 2) Run a MySQL dump on a database
# 3) Copies the dump to the local machine.
#
# You can use this for any database/server, just change
# the top parameters.
@wturrell
wturrell / popular-posts.php
Created Mar 14, 2014
Wordpress & Google Analytics - retrieve most popular posts
View popular-posts.php
@wturrell
wturrell / twitter_feed.php
Last active Dec 14, 2015
Modified PyroCMS Twitter widget - uses Twitter OAuth PHP class (/system/cms/libraries/Twitter.php) to connect using v1.1 of Twitter API and grab/cache Tweets. To use this, you need to: - create an 'application at http://dev.twitter.com and then use the same page to generate your 'access tokens' AND ensure /system/cms/libraries/Twitter.php has th…
View twitter_feed.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Show Twitter streams in your site
*
* @author Phil Sturgeon
* @author PyroCMS Dev Team
* @package PyroCMS\Core\Widgets
*/
class Widget_Twitter_feed extends Widgets
You can’t perform that action at this time.