Skip to content

Instantly share code, notes, and snippets.

View ssv445's full-sized avatar

Shyam Verma ssv445

View GitHub Profile
@ssv445
ssv445 / cloudSettings
Last active September 4, 2019 05:45 — forked from spencercarli/bd3d4befe38185704bf0fc875e9deed6|configuration.json
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-09-04T05:45:33.827Z","extensionVersion":"v3.2.9"}
@ssv445
ssv445 / gist:dfeda39756cf7bfe3f38550c50673dce
Created July 22, 2018 07:10 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

<?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;
@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 '|'
@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 / 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 / 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 / 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 / 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 / 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