Skip to content

Instantly share code, notes, and snippets.

@azborgonovo
azborgonovo / Delete a Team Project from TFS
Last active March 3, 2016 20:23
Delete a Team Project from your Team Foundation Service collection
"tfsdeleteproject.exe" located in C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
tfsdeleteproject.exe /force /collection:https://<YourCollection>.VisualStudio.com/DefaultCollection "My project name with spaces"
@azborgonovo
azborgonovo / Removing Work Items from TFS
Last active March 3, 2016 20:23
Permanently Removing Work Items from TFS
// http://msdn.microsoft.com/en-us/library/dd236908.aspx
// You must be a member of the Team Foundation Administrators security group or the Project Administrators security group for the team project collection.
cd %programfiles%\Microsoft Visual Studio 11.0\Common7\IDE
// On a 64-bit edition of Windows, replace %programfiles% with %programfiles(x86)%.
witadmin destroywi /collection:CollectionURL /id:id
@azborgonovo
azborgonovo / HtmlDecode.sql
Last active July 3, 2024 08:13
HtmlDecode in SQL
CREATE FUNCTION [dbo].[udf_HTMLDecode] (@text NVARCHAR(MAX))
RETURNS NVARCHAR(MAX) AS
BEGIN
DECLARE @vcResult NVARCHAR(MAX)
DECLARE @vcCrLf NVARCHAR(2)
DECLARE @siPos SMALLINT
DECLARE @vcEncoded NVARCHAR(7)
DECLARE @siChar SMALLINT
SET @vcCrLF = CHAR(13) + CHAR(10)
@azborgonovo
azborgonovo / StripHTML.sql
Last active March 3, 2016 17:06
SQL Server Function for stripping Html tags
CREATE FUNCTION [dbo].[udf_StripHTML](@HTMLText VARCHAR(MAX))
RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @Start INT
DECLARE @End INT
DECLARE @Length INT
SET @Start = CHARINDEX('<',@HTMLText)
@azborgonovo
azborgonovo / StickyNavigationBar.html
Last active March 27, 2023 20:47
Simple smart sticky navigation bar
<html>
<head>
<title>Simple Smart Sticky Navigation Bar</title>
<script src="https://code.jquery.com/jquery-2.1.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
//Calculate the height of <header>
//Use outerHeight() instead of height() if have padding
var aboveHeight = $('header').outerHeight();
@azborgonovo
azborgonovo / JQueryUIOverlay.js
Last active March 3, 2016 17:07
Javascript code too show a JQuery UI overlay widget
var $overlay = $('<div class="ui-widget-overlay"></div>').hide().appendTo('body');
// $overlay.width($(document).width());
// $overlay.height($(document).height());
$overlay.fadeIn();
$(window).resize(function () {
$overlay.width($(document).width());
$overlay.height($(document).height());
});
@azborgonovo
azborgonovo / Table2Excel.js
Last active March 3, 2016 17:08
Crossbrowser HTML to Excel (adapted table2excel)
//table2excel.js
; (function ($, window, document, undefined) {
var pluginName = "table2excel",
defaults = {
exclude: ".noExl",
name: "Table2Excel"
};
// The actual plugin constructor
function Plugin(element, options) {
git remote add github https://github.com/Company_Name/repository_name.git
git push github master
@azborgonovo
azborgonovo / BindLoginUser.sql
Last active March 3, 2016 17:08
Bind Login User on SQL Server
ALTER USER csg WITH LOGIN = csg
@azborgonovo
azborgonovo / Validation.cs
Last active July 17, 2020 22:01
Validation in C# with System.ComponentModel
public interface IObjectValidator<T>
{
IEnumerable<ValidationResult> Validate(T @object);
}
public bool Validate(T objeto, out ICollection<ValidationResult> results)
{
var validationResults = new List<ValidationResult>();
// Default validation