jq is useful to slice, filter, map and transform structured json data.
brew install jq
#!/bin/bash | |
# see: http://blog.tomtung.com/2009/11/cowsay-fortune | |
# http://www.commandlinefu.com/commands/view/3584/remove-color-codes-special-characters-with-sed | |
# https://github.com/busyloop/lolcat | |
# https://github.com/dorentus/mruby-lolcat-bin | |
# | |
# requires `fortune`, `cowsay`, | |
# and ruby gem `lolcat` or its mruby version equivalent | |
export LANG="en_US.UTF-8" |
[user] | |
email = [email protected] | |
name = Firstname Lastname | |
[alias] | |
# basic | |
st = status -s | |
cl = clone | |
ci = commit | |
co = checkout |
# Run this in the same directory as the Hangouts.json file generated by Google Takeout / Data Export tool. | |
# python3 hangouts.py | |
import json | |
import datetime | |
import os | |
import shutil | |
import re | |
chat_dir = "hangouts" |
-- more info http://aaron-hoffman.blogspot.com/2017/02/iphone-text-message-sqlite-sql-query.html | |
select | |
m.rowid | |
,coalesce(m.cache_roomnames, h.id) ThreadId | |
,m.is_from_me IsFromMe | |
,case when m.is_from_me = 1 then m.account | |
else h.id end as FromPhoneNumber | |
,case when m.is_from_me = 0 then m.account | |
else coalesce(h2.id, h.id) end as ToPhoneNumber | |
,m.service Service |
#!/usr/bin/env python3 | |
''' | |
A script to recursively compare two directories (including file size and file hash changes) | |
Usage: python3 compare_dirs.py DIR1 DIR2 | |
''' | |
import os, sys, hashlib | |
COMPARE_FILES = True # should file sizes be compared if their names are the same? |
fif() { | |
rg \ | |
--column \ | |
--line-number \ | |
--no-column \ | |
--no-heading \ | |
--fixed-strings \ | |
--ignore-case \ | |
--hidden \ | |
--follow \ |
{ | |
"theme": "light", | |
"autoUpdate": false, | |
"snippet": { | |
"expanded": true, | |
"newSnippetPrivate": false, | |
"sorting": "updated_at", | |
"sortingReverse": true | |
}, | |
"editor" : { |
#!/bin/bash | |
#If no argument is specified, ask for it and exit | |
if [[ -z "$@" ]]; | |
then | |
echo "An argument is needed to run this script"; | |
exit | |
else | |
arg="$@" | |
#Basic check to make sure argument number is valid. If not, display error and exit | |
if [[ $(($(echo $arg | grep -o "\s" | wc --chars) / 2 )) -ne 2 ]]; |
// ==UserScript== | |
// @name SlackPGP | |
// @namespace slack | |
// @description slackPGP | |
// @include https://*.slack.com/messages/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |