This is an exmaple of custom Drupal module that modifies portions of the [Geofield module][1].
- Alter [Geofield][1] exposed filter
- Change distance textfield to select box
- Default unit to miles and hide the unit selector
<?php | |
/** | |
* Plugin Name: De-SKU-Woo | |
* Plugin URI: https://github.com/cojomojo/De-SKU-Woo | |
* Description: Remove the SKU from Woocommerce products. | |
* Version: 0.1 | |
* Author: Cody Balos | |
* Author URI: https://github.com/cojomojo | |
* License: MIT | |
* |
#!/usr/bin/env node | |
// Don't forget to install xml2js using npm | |
// `$ npm install xml2js` | |
var fs = require('fs'); | |
var xml2js = require('xml2js'); | |
module.exports = function(context) { | |
var timestamp = (function() { |
#!/bin/bash | |
if [ -z "$1"] | |
then | |
echo "./create.cert <name>" | |
echo "please provide name argument" | |
exit 1 | |
else | |
name=$1 | |
fi |
#docker remove all containers | |
function docker-rmall() { | |
printf "The operation will remove all of the following containers: \n" | |
printf '%s \n' $(docker ps -a -q) | |
printf '%s ' 'Continue? [Y/n]: ' | |
read response | |
# if yes then proceed | |
if [[ $response =~ ^[Yy]$ ]] | |
then |
#docker stop all containers | |
function docker-stopall() { docker stop $(docker ps -a -q) } |
#!/bin/bash | |
if [ -z "$1"] | |
then | |
echo "./create.cert <name>" | |
echo "please provide name argument" | |
exit 1 | |
else | |
name=$1 | |
fi |
#!/bin/sh | |
DAY=`/bin/date +%Y%m%d` | |
PAST_DAY=`/bin/date -d '5 days ago' +%Y%m%d` | |
mysqldump DATABASE -u root -pPASSWORD > /path/to/it/DATABASE.$DAY.sql | |
rm -f /path/to/it/DATABASE.$PAST_DAY.sql |
#!/bin/sh | |
# Cleanup docker files: untagged containers and images. | |
# | |
# Use `docker-cleanup -n` for a dry run to see what would be deleted. | |
untagged_containers() { | |
# Print containers using untagged images: $1 is used with awk's print: 0=line, 1=column 1. | |
# NOTE: "[0-9a-f]{12}" does not work with GNU Awk 3.1.7 (RHEL6). | |
# Ref: https://github.com/blueyed/dotfiles/commit/a14f0b4b#commitcomment-6736470 | |
docker ps -a | tail -n +2 | awk '$2 ~ "^[0-9a-f]+$" {print $'$1'}' |
# Ask for the user password | |
# Script only works if sudo caches the password for a few minutes | |
sudo true | |
# Install kernel extra's to enable docker aufs support | |
sudo apt-get -y install linux-image-extra-$(uname -r) | |
# Add Docker PPA and install latest version | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list" |