Skip to content

Instantly share code, notes, and snippets.

@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']);
@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)
//
@imjared
imjared / scraping-with-casperjs.js
Created March 20, 2013 00:33
A CasperJS script that crawled a list of links on then scraped the relevant content on each page and output it to a nicely formatted XML file. Sure beats database dumps/SQL manipulation, in my opinion.
/*jshint strict:false*/
/*global CasperError console phantom require*/
/**
* grab links and push them into xml
*/
var casper = require("casper").create({
});
@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>
@coolaj86
coolaj86 / github-pages-https-lets-encrypt.md
Last active November 16, 2021 22:36
Github Pages: Let's Encrypt!
@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) {
@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
@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::';
@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] {