Skip to content

Instantly share code, notes, and snippets.

View bharat-tiwari's full-sized avatar

Bharat Tiwari bharat-tiwari

View GitHub Profile
@bharat-tiwari
bharat-tiwari / footer1.md
Last active January 2, 2019 18:04
Footer1
← Prev:Register iOS app for Google Sign-in 🏠 Next:Add Google Sing-in for iOS→
@bharat-tiwari
bharat-tiwari / delete.json
Created December 24, 2018 19:09
Notewordy API - mock test data to test delete endpoint
{
"pathParameters": {
"id": "replace-this-with-the-id-of-an-item-you-have-in-your-dynamoDb-table"
},
"requestContext": {
"identity": {
"cognitoIdentityId": "TEST-LOCAL-USER-A"
}
}
}
@bharat-tiwari
bharat-tiwari / delete.ts
Created December 24, 2018 18:49
NoteWordy API - lambda for delete word
import { APP_CONSTANTS } from '../../config/app_constants';
import getResponse from '../../utils/responseUtils';
import * as AWS from "aws-sdk";
const dynamoDb = new AWS.DynamoDB.DocumentClient({
'region': 'us-east-1'
});
export async function main(event, context, callback) {
@bharat-tiwari
bharat-tiwari / update.json
Created December 24, 2018 15:45
notewordy API - mock test data to test update endpoint
{
"body": "{ \"word\": \"stranger-1\", \"meaning\": \"someone whom you don't know or who doesn't belong in a specific place\", \"example\": \"Don't talk to strangers.-1\" }",
"requestContext": {
"identity": {
"cognitoIdentityId": "TEST-LOCAL-USER-A"
}
},
"pathParameters": {
"id": "replace-this-with-the-id-of-an-item-you-have-in-your-dynamoDb-table"
}
@bharat-tiwari
bharat-tiwari / update.ts
Last active December 24, 2018 15:09
noteWordy API - Lambda function to update a word
import { APP_CONSTANTS } from '../../config/app_constants';
import getResponse from '../../utils/responseUtils';
import * as AWS from "aws-sdk";
const dynamoDb = new AWS.DynamoDB.DocumentClient({
'region': 'us-east-1'
});
export async function main(event , context, callback){
const requestData = JSON.parse(event.body);
@bharat-tiwari
bharat-tiwari / getById.ts
Created December 24, 2018 05:10
NoteWordy API : endpoint to get word by id
import { APP_CONSTANTS } from '../../config/app_constants';
import getResponse from '../../utils/responseUtils';
import * as AWS from "aws-sdk";
const dynamoDb = new AWS.DynamoDB.DocumentClient({
'region': 'us-east-1'
});
export async function main(event, context, callback) {
const params = {
@bharat-tiwari
bharat-tiwari / getLoggedUserWords.json
Last active December 23, 2018 05:28
mock test json data to test getLoggedUserWord
{
"requestContext": {
"identity": {
"cognitoIdentityId": "TEST-LOCAL-USER-A"
}
}
}
@bharat-tiwari
bharat-tiwari / tsconfig.json
Last active April 15, 2018 14:44
tsconfig.json for react-native project build with CRNA (Create React Native App)
{
"compilerOptions": {
"module":"es2015",
"target": "es2015",
"jsx": "react",
"rootDir": "src",
"outDir": "build",
"allowSyntheticDefaultImports": true,
"noImplicitAny": true,
"sourceMap": true,
@bharat-tiwari
bharat-tiwari / item-details.ts
Last active March 14, 2018 16:56
Item details component using ngOnChanges
import {Component,Input, OnChanges, SimpleChanges, SimpleChange} from '@angular/core';
@Component({
selector: 'item-details',
templateUrl: 'item-details.html',
})
export class ItemDetails implements OnChanges {
private _item;
get item(): any {
import {Component,Input,SimpleChanges} from '@angular/core';
@Component({
selector: 'item-details',
templateUrl: 'item-details.html',
})
export class ItemDetails {
private _item; // private property _item