Skip to content

Instantly share code, notes, and snippets.

View dineshbhagat's full-sized avatar
🌏 dev-engers assemble

DB dineshbhagat

🌏 dev-engers assemble
View GitHub Profile
@dineshbhagat
dineshbhagat / Spock Cheatsheet.md
Created March 25, 2026 12:07 — forked from jiffle/Spock Cheatsheet.md
Spock Useful Patterns Cheatsheet

Spock Useful Patterns Cheatsheet

Adding sequences of behaviour to Mocks and Stubs

The >>> operator allows a sequence of values to be returned:

myMock.someCall() >>> ['first value', 'second value', 'third value', 'etc']

This returns each string in turn. Behaviour (such as throwing exceptions) in closures cannot be used by this operator.

The >> operator allows value or behaviour (closures) to be returned

@dineshbhagat
dineshbhagat / brin_btree_demo.md
Created October 24, 2022 03:20 — forked from dmagda/brin_btree_demo.md
A little demo for the BRIN vs. B-tree index in PostgreSQL
@dineshbhagat
dineshbhagat / zigzag-encoding.README
Created November 9, 2019 06:55 — forked from mfuerstenau/zigzag-encoding.README
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation