Skip to content

Instantly share code, notes, and snippets.

View antstanley's full-sized avatar
🐶
On the internet, nobody knows you're a hooman.

Ant Stanley antstanley

🐶
On the internet, nobody knows you're a hooman.
View GitHub Profile
@antstanley
antstanley / .eleventy.js
Last active September 12, 2022 21:43
Using PurgeCSS and CleanCSS with 11ty to remove unused CSS selectors
const Purgecss = require('purgecss')
const { JSDOM } = require('jsdom')
const CleanCSS = require("clean-css");
//array of css files to combine
const cssFiles = ['./src/css/custom.css','./src/css/markdown.css', './src/css/tachyons.css']
// cleanCSSOptions for minification and inlining css, will fix duplicate media queries
const cleanCSSOptions = {
level: {
@antstanley
antstanley / slightlyMoreEventFun.js
Last active May 29, 2018 10:06
publishing to EventGrid using REST endpoints and Request module
const uuid = require("uuid").v4;
const topicCreds = "mytopickey";
const topicEndpoint = "mytopic.westeurope-1.eventgrid.azure.net";
const request = require('request');
function publishEvent(topicURL, topicSecret, eventPayload, callback) {
const options = {
method: 'POST',
url: topicURL,
@antstanley
antstanley / publishEvent.js
Last active May 29, 2018 09:55
example to publish event to Azure Event Grid using Request module and Azure REST interface
const request = require('request');
function publishEvent(topicURL, topicSecret, eventPayload, callback) {
const options = {
method: 'POST',
url: topicURL,
headers: {
'aeg-sas-key': topicSecret
},