Skip to content

Instantly share code, notes, and snippets.

@examinedliving
examinedliving / jq to filter by value.md
Last active January 22, 2021 20:41 — forked from ipbastola/jq to filter by value.md
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

From Command prompt on windows, it's like so: (use more if you don't have cat - or get cat)

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{0E270DAA-1BE6-48F2-AC49-4E2781B29975}]
@="Creative Cloud Files"
"System.IsPinnedToNameSpaceTree"=dword:00000000
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0E270DAA-1BE6-48F2-AC49-4E2781B29975}]
@="Creative Cloud Files"
"System.IsPinnedToNameSpaceTree"=dword:00000000
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{0E270DAA-1BE6-48F2-AC49-4E2781B29975}]
@="Creative Cloud Files"
"System.IsPinnedToNameSpaceTree"=dword:00000000
[HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{0E270DAA-1BE6-48F2-AC49-4E2781B29975}]
@="Creative Cloud Files"
"System.IsPinnedToNameSpaceTree"=dword:00000000
@examinedliving
examinedliving / bootstrap-4-sass-mixins-cheat-sheet.scss
Created April 4, 2020 00:32 — forked from anschaef/bootstrap-4-sass-mixins-cheat-sheet.scss
Bootstrap 4 Sass Mixins [Cheat sheet with examples]
/* -------------------------------------------------------------------------- */
// All Bootstrap 4 Sass Mixins [Cheat sheet]
// Updated to Bootstrap v4.4.x
// @author https://anschaef.de
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins
/* -------------------------------------------------------------------------- */
// Grid variables
$grid-columns: 12;
$grid-gutter-width: 30px;
@examinedliving
examinedliving / footer.js
Created May 8, 2019 14:33 — forked from chrisdiana/footer.js
Dynamically add footer to jQuery Datatable
@examinedliving
examinedliving / example.sass
Created April 5, 2019 20:29 — forked from brod-ie/example.sass
respond-to() SASS mixin for Bootstrap 3 grid system.
.profile-pic {
float: left;
width: 250px;
@include respond-to(xs) {
width: 100%;
}
@include respond-to(sm) {
width: 125px;
}
@examinedliving
examinedliving / example.js
Created January 5, 2018 18:42 — forked from colingourlay/example.js
Lodash / Underscore sort object keys. Like _.sortBy(), but on keys instead of values, returning an object, not an array. Defaults to alphanumeric sort.
var obj = {b: 3, c: 2, a: 1};
_.sortKeysBy(obj);
// {a: 1, b: 3, c: 2}
_.sortKeysBy(obj, function (value, key) {
return value;
});
// {a: 1, c: 2, b: 3}
@examinedliving
examinedliving / sync-gists.rb
Created December 9, 2017 00:39 — forked from mikehale/sync-gists.rb
Sync all your gists to local disk
#!/usr/bin/env ruby
require 'excon'
require 'json'
module EnumerableEnumerator
def self.included(base)
base.extend ClassMethods
@examinedliving
examinedliving / 00globals.jsx
Last active December 2, 2017 19:28 — forked from hilukasz/00globals.jsx
The file to customize which allows for customization of ESTK. This is a customized verion made by someone, who I do not have written down anywhere.
/**************************************************************************
*
* @@@BUILDINFO@@@ 00globals-2.jsx 3.5.0.43 20-November-2009
* ADOBE SYSTEMS INCORPORATED
* Copyright 2010 Adobe Systems Incorporated
* All Rights Reserved.
*
* NOTICE: Adobe permits you to use, modify, and distribute this file in
* accordance with the terms of the Adobe license agreement accompanying it.
* If you have received this file from a source other than Adobe, then your
@examinedliving
examinedliving / protovis_to_link.js
Created December 16, 2016 17:10 — forked from jweir/protovis_to_link.js
How to save SVG data to a file from a web browser