Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ssv445's full-sized avatar

Shyam Verma ssv445

View GitHub Profile
@ssv445
ssv445 / UploadService.js
Created November 2, 2023 05:17
Uploading a file to AWS presignedUrl using streaming the given file as a Url
"use strict";
const axios = require("axios");
const https = require("https");
async function uploadFileToPresignedUrl(presignedUrl, fileUrl) {
const response = await axios({
method: "get",
url: fileUrl,
responseType: "stream",
httpsAgent: new https.Agent({ keepAlive: true }),
@ssv445
ssv445 / docker-compose-macm1.yml
Created September 19, 2023 16:52
.devcontainer/docker-compose-macm1.yml
version: '3'
services:
app:
build:
context: .
dockerfile: nodejs/Dockerfile
args:
# Update 'VARIANT' to pick an LTS version of Node.js: 16, 14, 12.
# Append -bullseye or -buster to pin to an OS version.
@ssv445
ssv445 / resume.json
Created May 2, 2023 12:19
resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Shyam Sunder Verma",
"label": "Lead & Manager, Full Stack Team",
"image": "",
"email": "er.ssverma@gmail.com",
"phone": "9982231113",
"url": "",
"summary": "Shyam is passionate​ to​ problem solving, he eagerly learn​s and adapt to​ solve​ problems. \nHe leads his team by example and firmly believes in empathy & innovation driven teams.\nHe​ represented Ready Bytes in the​ delegation​ of​ NASSCOM’s​ first​ India-US​ Startup​ Konnect​. (2015)\n\nShyam founded Ready Bytes in 2009. In last 12 years it have built more than 10+ web/mobile products. \n● PayPlans: Worlds #1 Joomla Payment Component (2009-2017, Sold)\n● Products Review​ Analysis & Recommendation Engine​ ReadyViews​ (2015-2018 Shutdown)\n● Exchange​ Rate​ analysis​ platform​ ExchangeRateIQ​ (2016-2018, Sold)\n● 15+​ mobile​ apps​ in​ last​ years (2015-Present)\n\nReady Bytes have worked for clients as well
@ssv445
ssv445 / git-merge-other-branch-in-current.sh
Last active April 4, 2023 05:36
Merge other branch into your current branch
#!/bin/bash
parent_branch="${1:-master}"
# Check if the current branch has any uncommitted changes
if [[ $(git status --porcelain) ]]; then
echo "Error: The current branch has uncommitted changes. Please commit or stash them before running this script."
exit 1
fi
@ssv445
ssv445 / git-format-php.sh
Created April 4, 2023 05:16
Only Format files which were changed by your branch/PR
#!/bin/bash
parent_branch="${1:-master}"
# Switch to the root directory of the Git repository
cd "$(git rev-parse --show-toplevel)"
# Check if there are any uncommitted changes
if [[ -n $(git status -s) ]]; then
echo "There are uncommitted changes in the branch. Please commit or stash them before running this script."
@ssv445
ssv445 / caddy.conf
Created July 1, 2022 04:08
Auto SSL for Tenant Domains for a SaaS Service
# for checking if it belongs ot our domain list
{
email myemail@example.test
on_demand_tls {
ask https://api.example.test/check-domain
interval 2m
burst 5
}
}
@ssv445
ssv445 / vue-index.html
Created January 5, 2022 06:48
Showing loading counter in Vue App, while Vue App is not loaded. Also show reload app buttong after few seconds, and force autoload the page after 60 seconds.
<script>
let notLoadedFor = 1;
let loadingElementId = 'loading-counter';
function reloadVueApp() {
var path = window.location.href + "?reset=true&ver=" + Math.random().toString(36).substring(2);
window.location.href = path;
};
const interval = setInterval(function() {
let el = document.getElementById(loadingElementId);
@ssv445
ssv445 / rn-host.js
Created January 5, 2022 06:43
Interact to react native wrapper app from your web-app using message passing.
function rnIsMobileApp() {
// check website open in browser or mobile app
return window.ReactNativeWebView !== undefined;
}
// Returns if a value is a string
function rnIsString(value) {
return typeof value === 'string' || value instanceof String;
}
@ssv445
ssv445 / .htaccess
Last active August 6, 2020 13:05
Laravel Apache hide .env and several security settings via .htaccess
# Disable Directory listing
Options -Indexes
# block files which needs to be hidden // in here specify .example extension of the file
<Files ~ "\.(env|json|config.js|md|gitignore|gitattributes|lock)$">
Order allow,deny
Deny from all
</Files>
# in here specify full file name sperator '|'
<?php
namespace App\Sk\Session;
use App\Sk\SkApi;
use Carbon\Carbon;
use App\Sk\SkModel;
use App\Sk\SkPayload;
use App\Sk\User\User;