Skip to content

Instantly share code, notes, and snippets.

View sarveshshejwadkar's full-sized avatar

Sarvesh Shejwadkar sarveshshejwadkar

  • Srijan
  • Goa
View GitHub Profile
@sarveshshejwadkar
sarveshshejwadkar / not-waiting-async-call.js
Last active September 15, 2022 09:12
not waiting async call
function resolveAfter2Seconds() {
return new Promise(resolve => {
setTimeout(() => {
resolve('resolved');
}, 2000);
});
}
async function asyncCallWithAwait() {
let promiseArray = [];
(function(){
console.log('checkSystemRequirements');
console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
// it's option if you want to change the WebSDK dependency link resources. setZoomJSLib must be run at first
// if (!china) ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.7/lib', '/av'); // CDN version default
// else ZoomMtg.setZoomJSLib('https://jssdk.zoomus.cn/1.7.7/lib', '/av'); // china cdn option
// ZoomMtg.setZoomJSLib('http://localhost:9999/node_modules/@zoomus/websdk/dist/lib', '/av'); // Local version default, Angular Project change to use cdn version
ZoomMtg.preLoadWasm();
@sarveshshejwadkar
sarveshshejwadkar / only-first-letter-caps.html
Last active November 14, 2019 05:59
only first letter caps in a sentence
<script src="https://code.jquery.com/jquery-3.4.1.js"></script>
<input type="text" id="firstName" name="firstName" value="" />
<input type="text" id="lastName" name="lastName" value="" />
<script>
$('#firstName').blur(function() {
var str = $(this).val();
var words = str.split(' ');
var newSent = '';
for (word of words) {
var newWord = word;
{
"show_debug": true,
"phpcs_php_prefix_path": "C:\\xampp\\php\\php.exe",
"phpcs_commands_to_php_prefix": ["Fixer"],
"phpcs_executable_path": "C:\\Users\\Administrator\\AppData\\Roaming\\Composer\\vendor\\bin\\phpcs.bat",
"phpcs_additional_args": {
@sarveshshejwadkar
sarveshshejwadkar / scrollToLinkUsingCookie.js
Last active November 26, 2016 15:49
Scrolls to Text on Page without using Hash Link
jQuery(document).ready(function ($) {
function scrollBySubNav() {
// when link goes to different page, code keeps searching for text of clicked link
var tmr = setInterval( function () {
var foundElement = $('body').find('h1, h2, h3, h4, h5, h6').filter(':contains("' + Cookies.get('clicked-link') + '")');
if ( foundElement.length ) {
clearInterval(tmr);
$('.site-inner').animate({
scrollTop: foundElement.offset().top - 20
}, 1000);