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
<%@ Page Language="C#"%> | |
<%@ Import namespace="System.IdentityModel.Tokens" %> | |
<% | |
Response.ContentType = "text/plain"; | |
string Token; | |
if((Token = Request.QueryString.Get("Token")) != null) | |
{ | |
Response.Write(new JwtSecurityToken(Token).Payload["scp"]); | |
} | |
%> |
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
CREATE PROC dbo.ImportTFSTable(@Owner varchar(100), @Table as varchar(100), @WithConfig as int = 0) | |
AS | |
declare @SQL varchar(max), @FieldSet varchar(max) | |
set @FieldSet = (select '[' + name + ']' as a from Tfs_DefaultCollection.sys.columns | |
where [object_id]=object_id('Tfs_Contracts.'+@Owner+'.'+@Table) | |
order by column_id | |
for xml path('')) | |
set @FieldSet = replace(substring(@FieldSet, 4, len(@FieldSet) - 7), '</a><a>', ',') | |
set @SQL = (select 'select {guid'''+cast(HostId as varchar(36))+'''} as CollID, ' + @FieldSet + ' from [' + replace(substring(DatabaseName, charindex(';', DatabaseName) + 1, 200), '"', '') + '].' + @Owner+ '.' + @Table as a |
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
create function dbo.FromUTF8(@s varbinary(max)) | |
returns nvarchar(max) | |
as | |
begin | |
declare @i int = 1, @n int = datalength(@s), @r nvarchar(max) = N'' | |
declare @c int, @c2 int, @c3 int, @c4 int, @u int | |
while @i <= @n | |
begin | |
set @c = ascii(substring(@s, @i, 1)) |
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
class Delta | |
{ | |
[StructLayout(LayoutKind.Sequential)] | |
private struct DELTA_INPUT | |
{ | |
public IntPtr lpcStart; | |
public UIntPtr uSize; | |
[MarshalAs(UnmanagedType.Bool)] | |
public bool Editable; | |
} |
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
unit MurMur; | |
interface | |
function MurmurHash64B(s: PAnsiChar; Len: Integer; Seed: UInt32) : UInt64; | |
implementation | |
function MurmurHash64B(s: PAnsiChar; Len: Integer; Seed: UInt32) : UInt64; | |
const | |
m = $5bd1e995; |
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
drop function if exists MurmurHash64B; | |
delimiter $$ | |
create function MurmurHash64B(s longblob, seed int unsigned) | |
returns bigint unsigned | |
deterministic no sql | |
begin | |
declare m int unsigned default 0x5bd1e995; | |
declare r int default 24; | |
declare len int default length(s); |
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
# Requires .NET 4.7.2+ or Core 2.0+ | |
# Basic parameters. For TLS certs for IIS, this is sufficient | |
$Hostname = "foo.example.com" # Goes into Subject as the CN | |
$AltHostnames = @("foo.example.com", "bar.example.com", "baz.example.com") # These go into Subject Alternative Name | |
$DNPostfix = "OU=IT;O=Acme;L=Chicago;S=Illinois;C=US" # What follows the CN in the Subject field. Optional! | |
$FriendlyName = "foo" # Optional but highly recommended | |
$TermDays = 3650 # Expiration date for the temporary self-signed cert. The CA will probably override the exp date anyway. | |
$CSRPath = "c:\\MyCert.csr" # Your path WILL vary. | |
$SaveUnderLocalMachine = $false # False for current user, true for local machine. |
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 Microsoft.Win32.SafeHandles; | |
using System.Diagnostics; | |
using System.Text; | |
using System; | |
using System.Threading; | |
namespace COMNET | |
{ | |
public class Program | |
{ |
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
#define INITGUID | |
#include <SDKDDKVer.h> | |
#define WIN32_LEAN_AND_MEAN | |
#include <windows.h> | |
#include <mfidl.h> | |
#include <mfapi.h> | |
#include <evr.h> | |
#include <cguid.h> | |
#include <propvarutil.h> | |
#include <comdef.h> |
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
param($Path, $Property, $Value) | |
$i = New-Object -COM "WindowsInstaller.Installer" | |
$db = $i.OpenDatabase($Path, 2) | |
$r = $i.CreateRecord(2) | |
$r.StringData(1) = $Value | |
$r.StringData(2) = $Property | |
$vw = $db.OpenView("update Property set Value=? where Property=?") | |
$vw.Execute($r) | |
$r = $null |