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 PyPDF2 import PdfFileWriter, PdfFileReader | |
import os | |
import shutil | |
def splitpdf(pdf_name_to_split, form_page_count=1): | |
print(f'Splitting {pdf_name_to_split}') | |
dir_path = os.path.dirname(os.path.realpath(__file__)) + '/' | |
input_file_name = pdf_name_to_split | |
input_pdf = PdfFileReader(input_file_name) |
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
{"lastUpload":"2021-12-26T21:49:29.862Z","extensionVersion":"v3.4.3"} |
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
@echo off | |
:: --HAS ENDING BACKSLASH | |
set batdir=%~dp0.. | |
:: --MISSING ENDING BACKSLASH | |
:: set batdir=%CD% | |
pushd "%batdir%" | |
set rootPath=%cd% | |
rem @echo off | |
set srcdir=%rootPath%/Src |
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
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE OR ALTER PROCEDURE [dbo].[uspBatchCodeExecByHourCodeGen] ( @CodeTemplate VARCHAR(MAX), @MIN DATETIME=NULL, @MAX DATETIME=NULL, @TimeSpanHours INT=3, @DebugOnly BIT=0 ) | |
AS | |
BEGIN | |
SET NOCOUNT ON; | |
/* | |
Example Call: |
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
SELECT t.full_name, last_touched_date FROM | |
(SELECT (SCHEMA_NAME(schema_id)+'.'+name) AS full_name FROM sys.tables ) t | |
LEFT OUTER JOIN | |
(SELECT DB_NAME(sddius.[database_id]) AS [db name], | |
OBJECT_NAME(sddius.[object_id]) AS [Table/View], | |
OBJECT_SCHEMA_NAME(sddius.[object_id], sddius.[database_id]) AS [schema], | |
(OBJECT_SCHEMA_NAME(sddius.[object_id], sddius.[database_id]) +'.'+OBJECT_NAME(sddius.[object_id])) AS full_name, | |
sddius.[index_id], | |
sddius.[user_seeks] + sddius.[user_scans] + sddius.[user_lookups] AS [user reads], |
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
if (object_id('tempdb..##RVDEBUG','U') is not null) BEGIN | |
drop table ##RVDEBUG; | |
PRINT 'DROPPING ##RVDEBUG' | |
END | |
IF (object_id('tempdb..##RVDEBUG','U') is null) BEGIN | |
CREATE TABLE ##RVDEBUG | |
(EventDateTime DATETIME NULL, CallingModule varchar(512) NULL,SysUser VARCHAR(100) NULL,EventDescription varchar(6000) NULL) | |
INSERT INTO ##RVDEBUG VALUES(GETUTCDATE(),'System' ,CURRENT_USER, 'Starting') | |
END |
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
public static class DatabaseExtensions | |
{ | |
static Regex underscore = new Regex(@"(^|_)(.)"); | |
static string convertName(string s) | |
{ | |
return underscore.Replace(s.ToLower(), m => m.Groups[0].ToString().ToUpper().Replace("_", "")); | |
} | |
static T ToObject<T>(this IDataRecord r) where T : new() | |
{ |
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
-- * * * * * * * * Print command alternative * * * * * * * * * * * | |
DECLARE @NOTE VARCHAR(8000) = ''; | |
SET @NOTE = 'Deleted records ' + CONVERT(VARCHAR, @@ROWCOUNT); RAISERROR (@NOTE, 10, 1) WITH NOWAIT; | |
-- * * * * * * * * Try..Catch.. Print command alternative * * * * * * * * | |
--BEGIN | |
SET NOCOUNT ON; | |
DECLARE @PMSG VARCHAR(8000) = ''; DECLARE @PROC VARCHAR(512) = 'SAMPLE: '; | |
BEGIN TRY | |
SELECT 'TEST' AS MSG INTO #TMP; |
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
CREATE TABLE ##ORPHANUSER | |
( | |
DBNAME VARCHAR(100), | |
USERNAME VARCHAR(100), | |
CREATEDATE VARCHAR(100), | |
USERTYPE VARCHAR(100) | |
) | |
EXEC SP_MSFOREACHDB' USE [?] | |
INSERT INTO ##ORPHANUSER |
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
with metadata as | |
( | |
select | |
utc.table_name, | |
utc.column_name, | |
replace(initcap(replace( lower(utc.column_name) ,'_',' ')),' ','') as column_name_clean, | |
initcap(replace( lower(utc.column_name) ,'_',' ')) as column_name_space, | |
rtrim(substr(utc.column_name,1,26),'_') as column_name_26, | |
case utc.data_type | |
when 'DATE' then 'DateTime' || DECODE(nullable, 'Y', '?', '') |
NewerOlder