Skip to content

Instantly share code, notes, and snippets.

@gkranasinghe
gkranasinghe / finished.js
Created July 21, 2022 07:14 — forked from adrianhajdin/finished.js
Amazon Scraper API
const express = require('express');
const request = require('request-promise');
const PORT = process.env.PORT || 5000;
const app = express();
app.use(express.json());
const returnScraperApiUrl = (apiKey) => `http://api.scraperapi.com?api_key=${apiKey}&autoparse=true`;
@gkranasinghe
gkranasinghe / App.css
Created July 21, 2022 07:41 — forked from adrianhajdin/App.css
Movie App
@import url("https://fonts.googleapis.com/css?family=Roboto+Slab:100,300,400,700");
@import url("https://fonts.googleapis.com/css?family=Raleway:300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i");
* {
margin: 0;
border: 0;
box-sizing: border-box;
}
:root {
@gkranasinghe
gkranasinghe / AWS_Certified_Devops_Engineer_Professional_Study_notes.txt
Created September 1, 2022 04:48
AWS Certified DevOps Engineer – Professional Study notes
CI & CD:
========
2 core software development processes
CI process of automating regular code commits followed by an automated build and test process designed to highlight intergration issues early.
Additional tooling and functionality provided by Bamboo, CruiseControl, Jenkins, Go and TeamCity etc.
workflow based
CD takes the form of a workflow based process which accepts a tested software build payload from a CI server. Automates the deployment into a working QA, Pre-prod or Prod environment.
AWS CodeDeploy and CodePipeline provide CI/CD services
Elasticbeanstalk and CFN provide functionality which can be utilized by CI/CD servers.
@gkranasinghe
gkranasinghe / markdown_guide.md
Created September 7, 2022 09:59 — forked from cuonggt/markdown_guide.md
The Ultimate Guide to Markdown

Markdown Guide

The Ultimate Guide to Markdown

Basic Markdown Formatting

Headings

# This is an <h1> tag

This is an tag

@gkranasinghe
gkranasinghe / python_mysql.py
Created September 12, 2022 17:05 — forked from bradtraversy/python_mysql.py
Python & MySQL crash course for beginners
import mysql.connector
from mysql.connector import errorcode
config = {
'user': 'root',
'password': '',
'host': 'localhost',
'database': 'acme'
}
@gkranasinghe
gkranasinghe / conda.txt
Created September 13, 2022 04:47
Anaconda
#Crate conda environment
conda create --name py35 python=3.5
#Install package
conda install jupyter
pip3 install -r requirements.txt
#auto generate requirements file
pipreqs .
@gkranasinghe
gkranasinghe / gcp.txt
Created September 15, 2022 08:49
GCP
Your credentials are stored at ~/.config/gcloud
@gkranasinghe
gkranasinghe / Python.md
Last active September 15, 2022 09:27
Python using env variables

Install dotenv

conda install -c conda-forge python-dotenv

.env file

TYPE=prod
PORT=5000
Sample Python code (test.py):
@gkranasinghe
gkranasinghe / bash_strict_mode.md
Created September 15, 2022 10:33 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation
@gkranasinghe
gkranasinghe / echo.md
Last active September 16, 2022 04:07
linux echo command short notes

echo command

echo "gayan ranasinghe"
gayan ranasinghe
echo -e "gayan \nranasinghe"
gayan