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() { |
# 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" |
#!/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 | |
# Run like so: | |
# docker-mongodump <mongo container name> <path to backups> | |
MONGO_CONTAINER=$1 | |
BACKUPS_PATH=$2 | |
DAY=`/bin/date +%Y%m%d` | |
PAST_DAY=`/bin/date -d '3 days ago' +%Y%m%d` |
#!/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 |