Skip to content

Instantly share code, notes, and snippets.

View mikeplate's full-sized avatar

Mikael Plate mikeplate

View GitHub Profile
@mikeplate
mikeplate / web.config
Created August 14, 2018 09:32
ASP.NET and IIS 7+ configuration settings for upload limit
<!-- 50 MB limit -->
<system.web>
<httpRuntime maxRequestLength="51200" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="52428800" />
</requestFiltering>
</security>
@mikeplate
mikeplate / angular-recursive-sample.html
Last active July 26, 2018 16:08
Angular recursive template for tree structure
<!--
interface Organization {
name: string;
url: string;
children: Organization[];
}
org: Organization[];
-->
<div class="invid-tree">
<ng-template #recursiveList let-list>
@mikeplate
mikeplate / git-last-commit.ps1
Created November 22, 2017 08:16
PowerShell Git - show last commit date for all files in repository
git ls-files | % { "$(git log -1 --format="%ai" -- $_) $_" }
@mikeplate
mikeplate / AnimationHelpers.cs
Created March 16, 2017 18:21
WPF Animation Helpers when switching UI
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Animation;
public class AnimationHelpers
{
public static void Fade(UIElement incoming, UIElement outgoing, int seconds)
{
Storyboard story = new Storyboard();
@mikeplate
mikeplate / SharePointVersion.ps1
Created March 1, 2017 15:31
Show current version of SharePoint on-premise
# PowerShell script to display SharePoint products from the registry.
Param(
# decide on whether all the sub-components belonging to the product should be shown as well
[switch]$ShowComponents
)
# location in registry to get info about installed software
$RegLoc = Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall
@mikeplate
mikeplate / Reprovision.ps1
Created December 21, 2016 09:44
Reinstall SharePoint 2013 services after upgrade Windows Server 2012 to R2
$cfg = Get-SPServiceHostConfig
$cfg.Provision()
$services = Get-SPServiceApplication
foreach ($srv in $services) {
$srv.Provision()
Write-Host $srv.Name
}
@mikeplate
mikeplate / parsecsv.js
Last active December 19, 2016 09:39
Parse Comma/Tab Delimited Text In JavaScript
function parseCSV(src, sep) {
if (!sep) {
sep = "\t";
}
var data = [];
var isQuoteEscaped = false;
var row = [];
var value = "";
for (var i = 0; i < src.length; i++) {
var chr = src[i];
@mikeplate
mikeplate / search-all.sql
Created October 3, 2016 11:01
Search all tables and columns
CREATE PROC SearchAllTables
(
@SearchStr nvarchar(100)
)
AS
BEGIN
CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630))
SET NOCOUNT ON
@mikeplate
mikeplate / update-column.sql
Created September 5, 2016 06:17
Generate update script for single table and column
declare @id int
declare @imstkt char(1)
declare cur cursor local static read_only forward_only for
select id, jdeimstkt from models where jdeimstkt is not null
open cur
fetch next from cur into @id, @imstkt
while @@fetch_status = 0
begin
print 'update Models set jdeimstkt=' + convert(nvarchar(50), @imstkt) + ' where id=' + convert(nvarchar(50), @id)
@mikeplate
mikeplate / center.css
Created May 11, 2016 12:42
Center something in the middle of the web page
.centered {
position: fixed;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}