This file contains hidden or 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
| // heavily modified version of http://forums.asp.net/t/2011994.aspx | |
| ... | |
| WriteLine(""); | |
| WriteDocumentation(entity.Documentation);#> | |
| ... | |
| WriteDocumentation(edmProperty.Documentation, CurrentIndent); | |
| ... | |
| WriteDocumentation(complexProperty.Documentation); | |
| ... |
This file contains hidden or 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
| #!/bin/sh | |
| SKIP="noone" | |
| cd ~/repo/uk-it-recruiter-domains/ | |
| cat ~/Documents/config/sieve-part1.txt > ~/Documents/config/sieve.txt | |
| scripts/domains2sieve.py domains.txt | egrep -v "$SKIP|require" >> ~/Documents/config/sieve.txt | |
| gedit ~/Documents/config/sieve.txt & | |
| echo "skipped:" |
This file contains hidden or 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
| USE master; | |
| SET NOCOUNT ON | |
| GO | |
| -- Sql for simplifying and automating the process of loading/backing up multiple databases. | |
| -- Optionally override the restored db name. | |
| -- Also has proc for doing an upgrade of a backup file via an intermediate sql server version. | |
| -- The UI for backup/restore in ssms takes many clicks and doesn't remember anything, this | |
| -- script will allow you to codify repetive actions. |
This file contains hidden or 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
| /* | |
| Script to set the minimum id for all tables. | |
| Note that new tables get @baseId as the next id, tables that have had data in get @baseId+1. Ref http://stackoverflow.com/a/13303429/10245 | |
| */ | |
| set xact_abort on -- automatically rollback on error | |
| set nocount on -- make it easier to spot errors by reducing output verbosity | |
| BEGIN TRAN |
This file contains hidden or 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
| -- templates: | |
| -- table description: | |
| exec sys.sp_addextendedproperty @name=N'MS_Description', @level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', | |
| @level1name=N'TableNameHere', @value=N'Table description here' | |
| -- column description: | |
| EXEC sys.sp_addextendedproperty @name=N'MS_Description', @level0type=N'SCHEMA', @level0name=N'dbo', @level1type=N'TABLE', @level2type=N'COLUMN', | |
| @level1name=N'TableNameHere', @level2name=N'ColumnNameHere', @value=N'Column description here' |
This file contains hidden or 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
| # boxstarter script http://boxstarter.org/ | |
| # source: https://gist.github.com/timabell/608fb680bfc920f372ac | |
| # originally tested on win7 x64 | |
| # wip on win 10 | |
| # dotmatrix (windows branch) https://github.com/timabell/dotmatrix/tree/windows | |
| # powershell profile https://gist.github.com/timabell/56254968905f9066ef88c1ae774a53d1 | |
| # This is a start of a build of a box I'm using at the moment. | |
| # Fork this to your own gist, then comment/uncomment/add stuff to suit you. |
This file contains hidden or 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
| 'todo: handle empty properly, handle boolean true/false | |
| ' value - the value to turn into quoted and padded sql | |
| ' width - the largest item in this field, values will padded to fit. | |
| ' - use array formula =MAX(LEN(B290:B295)) to calculate this (ctrl-shift-enter to save an array formula) | |
| ' usage - apply this to all the cells you want to turn into sql, then concatenate the result in a final column | |
| ' like this =CONCATENATE(" (",P290,Q290,R290,S290,T290,U290,"),") | |
| function SqlQuoter(value, width) | |
| dim result as string | |
| dim padding as integer |
This file contains hidden or 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
| -- https://gist.github.com/timabell/d017038af96196b84e56 | |
| SELECT | |
| obj.name, | |
| fk.name | |
| FROM sys.foreign_keys fk | |
| inner join sys.objects obj on obj.object_id = fk.parent_object_id | |
| -- use this where clause to find FKs that aren't named after their table: | |
| where fk.name not like 'FK_' + obj.name + '_%' |
This file contains hidden or 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
| Chocolatey (v0.9.8.33) is installing 'VisualStudio2015Professional' and dependen | |
| cies. By installing you accept the license for 'VisualStudio2015Professional' an | |
| d each dependency you are installing. | |
| VisualStudio2015Professional v14.0.22823.0-RC | |
| Write-Error : Package 'VisualStudio2015Professional v14.0.22823.0-RC' did not i | |
| nstall successfully: The term 'Install-ChocolateyPackage' is not recognized as | |
| the name of a cmdlet, function, script file, or operable program. Check the spe | |
| lling of the name, or if a path was included, verify that the path is correct a | |
| nd try again. |
This file contains hidden or 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
| -- list indexes | |
| -- http://stackoverflow.com/a/428235/10245 | |
| -- https://gist.github.com/timabell/6da05a2b2542c907f179 | |
| select | |
| o.name as TableName, | |
| i.name as IndexName, | |
| i.type, | |
| i.is_unique, | |
| ic.key_ordinal as ColumnOrder, | |
| ic.is_included_column as IsIncluded, |