Skip to content

Instantly share code, notes, and snippets.

View kamlekar's full-sized avatar
💭
Self refactoring

Venkateshwar kamlekar

💭
Self refactoring
View GitHub Profile
@kamlekar
kamlekar / form-submit.js
Last active February 1, 2024 15:16
Form submit - Hubspot edition
function callAjax(payload){
//- formSelector
//- portalId
//- formGUID
//- hideMessageTime
//- callback
//
var $form = $(payload.formSelector);
var form = $form[0];
var url = "https://api.hsforms.com/submissions/v3/integration/submit/" + payload.portalId + "/" + payload.formGUID
@kamlekar
kamlekar / updating-ubuntu-wsl.md
Last active March 31, 2022 18:41
Steps to do to avoid any issues while updating Ubuntu distro on WSL, windows 10

Sometimes Ubuntu fails to install some services which probably can be fixed by updating the Ubuntu distro, which was my case.

My case was aws-vault was throwing strange errors. Updating Ubuntu fixed it.

Here are the steps I did to make the Ubuntu update go smooth.

Note: Make sure you are running it as a non-root user

Note: $PATH resets when the terminal is reopened. To avoid this, register the $PATH changes in ~/.bashrc file. As mentioned here: stackoverflow. Example: echo 'export PATH=$PATH: /path/to/bin' >> ~/.bashrc or add export PATH=$PATH: /path/to/bin at the end of the .bashrc by opening it in a editor, sudo vi ~/.bashrc.

@kamlekar
kamlekar / Fresh setup on systems.md
Last active October 6, 2021 05:47
Fresh setup on systems

Softwares

"editor.fontFamily": "Fira Code",

@kamlekar
kamlekar / throttleDebounce,js
Created May 22, 2019 11:58 — forked from pavan-idapalapati/throttleDebounce,js
Debounce and throttle functions
function throttle(callback, limit) {
var tick = false;
return function () {
if (!tick) {
callback.call();
tick = true;
setTimeout(function () {
tick = false;
}, limit);
}
@kamlekar
kamlekar / dummy.css
Last active May 8, 2019 07:47
Responsive cards
body,html{
height: 100%;
padding: 0;
margin: 0;
}
.parent{
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
@kamlekar
kamlekar / hoisting.js
Last active November 30, 2018 10:56
Classic problem of hoisting.
var foo = 1;
function bar(){
if(!foo){
var foo = 10;
}
alert(foo);
}
bar();
@kamlekar
kamlekar / npm-python-issue-fix.md
Last active August 7, 2018 08:51
To upgrade npm installs from outdated node version to latest node version

open up a new cmd as administrator and run this command:

npm install --global --production windows-build-tools

then (this seems optional)

npm config set msvs_version 2015 --global
@kamlekar
kamlekar / sw-ang.md
Last active May 23, 2018 11:33
Adding Service worker to Angular 6 project
  • In package.json:

      dependencies: {
          ...
          "@angular/service-worker": "6.0.3",
          ...
      }
    
"use strict";
const gulp = require('gulp');
const sass = require('gulp-ruby-sass');
const prefix = require('gulp-autoprefixer');
const minifycss = require('gulp-minify-css');
const rename = require('gulp-rename');
const sourcemaps = require('gulp-sourcemaps');
const connect = require('gulp-connect');
const uglify = require('gulp-uglify');
@kamlekar
kamlekar / Android-setup.md
Last active December 30, 2017 04:25
Nativescript setup

Android SDK Path:

  • Open Android Studio
  • File -> Settings... -> Appearance & Behavior -> System Settings -> Android SDK
  • You should be able to see a field "Android SDK Location"

Environment variables to set:

set ANDROID_HOME= {location taken from top Android SDK path}