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
git remote prune origin | |
git reflog expire --expire=now --all | |
git gc --prune=now --aggressive |
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
git for-each-ref --format='%(refname)' | ForEach-Object { $size = git rev-list --disk-usage --objects HEAD..$_; Write-Output "$size $_" } | Sort-Object -D |
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
#!/usr/bin/env python | |
from datetime import datetime | |
import os | |
import requests | |
LOG = 'ip.log' | |
URL = 'https://ipinfo.io/ip' | |
try: |
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
using System; | |
using System.Diagnostics; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace TestWhenAll.Console | |
{ | |
public class Program | |
{ | |
public static void Main(string[] args) => MainAsync(args).GetAwaiter().GetResult(); |
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
-- Missing Index Script | |
-- Original Author: Pinal Dave | |
-- https://blog.sqlauthority.com/2011/01/03/sql-server-2008-missing-index-script-download/ | |
SELECT TOP 25 | |
dm_mid.database_id AS DatabaseID, | |
dm_migs.avg_user_impact*(dm_migs.user_seeks+dm_migs.user_scans) Avg_Estimated_Impact, | |
dm_migs.last_user_seek AS Last_User_Seek, | |
OBJECT_NAME(dm_mid.OBJECT_ID,dm_mid.database_id) AS [TableName], | |
'CREATE INDEX [IX_' + OBJECT_NAME(dm_mid.OBJECT_ID,dm_mid.database_id) + '_' | |
+ REPLACE(REPLACE(REPLACE(ISNULL(dm_mid.equality_columns,''),', ','_'),'[',''),']','') |
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
#CommentFlag // | |
#InstallKeybdHook | |
// Author: Jarvis Prestidge | |
// Description: Simulates my preferred keyboard layout, similiar to that of the Pok3r 60% keyboard | |
// on any keyboard without programmable keys. i.e. my laptop ^^ | |
// <COMPILER: v1.1.22.00> | |
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
DECLARE @birthday datetime; | |
set @birthday='1916-02-29T11:35:42.710'; | |
DECLARE @today datetime; | |
set @today='2015-03-01T11:35:42.710'; | |
declare @calc datetime; | |
set @calc=DAteadd(day,-1,DATEADD(year,year(@today)-YEAR(@birthday),@birthday)); | |
select @today as today,@birthday as birthday, @calc as calc, iif(CONVERT(date, @today)=CONVERT(date, @calc),1,0) |
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
--check and set auto_close | |
ALTER DATABASE [dbname] SET AUTO_CLOSE Off WITH NO_WAIT; | |
SELECT DATABASEPROPERTYEX('dbname', 'IsAutoClose'); | |
EXEC sp_MSforeachdb 'ALTER DATABASE [?] SET AUTO_CLOSE Off WITH NO_WAIT' | |