Skip to content

Instantly share code, notes, and snippets.

View yrch1's full-sized avatar

David Ortega yrch1

View GitHub Profile
@yrch1
yrch1 / gist:feef1e2d6f5df6360f3648fe00d8b64f
Last active February 3, 2024 17:06
Cleanup and Prevent .DS_Store Files in Git Repository
# Navigate to your repository's root directory
cd /path/to/your/repository
# Remove all .DS_Store files from the repository
find . -name .DS_Store -print0 | xargs -0 git rm --cached --ignore-unmatch
# Commit the removal of .DS_Store files
git commit -m "Remove .DS_Store files"
# Push the changes to GitHub
@yrch1
yrch1 / LargestDBs
Created April 27, 2021 06:39 — forked from craigtp/LargestDBs
List the largest databases on a SQL Server instance
SELECT DB_NAME(database_id) AS DatabaseName,
Name AS Logical_Name,
Physical_Name, (size*8)/1024 SizeMB
FROM sys.master_files
ORDER BY SizeMB DESC
@yrch1
yrch1 / largestTables.sql
Created April 27, 2021 06:37
List 10 largest tables in SQL Server
select top 10 schema_name(tab.schema_id) + '.' + tab.name as [table],
cast(sum(spc.used_pages * 8)/1024.00 as numeric(36, 2)) as used_mb,
cast(sum(spc.total_pages * 8)/1024.00 as numeric(36, 2)) as allocated_mb
from sys.tables tab
join sys.indexes ind
on tab.object_id = ind.object_id
join sys.partitions part
on ind.object_id = part.object_id and ind.index_id = part.index_id
join sys.allocation_units spc
on part.partition_id = spc.container_id
@yrch1
yrch1 / FindColumnInDatabase.sql
Created January 13, 2018 09:41 — forked from DoubleBrotherProgrammer/FindColumnInDatabase.sql
Find column across all SQL Server databases
/* Find column in all databases */
DECLARE @db_name varchar(100),
@col_name varchar(100),
@sql_statement nvarchar(MAX)
-- column you are looking for
SET @col_name = 'PLANNED_SAMPLE_ID'
-- fill cursor with database names
@yrch1
yrch1 / forever.md
Created September 6, 2016 06:47 — forked from nickleefly/forever.md
forever your node app

Install Forever:

npm install forever -g

now your can run forever

forever --help
forever start app.js
@yrch1
yrch1 / Advertize.java
Created June 24, 2016 06:57 — forked from rafaeltuelho/Advertize.java
Utility class to test JBoss mod_cluster Advertize protocol communication...
/*
* Copyright(c) 2010 Red Hat Middleware, LLC,
* and individual contributors as indicated by the @authors tag.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.