Skip to content

Instantly share code, notes, and snippets.

View Kevin-Bronsdijk's full-sized avatar
😃
Happily writing code!

Kevin Bronsdijk Kevin-Bronsdijk

😃
Happily writing code!
View GitHub Profile
CREATE FUNCTION [dbo].[getCategoriesFlat] (
@ProductCategoryID INT
)
RETURNS VARCHAR(MAX)
AS
BEGIN
DECLARE @result VARCHAR(MAX);
WITH Hierarchy (ProductCategoryID, ParentProductCategoryID, Name, [Level], Flat)
@Kevin-Bronsdijk
Kevin-Bronsdijk / SQLServerConnectorAzureAPIAppPart2.sql
Created July 28, 2015 11:35
SQL Server Connector – Azure API App – Part 2
CREATE SCHEMA [Test]
GO
CREATE TABLE Test.CustomerA (
CustomerID int IDENTITY(1,1) NOT NULL,
FirstName nvarchar(25) NOT NULL,
LastName nvarchar(25) NOT NULL,
CompanyName nvarchar(100) NOT NULL,
Verified bit NOT NULL,
NeedToContact bit NOT NULL
@Kevin-Bronsdijk
Kevin-Bronsdijk / sea-mist-the-revenge-of-kraken-io.ps1
Created July 28, 2015 11:46
sea-mist-the-revenge-of-kraken-io
var connection = KrakenConnection.Create("xyz", "xyz");
// Create a client
var krakenClient = new KrakenClient(connection);
// Sample 1 wait response
var response = await krakenClient.OptimizeWait(
new Uri("http://cdn.devslice.net/blog/wp-content/uploads/2015/04/Microsoft-and-Elasticsearch.png")
);
@Kevin-Bronsdijk
Kevin-Bronsdijk / azure-logic-app-conditions-success-and-failure_1.json
Created July 28, 2015 12:39
azure-logic-app-conditions-success-and-failure
...
"conditions": [ {
"dependsOn": "name_of_the_action"
} ]
...
@Kevin-Bronsdijk
Kevin-Bronsdijk / azure-search-indexers-index-data-without-writing-code_1.sql
Created July 28, 2015 12:48
azure-search-indexers-index-data-without-writing-code
CREATE VIEW [SalesLT].[vProductAndDescriptionIndex]
WITH SCHEMABINDING
AS
-- View (indexed or standard) to display products and product descriptions by language.
SELECT
p.[ProductID] as [id]
,p.[Name]
,pm.[Name] AS [ProductModel]
,pmx.[Culture]
,pd.[Description]
@Kevin-Bronsdijk
Kevin-Bronsdijk / azure-search-indexers-index-data-without-writing-code_1.sql
Created July 28, 2015 12:52
azure-search-indexers-index-data-without-writing-code
CREATE VIEW [SalesLT].[vProductAndDescriptionIndex]
WITH SCHEMABINDING
AS
-- View (indexed or standard) to display products and product descriptions by language.
SELECT
p.[ProductID] as [id]
,p.[Name]
,pm.[Name] AS [ProductModel]
,pmx.[Culture]
,pd.[Description]
@Kevin-Bronsdijk
Kevin-Bronsdijk / azure-search-indexing-documents-using-tika.cs
Created July 28, 2015 13:01
azure-search-indexing-documents-using-tika
const string url = "http://download.microsoft.com/download/E/7/B/E7B25440-1569-40B5-989E-3951FC178214/Microsoft_Press_eBook_Introducing_HDInsight_PDF.pdf";
var textExtractionResult = new TextExtractor().Extract(new Uri(url));
@Kevin-Bronsdijk
Kevin-Bronsdijk / jaabaw-just-another-azure-blob-api-wrapper.ps1
Created July 28, 2015 13:09
jaabaw-just-another-azure-blob-api-wrapper
$G_SAN = "xyz"
$G_SAK = "xyz"
Get-Containers -StorageAccountName $G_SAN -StorageAccountKey $G_SAK
New-Container -StorageAccountName $G_SAN -StorageAccountKey $G_SAK -ContainerName "samplecontainer1"
Get-ContainerProperties -StorageAccountName $G_SAN -StorageAccountKey $G_SAK -ContainerName "samplecontainer1"
$Metadata = @{"x-ms-meta-test1"= "22222";"x-ms-meta-test2" = "111111"}
@Kevin-Bronsdijk
Kevin-Bronsdijk / kraken-image-optimizer-and-azure-blob-storage.ps1
Created July 28, 2015 13:14
kraken-image-optimizer-and-azure-blob-storage
# Azure details
$storageAccount = "storageAccount"
$storageKey = "storageKey"
$container_name = "blob container name"
# Kraken details
$uri = "https://api.kraken.io/v1/url"
$api_key = "kraken api key"
$api_secret = "kraken api secret"
$content_type_supported = "image/png", "image/gif", "image/jpeg"
@Kevin-Bronsdijk
Kevin-Bronsdijk / optimizing-wordpress-hosted-on-windows_1.xml
Created July 28, 2015 13:19
optimizing-wordpress-hosted-on-windows
<configuration>
<system.webServer>
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
<dynamicTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />