Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Trying to hit the targets.

Vishwasa Navada K vishwasnavadak

🎯
Trying to hit the targets.
View GitHub Profile
View shell-aliases.sh
# custom aliases -kVn
alias cra="npx create-react-app"
alias cna="npx create-next-app"
# NPM
alias ni='npm install'
alias nis='npm install --save'
alias nisd='npm install --save-dev'
alias ns='npm start'
alias nt='npm run test'
View serverless-github-action-deployment.yml
name: Serverless Deployement Example
# Triggers the action everty time there is a code push to the master branch
on:
push:
branches:
- master
# Specify what jobs to run
jobs:
@vishwasnavadak
vishwasnavadak / cloudSettings
Last active Jun 30, 2020
necessary tags for Open Graph, Twitter and Schema.org meta information
View cloudSettings
{"lastUpload":"2020-06-30T07:44:22.760Z","extensionVersion":"v3.4.3"}
View scraping-with-cheerio.js
const axios = require("axios");
const cheerio = require("cheerio");
const scrape = async url => {
const { data } = await axios.get(url).catch(err => console.log(err));
const $ = cheerio.load(data);
const result = $(".skill-col").text();
return result;
};
@vishwasnavadak
vishwasnavadak / addItemAPIGateway.js
Created Nov 18, 2018
Add function to send data to AWS API-GATEWAY
View addItemAPIGateway.js
export function addTodo(item){
var request = fetch(`API-URL?desc=${item}`,{
method: 'POST',
headers:{
'Content-Type': 'application/json',
'x-api-key': 'API-KEY'
}
})
.then(response => response.json())
.then((data) => { return data; } )
@vishwasnavadak
vishwasnavadak / addDataDynamoDB.js
Created Nov 18, 2018
Lambda Functions to add data to DynamoDB
View addDataDynamoDB.js
var uid = require('uuid');
var AWS = require('aws-sdk'),
myDocumentClient = new AWS.DynamoDB.DocumentClient();
exports.todoGetItem = function(event, context, callback) {
var params ={
TableName: 'TABLE_NAME',
Item: {
'id' : uid.v1(),
'desc' : event.desc,
@vishwasnavadak
vishwasnavadak / fetchDataDynamoDBdata.js
Last active Nov 18, 2018
Lambda Functions to fetch data from DynamoDB
View fetchDataDynamoDBdata.js
var AWS = require('aws-sdk'),
myDocumentClient = new AWS.DynamoDB.DocumentClient();
exports.todoFetchItems = function(event, context, callback) {
var params ={
TableName: 'TABLE_NAME'
};
myDocumentClient.scan(params, function(err, data){
if(err){
callback(err,null);
@vishwasnavadak
vishwasnavadak / fetchAPIGateway.js
Last active Nov 18, 2018
Fetch function to get data from AWS API-GATEWAY
View fetchAPIGateway.js
export function fetchTodoList(){
var request = fetch('API-URL',{
method: 'GET',
headers:{
'Content-Type': 'application/json',
'x-api-key': 'API-KEY'
}
})
.then(response => response.json())
.then((data) => { return data; } )