Skip to content

Instantly share code, notes, and snippets.

View SgiobairOg's full-sized avatar
🇨🇭
Code crafting with Valtech

Aoibhe Wilson SgiobairOg

🇨🇭
Code crafting with Valtech
  • Valtech
  • Lucerne, Switzerland
  • 14:27 (UTC +02:00)
View GitHub Profile
@SgiobairOg
SgiobairOg / JcrQueryLibrary.md
Created October 20, 2020 13:35 — forked from floriankraft/JcrQueryLibrary.md
Some useful JCR queries (XPATH, SQL2) for AEM/CQ development.

SQL2

All nodes with a specific name

SELECT * FROM [nt:unstructured] AS node
WHERE ISDESCENDANTNODE(node, "/search/in/path")
AND NAME() = "nodeName"

All pages below content path

@SgiobairOg
SgiobairOg / LiquidationPreferences.md
Created February 8, 2019 23:12
Coding Challenge: Liquidation Preferences

Coding Challenge: Waterfall Analysis

When a startup closes a new financing round (called a Series A, B, C, and so on), a new share class with preferred rights is usually created. These protect new investors in case the company gets sold at a lower valuation than the current financing round (while founders and employees might still get a pretty nice return). They are called liquidation preferences. When the company is sold (called an “exit”), the money of the exit has to be divided among all shareholders according to these liquidation preferences.

The basic rules are:

1× non-participating

The investor gets paid back 1× their originally invested amount, nothing else. The rest is divided among all the other shareholders according to their ownership in the company (this is called “pro-rata”).

@SgiobairOg
SgiobairOg / saw.js
Created February 20, 2018 00:44
Partial Saw Answer
// State with an attribute of List
// Action. word brings in the word
const vowelList = ["a", "e", "i", "o", "u", "y"];
const reducer = (state, action) => {
// If the word only has the vowel in the list add it
// Otherwise throw it out.
@SgiobairOg
SgiobairOg / gist:336ff5d9cd3babdd7f1b27c35aa26a84
Created February 21, 2017 18:44
Git Diff from /test/parallel/test-zlib-write-after-close.js
diff --git a/test/parallel/test-zlib-write-after-close.js b/test/parallel/test-zlib-write-after-close.js
index 0c54270..a9ff6a5 100644
--- a/test/parallel/test-zlib-write-after-close.js
+++ b/test/parallel/test-zlib-write-after-close.js
@@ -6,7 +6,10 @@ const zlib = require('zlib');
zlib.gzip('hello', common.mustCall(function(err, out) {
const unzip = zlib.createGunzip();
unzip.close(common.mustCall(function() {}));
- assert.throws(function() {
- unzip.write(out);
@SgiobairOg
SgiobairOg / index.js
Created February 21, 2017 00:59
Saw IV
const fs = require('mz/fs');
const co = require('co');
/* CSV is BULLSHIT
* Write a function that takes a directory and 'fixes' csv files by switching them to .txt
* Extra bonus if it recurses into the subdirectory
*/
@SgiobairOg
SgiobairOg / rounder.scss
Created May 20, 2016 22:50
Four Corner Border Radius Mixin
// CSS for the demo
//Border Radius Mixin
// Usage: @include ([top left], [top right], [bottom right], [bottom left] )
// @include ( 10px, 0px, 10%, 0%); Straightforward corners with pixel or percent measurements
// @include ( 10px 25px, 0px, 10% 25%, 0%); Oval rounding is achieved with a space
@mixin rounded($tl,$tr,$br,$bl) {
-webkit-border-top-left-radius: $tl;
-webkit-border-top-right-radius: $tr;
-webkit-border-bottom-right-radius: $br;