Skip to content

Instantly share code, notes, and snippets.

Avatar

Rajitha Gunathilake RizkyRajitha

View GitHub Profile
@RizkyRajitha
RizkyRajitha / test.yml
Last active May 29, 2021
GitHub action workflow for test , using PostgreSQL database service container .
View test.yml
name: Running Tests
on: [push]
jobs:
Test:
runs-on: ubuntu-latest
services:
postgres:
@RizkyRajitha
RizkyRajitha / nginx.conf
Last active Jan 22, 2021
nginx path based routing config
View nginx.conf
events {
}
http {
server{
listen 80;
proxy_set_header Host $host;
@RizkyRajitha
RizkyRajitha / nginx.conf
Created Jan 22, 2021
load balancing nginx config
View nginx.conf
http {
upstream all {
server localhost:8081;
server localhost:8080;
}
server{
listen 80;
View app.js
const express = require("express");
const app = express();
const cors = require("cors");
const bp = require("body-parser");
const fetch = require("node-fetch");
app.use(cors());
app.use(bp.urlencoded({ extended: false }));
app.use(bp.json());
app.use(require("morgan")("dev"));
View home.svelte
<script>
import axios from "axios";
const appid_openweather = "ac0fdd38df429674be21355a4850114b"; //openweathermap appid
const appid_heremaps = "lmuiUmhDK2JQwBnORnRB"; //here maps appid
const appcode_heremaps = "W3YBbdzlsKOER9SvMF_V1g"; //here maps app code
var loading = false; //get loading state varialble
var city = ""; //store input value varialble1
var temp = ""; //store temp varialble
var humidity = ""; //store humidity varialble
View app.js
const express = require("express");
const app = express();
const port = process.env.PORT || 3001;
const bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
View hash.py
fread = open("e_so_many_books.txt", "r")
# print(fread.read())
librarylist = []
basicData = fread.readline()
line2 = fread.readline()
print(basicData[2])
print(line2)
View java install in aws ec2
sudo apt update
sudo apt install default-jre
sudo apt install default-jdk
sudo apt install openjdk-8-jdk
View app.js
const express = require("express");
const bp = require("body-parser");
const port = 5000;
const app = express();
const fs = require("fs");
const multer = require("multer");
app.use(bp.urlencoded({ extended: false }));
app.use(bp.json());
View app.js
const express = require("express");
const bp = require("body-parser");
const port = 5000;
const app = express();
const multer = require("multer");
app.use(bp.urlencoded({ extended: false }));
app.use(bp.json());