Skip to content

Instantly share code, notes, and snippets.

DECLARE @dbname sysname, @days int
SET @dbname = NULL --substitute for whatever database name you want (or just NULL to list all databases)
SET @days = -30 --previous number of days, script will default to 30
SELECT
rsh.destination_database_name AS [Database],
rsh.user_name AS [Restored By],
CASE WHEN rsh.restore_type = 'D' THEN 'Database'
WHEN rsh.restore_type = 'F' THEN 'File'
WHEN rsh.restore_type = 'G' THEN 'Filegroup'
WHEN rsh.restore_type = 'I' THEN 'Differential'
@zommarin
zommarin / assembly-commands.md
Created October 21, 2014 06:48
List contents of .NET DLLs and EXEs

Various command line tools that list contents of DLLs etc:

ildasm.exe /text .\bin\OpixTool.exe | clip

@zommarin
zommarin / CSharpLibs.md
Created December 3, 2014 12:47
Libraries for C#
@zommarin
zommarin / gist:1edc49ff460098d00c7c
Created February 10, 2015 14:31
Number rows in SQL Server using CTE
;WITH T AS (
SELECT
STEPNO,
Row_Number() OVER (PARTITION BY JOBNAME ORDER BY STEPNO) AS RN
FROM STEP
WHERE BR = '00'
)
UPDATE T
SET
STEPNO = RN
@zommarin
zommarin / gist:baeff9a111821d3e37ff
Last active August 29, 2015 14:15
Sublime Packages to have Installed
PowerShell
SideBarEnhancements
SublimeCodeIntel
@zommarin
zommarin / Resources.md
Last active August 29, 2015 14:15
Fibaro Lua Resources

https://gist.github.com/leeroybrun/9482703

http://www.fibaro.com/support - Standard support site. Got some materials http://www.fibarouk.co.uk/support/ - UK support site, More materials. http://www.fibarouk.co.uk/support/lua/brief-introduction-lua/ - Intro till Lua https://developer.fibaro.com/ - Registration required. Is in build-up state currently. Have some Lua and JSON API resources. http://www.lua.org/docs.html - Lua docs http://zwave-store.co.uk/about-z-wave/the-fibaro-system/intro-to-fibaro-lua-code

@zommarin
zommarin / URLs.md
Created February 17, 2015 16:39
Fibaro HC 2 REST API

/api/panels/event?from=1418655960&to=1424213940&type=time

/api/panels/history?from=1418655960&to=1424213940&type=time

@zommarin
zommarin / gist:1195238
Created September 5, 2011 15:23 — forked from shbaz/gist:1188369
git snippets
#
# Misc good to have commands when using git
#
# Setup user
git config --global user.name "First Last"
git config --global user.email first.last@domain.com
# Setup useful aliases
git config --global alias.ci commit
@zommarin
zommarin / gist:1236807
Created September 23, 2011 05:34 — forked from shbaz/gist:1188006
Size of tables in a SQL Server database
--
-- Count rows in all tables, display tables with rows
--
CREATE TABLE #T (
name NVARCHAR(255),
[rows] INT,
reserved NVARCHAR(255),
data NVARCHAR(255),
index_size NVARCHAR(255),
@zommarin
zommarin / gist:1236805
Created September 23, 2011 05:33 — forked from shbaz/gist:1188041
All objects not in dbo or sys schema
SELECT s.name, o.name, o.type, o.type_desc, s.schema_id
FROM sys.objects AS o
INNER JOIN sys.schemas AS s ON o.schema_id = s.schema_id
WHERE s.name NOT IN ( 'dbo', 'sys' )