jq is useful to slice, filter, map and transform structured json data.
brew install jq
# -*- coding: utf-8 -*- | |
import json | |
import sys | |
from ConfigParser import (ConfigParser, MissingSectionHeaderError, | |
ParsingError, DEFAULTSECT) | |
class StrictConfigParser(ConfigParser): | |
def _read(self, fp, fpname): |
<?php | |
/* | |
* Get ACF fields recursivly | |
* (if post does not have value look upward until found) | |
*/ | |
function get_field_recursive( $field, $level_id = null ) { | |
// If no ID is passed set to post ID | |
$level_id = $level_id == null ? get_queried_object_id() : $level_id; |
# Forwarding your .ssh/sshrc file and sourcing it as .bashrc | |
# A function sudoi is defined on the remote machine, used | |
# instead of sudo -i, to run a shell as the specified user, | |
# or root as default, and source the local .ssh/sshrc. | |
function ssh() { | |
tmprc=$(/usr/bin/ssh "$@" "mktemp" 2>/dev/null) | |
rsync ~/.ssh/sshrc "$1:$tmprc" >/dev/null 2>&1 | |
echo "function sudoi() { sudo -u \"\${1:-root}\" bash --rcfile \"$tmprc\"; }" | /usr/bin/ssh "$@" "cat - >> \"$tmprc\"" >/dev/null 2>&1 | |
/usr/bin/ssh -t "$@" "chmod a+r \"$tmprc\"; bash --rcfile \"$tmprc\" ; rm \"$tmprc\"" |
{ | |
"extends": "recommended", | |
"rules": { | |
"convention.CompileStatic": "off", | |
"convention.NoDef": "off", | |
"convention.VariableTypeRequired": "off", | |
"convention.MethodReturnTypeRequired": "off", | |
"groovyism.ExplicitCallToEqualsMethod": "off", | |
"groovyism.GStringExpressionWithinString": "off", | |
"naming.VariableName": "off", |