Skip to content

Instantly share code, notes, and snippets.

View rhukster's full-sized avatar

Andy Miller rhukster

View GitHub Profile
@rhukster
rhukster / conditional.yaml
Last active March 19, 2017 23:15
Conditional Field in Use
conditional_new_entries:
type: conditional
condition: "id ? 'false' : 'true'"
classes: overlay bottom
fields:
field-a:
label: New Field A
type: text
@rhukster
rhukster / watch.sh
Last active April 5, 2021 16:11
Watch script for wellington sassc wrapper
#!/bin/sh
#
# Configuration
#
# sass source
SASS_SOURCE_PATH="scss"
# sass options
@rhukster
rhukster / sphp.sh
Last active September 13, 2022 06:21 — forked from w00fz/sphp.sh
PHP switcher
#!/bin/bash
# Check if command was ran as root.
if [[ $(id -u) -eq 0 ]]; then
echo "The command \"sphp\" should not be executed as root or via sudo directly."
echo "When a service requires root access, you will be prompted for a password as needed."
exit 1
fi
# Usage
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Vagrant Grav</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
<style>
/* Space out content a bit */
function max_by($array, $fieldname = null)
{
$field_array = array();
foreach ($array as $i => $befree) {
$field_array[$i] = $array[$i][$fieldname];
}
return max($field_array);
}
@rhukster
rhukster / gist:befd2a439b10d53d1e3f
Created October 19, 2014 15:41
Grav ignore temp files
# Grav Specific
cache/*
!cache/.*
assets/*
!assets/.*
logs/*
!logs/.*
images/*
!images/.*