Skip to content

Instantly share code, notes, and snippets.

View vishwasnavadak's full-sized avatar
🎯
Trying to hit the targets.

Vishwasa Navada K vishwasnavadak

🎯
Trying to hit the targets.
View GitHub Profile
# custom aliases -kVn
alias cra="npx create-react-app"
alias cna="npx create-next-app"
# NPM
alias ni='npm install --save'
alias nid='npm install --save-dev'
alias ns='npm start'
alias nt='npm run test'
alias nd='npm run dev'
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 June 30, 2020 07:44
necessary tags for Open Graph, Twitter and Schema.org meta information
{"lastUpload":"2020-06-30T07:44:22.760Z","extensionVersion":"v3.4.3"}
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 November 18, 2018 16:10
Add function to send data to AWS API-GATEWAY
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 November 18, 2018 13:04
Lambda Functions to add data to DynamoDB
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 November 18, 2018 13:04
Lambda Functions to fetch data from DynamoDB
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 November 18, 2018 13:00
Fetch function to get data from AWS API-GATEWAY
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; } )