Skip to content

Instantly share code, notes, and snippets.

# Azure
Definitions:
- IaaS: A provider lets you host virtual machines, Docker instances or Kubernetes clusters and manages the that for you
- PaaS: A provider hosts a specific server technology for you and also manages the updates for that techology (eg. Amazon S3)
- SaaS: A provider hosts an application for you and also manages application updates
I prefer PaaS whenever possible because it reduces the complexity on my side and when the service doesn't work, their support
will know about the technology in question rather than just about the underlying infrastructure.
@jtheisen
jtheisen / create-database.sql
Last active October 7, 2022 08:29
Create Sql Server database with sensible collation
create database [name] collate Latin1_General_100_CI_AS_SC_UTF8
create database [name] collate Latin1_General_100_BIN2_UTF8
@jtheisen
jtheisen / ngen-msbuild.xml
Last active October 3, 2022 02:43
To be put in an AfterBuild task, it generates the necessary dummy files for ngen-ing a web application and gives the full shell commands to do it.
<!-- ngen -->
<Copy SourceFiles="$(MSBuildProjectDirectory)\Web.config" DestinationFiles="$(OutDir)$(AssemblyName).dummy.exe.config" />
<Copy SourceFiles="$(OutDir)$(AssemblyName).dll" DestinationFiles="$(OutDir)$(AssemblyName).dummy.exe" />
<GetFrameworkPath>
<Output
TaskParameter="Path"
PropertyName="FrameworkPath" />
</GetFrameworkPath>
<PropertyGroup>
<NgenUpdateCommand>&quot;$(FrameworkPath)\ngen.exe&quot; update</NgenUpdateCommand>
@jtheisen
jtheisen / boxstarter.ps1
Last active February 21, 2022 11:10
My boxstarter
# Install with this from IE:
# http://boxstarter.org/package/nr/url?https://gist.githubusercontent.com/jtheisen/59fef5b48bcb415c5d77a3b86363e240/raw/294d8808123f3f1281bd814a4628caf1f16e1ff1/boxstarter.ps1
# choco feature enable -n=allowGlobalConfirmation
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Disable-BingSearch
# Remove Skydrive from the explorer root
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
@jtheisen
jtheisen / .block
Created December 5, 2019 11:56 — forked from pbeshai/.block
Animate 100,000 points with regl - III
license: mit
height: 720
border: no
var rows = String.Join("", Enumerable.Range(1, 100).Select(i => $"<tr><td>row #{i}</td></tr>").ToArray());
var html = $@"
<div>
<table>
<thead>
<tr>
<td>header</td>
</tr>
</thead>
@jtheisen
jtheisen / Property.cs
Created January 25, 2019 09:56
Properties Utility
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
namespace Properties.Internals
{
public class PropertyPairHelper<T, S>
{
Get-ChildItem -Recurse -Include bin,obj |? { $_.FullName -inotmatch 'node_modules' } | foreach { Remove-Item -Recurse $_ }
create table #space ([table] nvarchar(255), [column] nvarchar(255) not null, [bytes] bigint null);
declare @sql varchar(max) = ''
declare @tablepattern as varchar(255) = '%'
declare @exclusionpattern as varchar(255) = ''
select @sql = @sql + 'insert into #space select ''' + t.name + ''', ''' + c.name + ''', sum(datalength([' + c.name + '])) as bytes from [' + t.name + '];'
from sys.columns c
inner join sys.tables t on c.object_id = t.object_id
inner join sys.schemas s on t.schema_id = s.schema_id
@jtheisen
jtheisen / Oauth.cs
Created June 18, 2018 11:25 — forked from DeskSupport/Oauth.cs
csharp Oauth and API Example
// TwitPic/OAuth.cs
//
// Code to do OAuth stuff, in support of a cropper plugin that sends
// a screen snap to TwitPic.com.
//
// There's one main class: OAuth.Manager. It handles interaction with the OAuth-
// enabled service, for requesting temporary tokens (aka request tokens), as well
// as access tokens. It also provides a convenient way to construct an oauth
// Authorization header for use in any Http transaction.
//