Skip to content

Instantly share code, notes, and snippets.

View madflow's full-sized avatar

madflow madflow

  • QOSSMIC
  • Cologne, Germany
View GitHub Profile
@madflow
madflow / sort_script.jq
Created June 3, 2024 15:24 — forked from rockydd/sort_script.jq
A jq script for comprehensive sorting of JSON objects. It recursively sorts keys in objects, orders arrays by simple types, and sorts arrays of objects by 'name' or 'id'. Ideal for standardizing complex JSON structures for APIs, configurations, or data processing. Usage: jq -f sort_script.jq input.json with input.json as your target JSON file.
def recursive_sort:
if type == "object" then
to_entries
| sort_by(.key)
| map( {key: .key, value: (.value | recursive_sort)} )
| from_entries
elif type == "array" then
map( if type == "object" or type == "array" then . | recursive_sort else . end )
| if length == 0 or (first | type) != "object" then
sort
@madflow
madflow / sauce_connect_setup.sh
Last active December 13, 2015 10:23 — forked from santiycr/sauce_connect_setup.sh
A small bash script to download and start Sauce Connect as part of a Travis Build.
#!/bin/bash
# Setup and start Sauce Connect for your Codeship Build
CONNECT_URL="http://saucelabs.com/downloads/Sauce-Connect-latest.zip"
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
CONNECT_DOWNLOAD="Sauce_Connect.zip"
READY_FILE="connect-ready-$RANDOM"
# Get Connect and start it
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@madflow
madflow / symfony2-git-boilerplate.sh
Created June 4, 2011 16:30 — forked from domdoescode/symfony2-git-boilerplate.sh
Creating a Symfony2 project, git init, and adding html5-boilerplate default awesome (in twig format)
#!/bin/bash
SYMFONY="Symfony_Standard_Vendors_2.0.0BETA3.tgz"
APPLICATION_ROOT="/var/www"
REMOTE_IP="127.0.0.1"
DB_HOST="localhost"
DB_DRIVER="pdo_pgsql"
DB_USER="test"
DB_PASSWORD="test"
echo "Please enter the company name and project name (in the format CompanyName ProjectName)"