Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jsm85 on github.
  • I am jsm85 (https://keybase.io/jsm85) on keybase.
  • I have a public key ASACm5w3kliuGVE11JrA6on15ilUGaNlxVY4qbur0Nrg5Ao

To claim this, I am signing this object:

@jsm85
jsm85 / Get_Table_Column_Definitions.sql
Created April 25, 2016 14:06
A query to get all table and column definitions for a database
select distinct
ROW_NUMBER() over (Order by s.name, t.name) as Id,
s.name as SchemaName,
t.name as TableName,
c.name as ColumnName,
typ.name as DataType,
case c.precision
when 0 then 'Max'
else cast(c.precision as nvarchar(75))
end as DataTypeValue,
@jsm85
jsm85 / gist:d7370d5c7354bd165f14
Last active April 14, 2016 09:02
Database Sizes and Truncate Scripts
select
sd.dbid as DatabaseID,
sd.[name] as DatabaseName,
sd.crdate as CreationDate,
saf.[name] as DatabaseFile,
saf.[filename] as DatabaseFileLocation,
(saf.[size] * 8 / 1024) as [Size],
'USE MASTER BACKUP LOG ' + sd.[name] + ' WITH TRUNCATE_ONLY
GO USE ' + sd.[name] + ' DBCC SHRINKFILE(' + saf.[name] + ',100)
GO' as TruncateLog_Sql2008,
@jsm85
jsm85 / gist:409c7f33274d092205f1
Last active August 29, 2015 14:06
Database Table to Poco
declare @tableName nvarchar(75)
Select @tableName = ''
select
'public ' +
case c.system_type_id
when 127 then 'Int64'
when 108 then 'decimal'
when 56 then 'int'
when 52 then 'int'
@jsm85
jsm85 / Install.txt
Last active January 1, 2016 10:29
FirstBoxstarterScript
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Enable-RemoteDesktop
cinst fiddler4
cinst git-credential-winstore
cinst console-devel
cinst sublimetext2
cinst poshgit
cinst dotpeek
@jsm85
jsm85 / map.geojson
Created August 10, 2013 10:41
via:geojson.io
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class FooType
def *(other)
6
end
end
testing = DuckTyping.new
testing.ThisShouldInTheoryTakeInANumber FooType.new
testing = DuckTyping.new
testing.ThisShouldInTheoryTakeInANumber "4"
testing = DuckTyping.new
testing.ThisShouldInTheoryTakeInANumber 4
class DuckTyping
def ThisShouldInTheoryTakeInANumber (number)
puts "BEFORE ===> number is of type: " + number.class.to_s
number = number * 2
puts number
puts "AFTER ===> number is of type: " + number.class.to_s
end
end