jq is useful to slice, filter, map and transform structured json data.
brew install jq
| # This file provides a base Command class that handles sending errors via mail_admins | |
| # Make sure to adjust the LOGGING variable in settings | |
| # Credit to Abdulla Diab: https://mpcabd.xyz/make-django-management-commands-send-errors-email-admins/ | |
| import sys | |
| import logging | |
| from django.core.management import BaseCommand | |
| logger = logging.getLogger('management.command') |
| from django import forms | |
| from django.contrib.postgres.fields import ArrayField | |
| class ChoiceArrayField(ArrayField): | |
| """ | |
| A field that allows us to store an array of choices. | |
| Uses Django 1.9's postgres ArrayField | |
| and a MultipleChoiceField for its formfield. |
| /*jslint browser: true, plusplus: true, indent: 2 */ | |
| /*global Node, console, Blob */ | |
| /** | |
| * Et tu pleures. Et tu pleures. Et tu pleures. Mais ça marche. | |
| * | |
| * But how the fuck will I make this work? | |
| * - Step 1: Open your firebug (or other) console | |
| * - Step 2: Paste this code into it | |
| * - Step 3: Click "Execute" (or maybe "Run") | |
| * - Step 4: If everything went OK your browser will download the file |
| #!/bin/bash | |
| ################################################################## | |
| # Licensed under GNU GPL v3 # | |
| # [email protected] # | |
| # # | |
| # DNS replacement scrpit in SQL dumps containing (also) PHP # | |
| # serialized strings. # | |
| # This script use bash and perl' perl is used to increment # | |
| # serialized string length while performing DNS replacement # | |
| # It also use sed for other basic DNS replacements # |
| {"1":{"score":25,"coords":[10766,13656],"type":"keep","name":{"de":"Aussichtspunkt","en":"Overlook","es":"Mirador","fr":"Belvédère"}}, | |
| "2":{"score":25,"coords":[11497,15121],"type":"keep","name":{"de":"Tal","en":"Valley","es":"Valle","fr":"Vallée"}}, | |
| "3":{"score":25,"coords":[9606,15132],"type":"keep","name":{"de":"Tiefland","en":"Lowlands","es":"Vega","fr":"Basses terres"}}, | |
| "4":{"score":5,"coords":[10211,15437],"type":"camp","name":{"de":"Golanta-Lichtung","en":"Golanta Clearing","es":"Claro Golanta","fr":"Clairière de Golanta"}}, | |
| "5":{"score":5,"coords":[11226,13754],"type":"camp","name":{"de":"Pangloss-Anhöhe","en":"Pangloss Rise","es":"Colina Pangloss","fr":"Montée de Pangloss"}}, | |
| "6":{"score":5,"coords":[9850,13561],"type":"camp","name":{"de":"Speldan Kahlschlag","en":"Speldan Clearcut","es":"Claro Espeldia","fr":"Forêt rasée de Speldan"}}, | |
| "7":{"score":5,"coords":[11030,15559],"type":"camp","name":{"de":"Danelon-Passage","en":"Danelon Passage","es":"Pasaje Danelon","fr":"Passage Danelon"}}, | |
| "8":{"score |
| #goz git bash | |
| c_cyan=`tput setaf 6` | |
| c_blue=`tput setaf 4` | |
| c_red=`tput setaf 1` | |
| c_green=`tput setaf 2` | |
| c_sgr0=`tput sgr0` | |
| parse_git_branch () |