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/bash | |
#scan revision list for bug #s in the comments | |
#convert into comma separated values | |
bugs=`git log $1..$2 --pretty=oneline | grep -o " bug *[0-9]*" | \ | |
cut -d " " -f 3 | sort -n | uniq | while read x; do echo -n $x,; done;` | |
#strip final comma | |
bugs=${bugs%,} |
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
using System; | |
using EPiServer; | |
using EPiServer.Core; | |
using EPiServer.DataAccess; | |
using EPiServer.Security; | |
using EPiServer.Web.Hosting; | |
namespace EpiServerShine | |
{ | |
static internal class PageDataExtensions |
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
using System.Collections.Generic; | |
namespace util | |
{ | |
/// <summary> | |
/// Storage and parsing of flat string based folder hierarchy. | |
/// See http://stackoverflow.com/a/8621711/10245 | |
/// </summary> | |
/// <example><code> | |
/// NodeEntryCollection cItems = new NodeEntryCollection(); |
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
-- http://richarddingwall.name/2008/12/21/find-missing-foreignprimary-keys-in-sql-server/ | |
-- Find columns on tables with names like FooID or FooCode which should | |
-- be part of primary or foreign keys, but aren't. | |
SELECT | |
t.name AS [Table], | |
c.name AS [Column], | |
i.* | |
FROM | |
sys.tables t |
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
using System.Data.SqlClient; | |
using System.Reflection; | |
namespace HorribleThingsInHere | |
{ | |
/// <summary> | |
/// Workaround completely test-unfriendly sql error classes. | |
/// Copy-paste from http://stackoverflow.com/a/1387030/10245 | |
/// Adjusted with updates in comments | |
/// </summary> |
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
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
-- 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 + '_%' |