(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.
const firstArray = [{}, {}, {}]; | |
const secondArray = [firstArray[0], {}, firstArray[2]]; | |
test('Objects should be the same', () => { | |
expect.extend({ | |
toBeSameObject(received, errMsg) { | |
const result = { | |
pass: received, | |
message: () => errMsg | |
}; |
1 | |
111 | |
10101 | |
1001001 | |
100010001 | |
10000100001 | |
100010001 | |
10000100001 | |
1000001000001 | |
100000010000001 |
const Botgram = require('botgram'); | |
const figlet = require('figlet'); | |
const { TELEGRAM_BOT_TOKEN } = process.env; | |
if (!TELEGRAM_BOT_TOKEN) { | |
console.error('Seems like you forgot to pass Telegram Bot Token. I can not proceed...'); | |
process.exit(1); | |
} |
(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.
function addN(base: number): (a: number) => number { | |
let baseNumber = base; | |
return (addition: number): number => baseNumber + addition; | |
} | |
const addEight = addN(8); | |
console.log(addEight(7)); // 15 | |
console.log(addEight(100)); // 108 |
void main() { | |
print(toWeirdCase('Wazzap')); | |
} | |
toWeirdCase(String str) { | |
var result = new List(); | |
for (int i = 0; i < str.length; i++) { | |
result.add(i%2 == 0 ? str[i].toUpperCase() : str[i].toLowerCase()); | |
} |
void main() { | |
print(findOutlier([2, 4, 0, 100, 4, 11, 2602, 36])); | |
print(findOutlier([160, 3, 1719, 19, 11, 13, -21])); | |
print(findOutlier([4, 8, 15, 16, 24, 42])); | |
print(findOutlier([16, 6, 40, 66, 68, 28])); | |
} | |
findOutlier(List nums) { | |
var odds = new List(); | |
var evens = new List(); |
{ | |
"release": { | |
"branch": "master", | |
"tagFormat": "${version}", | |
"analyzeCommits": "simple-commit-message", | |
"repositoryUrl": "git@github.com:cvmaker-bv/types.git", | |
"plugins": [ | |
"@semantic-release/commit-analyzer", | |
"@semantic-release/release-notes-generator", | |
"@semantic-release/changelog", |
{ | |
"paddingVertical": "0px", | |
"paddingHorizontal": "0px", | |
"backgroundImage": null, | |
"backgroundImageSelection": null, | |
"backgroundMode": "color", | |
"backgroundColor": "rgba(0,0,0,1)", | |
"dropShadow": false, | |
"dropShadowOffsetY": "20px", | |
"dropShadowBlurRadius": "68px", |
const { stripe_secret_key, stripe_webhook_secret } = privateConfig; | |
const stripe = new Stripe(stripe_secret_key); | |
let event: events.IEvent | undefined; | |
try { | |
const sig = req.headers['stripe-signature'] as string; | |
const reqBody = req.rawBody.toString(); | |
event = stripe.webhooks.constructEvent(reqBody, sig, stripe_webhook_secret); | |
} catch (err) { |