Skip to content

Instantly share code, notes, and snippets.

View yurist38's full-sized avatar
💻
Work in progress...

Yuri Drabik yurist38

💻
Work in progress...
View GitHub Profile
@yurist38
yurist38 / lifecycle-cheat-sheet.md
Created August 25, 2021 14:50 — forked from HyperBrain/lifecycle-cheat-sheet.md
Serverless Lifecycle Cheat Sheet

Serverless plugin author's cheat sheet

This cheat sheet provides a detailed overview of the exposed lifecycle events and available commands (and entrypoints) of the Serverless framework, that can be hooked by plugins (internal and external ones). The document is structured by the commands invoked by the user.

Lifecycle events are shown as the globally available outer events (all providers) and sub lifecycle events that are provider specific in the called order. Currently only the AWS provider is shown. If you have information about the other provider,

@yurist38
yurist38 / curl.sh
Created February 3, 2021 11:50 — forked from exAspArk/curl.sh
Test CORS with cURL
curl -I -X OPTIONS \
-H "Origin: http://EXAMPLE.COM" \
-H 'Access-Control-Request-Method: GET' \
http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin'
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) {
@yurist38
yurist38 / carbon.config.json
Created June 22, 2020 20:00
Carbon Config (JavaScript Room)
{
"paddingVertical": "0px",
"paddingHorizontal": "0px",
"backgroundImage": null,
"backgroundImageSelection": null,
"backgroundMode": "color",
"backgroundColor": "rgba(0,0,0,1)",
"dropShadow": false,
"dropShadowOffsetY": "20px",
"dropShadowBlurRadius": "68px",
@yurist38
yurist38 / package.json
Last active October 25, 2019 07:56
Semantic release config (GitHub Actions + GitHub NPM registry)
{
"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",
@yurist38
yurist38 / main.dart
Created August 8, 2019 07:40
Daily Challenge #35 - Find the Outlier
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();
@yurist38
yurist38 / main.dart
Created August 7, 2019 08:28
WeIrDcAsE
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());
}
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
@yurist38
yurist38 / introrx.md
Created April 10, 2018 07:58 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@yurist38
yurist38 / AsciiTextBot.js
Created March 3, 2018 16:35
Telegram Bot - converter text into ASCII text
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);
}