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 December 21, 2023 15:24
gron in jq
#!/bin/sh --
# \
exec jq -nsRrf "$0" --args -- "$@"
def path2gronpath:
reduce .[] as $k ("json"; . + ($k |
if type == "number" or . == "" or test("^[0-9]|[^0-9a-zA-Z_]")
then @json "[\(.)]"
else ".\(.)"
end));
@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 )
{