The various approach followed for upload service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { caching } = require('cache-manager'); | |
const { redisStore } = require('cache-manager-redis-yet'); | |
const { redisInsStore } = require('cache-manager-redis-yet'); | |
const { createClient } = require('redis'); | |
const ttl = 5 * 1000; | |
process.env.ENABLE_REDIS = true; | |
async function main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resources: | |
Resources: | |
TestOneBucket: | |
Type: AWS::S3::Bucket | |
Properties: | |
BucketName: ${self:service}-${self:provider.region}-test-one | |
CorsConfiguration: | |
CorsRules: | |
- AllowedOrigins: ['*'] | |
AllowedHeaders: ['*'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: https://gist.github.com/chinchang/8106a82c56ad007e27b1#file-xmltojson-js | |
function xmlToJson(xml) { | |
if (typeof xml === 'string') { | |
parser = new DOMParser(); | |
xml = parser.parseFromString(xml, 'text/xml'); | |
} | |
// Create the return object | |
var obj = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const validate = require('jsonschema').validate; | |
let schema = { | |
"type": "object", | |
"properties": { | |
"x": { | |
"display": "X Coordinate", // This is some extra field that we give for our purpose | |
"type": "number", | |
"required": true // error says like 'is required' | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Schema Spy | |
java -jar /usr/local/bin/schemaSpy_5.0.0.jar -dp /home/androbabu/softwares/jar/mysql-connector-java-5.1.28.jar -t mysql -host localhost -db $1 -u root -p password -o .schema | |
# Git Tree Log | |
git log --graph --all --pretty=format:"%C(auto)%h%d %s %C(dim)(%an) %aD" | |
git config --global alias.tree 'log --graph --all --pretty=format:"%C(auto)%h%d %s %C(dim)(%an) %aD"' | |
git tree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isClassComponent(component) { | |
return typeof component === 'function' | |
&& !!component.prototype.isReactComponent | |
} | |
function isFunctionComponent(component) { | |
return typeof component === 'function' | |
// && !!String(component).includes('return React.createElement') // may fails | |
&& React.isValidElement(Component()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<RoutingRules> | |
<RoutingRule> | |
<Condition> | |
<KeyPrefixEquals/> | |
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals> | |
</Condition> | |
<Redirect> | |
<Protocol>https</Protocol> | |
<HostName>xxx1x11xxx.execute-api.us-east-1.amazonaws.com</HostName> | |
<ReplaceKeyPrefixWith>prod/convert?key=</ReplaceKeyPrefixWith> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Streaming Client | |
import socket | |
HOST = 'localhost' | |
PORT = 50007 | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((HOST, PORT)) | |
while True: |
NewerOlder