This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
u.name AS user_name, | |
u.email AS user_email, | |
SUM(o.quantity * p.price) AS total_spent | |
FROM | |
users u | |
JOIN | |
orders o ON u.id = o.user_id | |
JOIN | |
products p ON o.product_id = p.id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Value objects | |
//Motivation | |
//Use cases | |
//Proposed syntax | |
value Money { | |
constructor(amount, currency) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cause => effect | |
user() | |
.correlationId('userId') | |
.stateOfAffairs(UserHasRegistered).causes(KycVerified) | |
.stateOfAffairs(UserHasRegistered,KycVerified).causes(AccountCreated) | |
.stateOfAffairs(UserHasRegistered,KycVerified,AccountCreated).causes(UserHasTopUp) | |
.stateOfAffairs(UserHasRegistered,KycVerified,AccountCreated,UserHasTopUp).causes(CreditCardCreated) | |
.stateOfAffairs(UserHasRegistered,KycVerified,AccountCreated,UserHasTopUp,CreditCardCreated).causes(OnboardFinished) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
CallHandler, | |
ExecutionContext, | |
Injectable, | |
Logger, | |
NestInterceptor, | |
} from "@nestjs/common"; | |
import { Observable } from "rxjs"; | |
import { catchError, tap } from "rxjs/operators"; | |
import { isFunction } from "../utils"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const filter = ([head, ...rest] = [], callback) => { | |
if(!head) return []; | |
return [ | |
...callback(head) ? [head] : [], | |
...filter(rest, callback) | |
]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// language exceptions | |
var exceptions = { | |
"are": "were", | |
"eat": "ate", | |
"go": "went", | |
"have": "had", | |
"inherit": "inherited", | |
"is": "was", | |
"run": "ran", | |
"sit": "sat", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { should, each, iff, prop, props } from 'rvl-pipe' | |
import { createUser, createAuthToken, authTokenValidator, requestValidator } from '../account' | |
import ctx from './dummyContext' | |
const registerUser = each( | |
validateRequest(requestValidator), | |
generatePasswordHash(prop('body.password'), 'passwordHash'), | |
createDocument('users', createUser, "userAccount"), | |
should(prop('userAccount'), 'invalidUser'), | |
createJsonWebToken(createAuthToken), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
["https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/recording_lywr.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/gifts_btw0.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/booking_33fn.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/youtube_tutorial_2gn3.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/logistics_x4dc.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/teddy_bear_hns1.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/email_campaign_qa8y.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcdn.com/illustrations/vehicle_sale_v7fm.svg","https://42f2671d685f51e10fc6-b9fcecea3e50b3b59bdc28dead054ebc.ssl.cf5.rackcd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 |
NewerOlder