Skip to content

Instantly share code, notes, and snippets.

View rathorevaibhav's full-sized avatar
👨‍💻
🎸 🍺

Vaibhav Rathore rathorevaibhav

👨‍💻
🎸 🍺
View GitHub Profile
@rathorevaibhav
rathorevaibhav / generateGradient.js
Last active October 1, 2020 06:30 — forked from babakhani/jsgradient
get array of color between two colors
function hexToRgb(hex){
var r, g, b, parts;
hex = hex.replace('#', '');
if(hex.length !== 3 && hex.length !== 6){
return [255,255,255];
}
if(hex.length == 3){
hex = hex[0]+hex[0]+hex[1]+hex[1]+hex[2]+hex[2];
}
r = parseInt(hex.substr(0, 2), 16);
@rathorevaibhav
rathorevaibhav / clean-branches.sh
Created May 26, 2021 10:32
Clean stale branches in git project
# clean stale branches except `master` and `develop`
alias clean-branches='git branch | grep -v "master\|develop" | xargs git branch -D'

Keybase proof

I hereby claim:

  • I am rathorevaibhav on github.
  • I am rathorevaibhav (https://keybase.io/rathorevaibhav) on keybase.
  • I have a public key ASBPxPzVsAUg6kVrX8QTcRg0k5UHEl1eBHiojwxMyTTtKwo

To claim this, I am signing this object:

@rathorevaibhav
rathorevaibhav / macos-windows.sql
Created July 13, 2022 06:39
Transforms SQL export from macOS to import into Windows
-- changing charset and utf types for macOS to Windows import
sed -i '' 's/utf8mb4_0900_ai_ci/utf8_general_ci/g' db.sql
sed -i '' 's/CHARSET=utf8mb4/CHARSET=utf8/g' db.sql
sed -i '' 's/utf8mb4_unicode_520_ci/utf8_general_ci/g' db.sql
sed -i '' 's/utf8mb4/utf8/g' db.sql