Skip to content

Instantly share code, notes, and snippets.

View wader's full-sized avatar
🦫

Mattias Wadman wader

🦫
View GitHub Profile
@emanuele6
emanuele6 / gron.jq
Last active November 21, 2024 05:59
gron in jq
#!/bin/sh --
# \
exec jq -nsRrf --args -- "$0" "$@"
def path2gronpath:
reduce .[] as $k ("json"; . + ($k |
if type == "number" or . == "" or test("^[0-9]|[^0-9a-zA-Z_]")
then @json "[\(.)]"
else ".\(.)"
end));
@pkoppstein
pkoppstein / schema.jq
Last active April 28, 2025 23:20
schema.jq
module {
"name": "schema",
"description": "JSON Schema Inference",
"version": "0.0.3.1",
"homepage": "https://gist.github.com/pkoppstein/a5abb4ebef3b0f72a6ed",
"license": "MIT",
"author": "pkoppstein at gmail dot com"
};
# NEWS:
@alaborie
alaborie / gist:2938856
Created June 15, 2012 21:47
enumerateObjectsUsingBlock nested in an autorelease pool?
NSError *error = nil;
void (^block)(NSError **error);
block = ^(NSError **blockError)
{
NSArray *array = [NSArray arrayWithObject:@"hello"];
[array enumerateObjectsUsingBlock:^(id object, NSUInteger index, BOOL *stop) {
if ( blockError != NULL )
{