Skip to content

Instantly share code, notes, and snippets.

/*
Style the body element to change the background of the messenger. Here we're using an image, but
you can just as easily use a solid color or a gradient.
*/
body {
background: rgb(103,193,142);
background: linear-gradient(180deg, rgba(103,193,142,1) 0%, rgba(89,167,123,1) 100%);
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/lipis/[email protected]/css/flag-icons.min.css" media="none" onload="if(media!=='all')media='all'" />
@Bivek
Bivek / gist:3c470ed9153d6a099870019ef469bd85
Created March 12, 2024 01:30
MySQL Gem Install Workaround
# Getting clang error while installing mysql gem in macos
# Try this it might solve your issue or try trinity gem instead
gem install mysql2 -v '0.5.5' -- --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-ldflags="-L$(brew --prefix zstd)/lib -L$(brew --prefix openssl)/lib" --with-cppflags=-I$(brew --prefix openssl)/include
@Bivek
Bivek / gist:d6e8c66e7fcef8900168bfb2dc926b30
Last active March 5, 2024 09:27
MySQL command used for debugging the issue - Quick Ref
1. Show data lock held or requested (https://dev.mysql.com/doc/refman/8.0/en/performance-schema-data-locks-table.html)
mysql> SELECT * FROM performance_schema.data_locks
2. General information about tables
mysql> SHOW TABLE STATUS
3. Show table information
@Bivek
Bivek / gist:3114a4886677fcb293b4afae60c3720e
Last active January 31, 2024 05:09
Install Mysql2 gem on M1 chip
Working solution
-----------------
gem install mysql2 -v '0.5.5' -- --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config --with-ldflags="-L$(brew --prefix zstd)/lib -L$(brew --prefix openssl)/lib" --with-cppflags=-I$(brew --prefix openssl)/include
Better to use ```trilogy``` gem instead of ```mysql2``` for smooth setup process.
In your database.yml file update adapter to trilogy if you are using trilogy instead.
@Bivek
Bivek / gist:332243d78ffcefdcefdb0e00b3b0f3cb
Created October 19, 2023 02:03
Get all the tables count in MySQL
#STEP1: SET Max lenght according the need
SET group_concat_max_len = 40048;
#STEP2: Execute this to get the query that needs to be executed
SELECT left(tab, length(tab)-6) AS query
FROM (
SELECT GROUP_CONCAT(tab SEPARATOR ' ') AS tab
FROM (
SELECT CONCAT(
'SELECT "',
alias k="kubectl"
kubectl get deploy
kubectl get services
kubectl get svc
kubectl create deployment nginx-deployment --image=nginx
kubectl get pods
kubectl expose deployment nginx-deployment --port=8080 --port-target=80
kubectl get svc
minikube ip
ssh docker@<above-ip> (default password is tcuser)
@Bivek
Bivek / gist:de9a6e4b0440a6288a357f0d6f946b81
Created August 19, 2022 00:17
clean copy/paste rails console
IRB.conf[:USE_READLINE] = false
rails console -- --nomultiline
#defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false
#defaults write -g ApplePressAndHoldEnabled -bool false
@Bivek
Bivek / bash_strict_mode.md
Created June 1, 2022 06:02 — forked from vncsna/bash_strict_mode.md
set -e, -u, -o, -x pipefail explanation

set -e, -u, -o, -x pipefail

The set lines

  • These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing.
  • With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.
  • set -euxo pipefail is short for:
set -e
set -u