Skip to content

Instantly share code, notes, and snippets.

View sm-hejazi's full-sized avatar
🎯
Focusing

S.Mahdi sm-hejazi

🎯
Focusing
  • Monta
  • iran
View GitHub Profile
@sm-hejazi
sm-hejazi / gist:7b6f54dfd59aeb7acfe7a423b5a2190d
Created May 18, 2024 10:02
Find a string by searching all tables in SQL Server
USE DB_NAME
DECLARE @SearchStr nvarchar(100) = 'SearchText'
DECLARE @Results TABLE (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
DECLARE @TableName nvarchar(256), @ColumnName nvarchar(128), @SearchStr2 nvarchar(110)
SET @TableName = ''
SET @SearchStr2 = QUOTENAME('%' + @SearchStr + '%','''')
#!/bin/sh
git remote update
UPSTREAM=${1:-'@{u}'}
LOCAL=$(git rev-parse @)
REMOTE=$(git rev-parse "$UPSTREAM")
BASE=$(git merge-base @ "$UPSTREAM")
if [ $LOCAL = $REMOTE ]; then
@sm-hejazi
sm-hejazi / Sql_tbl-size
Created November 4, 2023 15:09
Calculate the size of all tables in the database in megabytes
-- Calculate the size of all tables in the database in megabytes
SELECT
t.NAME AS TableName,
p.rows AS RowCounts,
SUM(a.total_pages) * 8 / 1024 AS TotalSpaceMB,
SUM(a.used_pages) * 8 / 1024 AS UsedSpaceMB,
(SUM(a.total_pages) - SUM(a.used_pages)) * 8 / 1024 AS UnusedSpaceMB
FROM
sys.tables t
INNER JOIN
@sm-hejazi
sm-hejazi / .deps...remix-tests...artifacts...TestsAccounts.json
Created March 14, 2022 16:03
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.5.16+commit.9c3226ce.js&optimize=true&runs=200&gist=
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},