Skip to content

Instantly share code, notes, and snippets.

@daviddarnes
daviddarnes / .eleventy.js
Last active February 14, 2022 02:10
Compile JavaScript and Sass in Eleventy using UglifyJS and Sass lib
const terser = require("terser");
const sass = require("sass");
module.exports = (eleventyConfig) => {
// Compile Sass
eleventyConfig.addTemplateFormats("scss");
eleventyConfig.addExtension("scss", {
outputFileExtension: "css",
compile: function (contents, inputPath) {
@ebidel
ebidel / coverage.js
Last active April 27, 2024 04:13
CSS/JS code coverage during lifecycle of page load
Moved to https://github.com/ebidel/puppeteer-examples
@davestevens
davestevens / LetsEncrypt.md
Last active March 28, 2024 10:35
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
@adactio
adactio / basicServiceWorker.js
Last active March 27, 2023 09:30
A basic Service Worker, for use on, say, a blog.
'use strict';
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function() {
// Update 'version' if you need to refresh the cache
var staticCacheName = 'static';
var version = 'v1::';
@tbranyen
tbranyen / auto-deploy.js
Last active January 27, 2017 11:50
Automatic GitHub deployments
//
// README:
// - Listens for PUSH events
// - Fetches the ref pushed via the given remote
// - Sets the repositories HEAD to latest ref
// - Checks out the new HEAD (--force)
// - Install dependencies from package.json
// - Calls `npm run reload` (My app uses this)
// - Calls `nginx -s reload` (My app also uses this)
//
@coolaj86
coolaj86 / github-pages-https-lets-encrypt.md
Last active November 16, 2021 22:36
Github Pages: Let's Encrypt!
@zaporylie
zaporylie / field-instances.php
Last active January 20, 2016 11:22
Exporting/importing fields/groups
<?php
/**
* Get field/instance
*/
function get_field_install($field_name) {
$field = field_info_field($field_name);
unset($field['columns']);
unset($field['id']);
unset($field['indexes']);
unset($field['foreign keys']);
@jerodsanto
jerodsanto / Rakefile
Created January 10, 2015 16:51
A code dump showing how we generate "The Changelog Weekly" using the Trello API
require "rubygems"
require "bundler"
require_relative "lib/importer"
Bundler.setup
desc "Import from Trello board"
task :import do
Importer.new(File.dirname(__FILE__)).import ENV["ISSUE"]
end
@p3t3r67x0
p3t3r67x0 / pseudo_elements.md
Last active January 16, 2024 01:17
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@buckeyeworldcitizen
buckeyeworldcitizen / bdayclock
Last active February 4, 2019 14:47
Birthday word clock
//Theres two parts to this code: first the birthday part and then the clock part which i had on separate arduinos.
//The first section is original and the second is modified from Joe Caldwell at http://www.highonsolder.com who modified it from Scott Bezek who modified it from Doug Jackson
//Good luck
#include <Wire.h>
#include "RTClib.h"
#include <Adafruit_NeoPixel.h>