This file contains 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
<div class="mermaid"> | |
sequenceDiagram | |
participant System | |
participant App | |
System->>App: Do you hear me | |
App-->>Module: Alive? | |
Module-->>App: Yay! | |
App->>System: Stop | |
</div> |
This file contains 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
export type AuthenticationStates = | |
| { | |
kind: "UNAUTHORISED"; | |
context: { | |
isLoading: false; | |
userName: string; | |
password: string; | |
}; | |
} | |
| { |
This file contains 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
function scrollToEl(el) { | |
var rect = el.getBoundingClientRect(), | |
scrollTop = window.pageYOffset || document.documentElement.scrollTop, | |
scrollLeft = window.pageXOffset || document.documentElement.scrollLeft, | |
elTop = rect.top + scrollTop, | |
elLeft = rect.left + scrollLeft; | |
window.scrollTo({ | |
top: elTop, | |
left: elLeft, |
This file contains 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
function searchBlogByTitle(query: string, itemsPerPage: number, lastEvaluatedKey?: string): Promise<any> { | |
const FIXED_ID_FOR_SEARCH_GSI = "1233421345223"; | |
let params: AWS.DynamoDB.DocumentClient.QueryInput = { | |
TableName: "Blog", | |
IndexName: "BlogSearch", | |
KeyConditionExpression: "fixedIdForSearchGSI = :pkv", | |
FilterExpression: "contains(titleInLowerCase, :titleV)", | |
ExpressionAttributeValues: { | |
":pkv": FIXED_ID_FOR_SEARCH_GSI, | |
":titleV": query.toLocaleLowerCase() |
This file contains 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 disability = ['alienDeaf', 'uscBlind', 'childOther']; | |
const searchTerms = ['alienDeaf', 'alienBlind', 'alienOther']; | |
// searches the disability array for whatever you pass in | |
const findInArray = thing => disability.find(x => x === thing); | |
// returns matching items in array | |
const searchDisabilityArray = params => params.map(findInArray); |
This file contains 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 test = defaultValue => init => init || defaultValue; | |
const test1 = test("N/A"); | |
const roc = { | |
var1: "hello", | |
var2: null | |
}; | |
let { var1, var2 } = roc; |
This file contains 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
var multipart = require(__dirname + '/../node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/multipart'); | |
var urlencoded = require(__dirname + '/../node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/urlencoded'); | |
var json = require(__dirname + '/../node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/json'); | |
module.exports = { | |
'bodyParser' : function(options){ | |
var _urlencoded = urlencoded(options) | |
, _multipart = multipart(options) | |
, _json = json(options); |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This file has been truncated, but you can view the full file.
This file contains 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
Package = {}; | |
_.contains = _.includes; | |
/* Package-scope variables */ | |
var Meteor; | |
(function(){ |
NewerOlder