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
class BaseDesign { | |
setNext(next){ | |
this._next = next; | |
} | |
next(role){ | |
if(this._next){ | |
return this._next.run(role); | |
} | |
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
AWSTemplateFormatVersion: "2010-09-09" | |
Transform: AWS::Serverless-2016-10-31 | |
Description: > | |
Lambda, SQS, role, Policy, Api | |
Globals: | |
Function: | |
Timeout: 5 | |
Runtime: python3.6 | |
Handler: app.lambda_handler |
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
image: node:latest | |
stages: | |
- deploy | |
Production: | |
stage: deploy | |
only: | |
refs: | |
- master | |
before_script: |
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 forEachOf(items, callback, finishCallback) { | |
if (items.length !== undefined && items.length > 0) { | |
this.key = this.key || 0; | |
if (this.key >= items.length){ | |
this.key = 0; | |
finishCallback(); | |
}else { | |
callback(items[this.key], this.key, () => { | |
this.key++; | |
forEachOf(items, callback, finishCallback); |
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
#!/bin/bash | |
MSG="$1" | |
message="Hey! looks like your commit message is not following correct format" | |
if ! grep -qE ":" "$MSG"; | |
then | |
printf "\n"; | |
echo -e "\e[91m${message}\e[0m"; | |
echo "Your commit message: " && cat "${MSG}"; |
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 mysql = require('mysql-library'); | |
const mysql = { | |
createConnection: () => { | |
return { | |
query: (query) => { | |
return query; | |
} | |
} | |
} | |
}; |
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
FROM thecodingmachine/php:7.4-v3-cli-node10 | |
LABEL authors="Julien Neuhart <[email protected]>, David Négrier <[email protected]>" | |
USER root | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends gnupg && \ | |
curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ | |
apt-get update && \ |
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
// ----> Design Principles | |
// DRY | |
// 0 | |
console.log("Don’t Repeat Yourself"); | |
// 1 | |
console.log("Encapsulate What Varies"); |
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
import json | |
import boto3 | |
from datetime import datetime | |
def lambda_handler(event, context): | |
dynamodb = boto3.resource('dynamodb') | |
client = boto3.client('dynamodb') | |
queryStringParameters = event.get("queryStringParameters", {}) | |
list_items = queryStringParameters.get("list_items", "false") |
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
sudo apt update | |
wget -qO- https://repos.influxdata.com/influxdb.key | sudo apt-key add - | |
echo "deb https://repos.influxdata.com/debian buster stable" | sudo tee /etc/apt/sources.list.d/influxdb.list | |
sudo apt update | |
sudo apt -y install telegraf |
OlderNewer