SELECT relname, heap_blks_read, heap_blks_hit,
(heap_blks_hit / NULLIF(heap_blks_hit + heap_blks_read, 0)) AS hit_ratio
FROM pg_statio_user_tables
ORDER BY hit_ratio ASC, heap_blks_read DESC
LIMIT 10;
-- hit_ratio: Represents the proportion of times data requested from a table was
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const darkColors = { | |
primary: { | |
25: '#0B101F', | |
50: '#101729', | |
75: '#142251', | |
100: '#182B6D', | |
200: '#1F3581', | |
300: '#284092', | |
400: '#304CA8', | |
500: '#3959C4', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from collections import defaultdict | |
LEADING = """MutexApplicationJob::LockAcquisitionError: Failed to acquire lock for key: FB_MESSAGE_CREATE_LOCK::""" | |
def get_logs(): | |
f = open('logs.json') | |
return json.load(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ColorHelper | |
def hex_to_rgb(hex_color) | |
# Remove the '#' character if it's there | |
hex_color = hex_color.tr('#', '') | |
# Split the hex color string into the RGB components | |
r = hex_color[0..1].to_i(16) | |
g = hex_color[2..3].to_i(16) | |
b = hex_color[4..5].to_i(16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ColorHelper | |
def hex_to_rgb(hex_color) | |
# Remove the '#' character if it's there | |
hex_color = hex_color.tr('#', '') | |
# Split the hex color string into the RGB components | |
r = hex_color[0..1].to_i(16) | |
g = hex_color[2..3].to_i(16) | |
b = hex_color[4..5].to_i(16) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time_zone = '<YourTimezone>' | |
account_id = '<YourAccountID>' | |
start_date = Time.zone.now - 12.days | |
end_date = Time.zone.now | |
a = Account.find(account_id) | |
outlier_events = a.reporting_events.where(created_at: start_date..end_date, name: 'conversation_resolved').order(value: :desc).limit(30) |
- Open Google Chrome and navigate to the website that you want to capture the HAR file for.
- Open the Developer Tools panel by pressing F12 or right-clicking anywhere on the page and selecting "Inspect".
- Click on the "Network" tab in the Developer Tools panel.
- Make sure the "Preserve log" option is selected. This will ensure that all network requests are captured in the HAR file.
- Refresh the page to start capturing the network traffic.
- Once the page has finished loading, right-click anywhere in the Network tab and select "Save as HAR with Content".
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Class to generate sample data for a chatwoot test @Account. | |
############################################################ | |
### Usage ##### | |
# | |
# # Seed an account with all data types in this class | |
# Seeders::AccountSeeder.new(account: Account.find(1)).perform! | |
# | |
# | |
############################################################ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
from pprint import pprint | |
import requests | |
import csv | |
const sitemap_url = '' | |
def get_pages_to_crawl(): | |
pages = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import razorpay | |
import os | |
import csv | |
from collections import OrderedDict | |
fieldnames = ("sr", "name", "member_name", "razorpay_token", "customer_id") | |
members = [] | |
with open("member.csv", "r") as csvfile: |
NewerOlder