Skip to content

Instantly share code, notes, and snippets.


Pavel Veller pveller

View GitHub Profile
pveller / pubsub.js
Last active August 23, 2022 07:41
AWS Amplify PubSub with IoT and Cognito
View pubsub.js
In order to subscribe to the AWS IoT topic over WS (over MQQT),
you have to make sure that your Cognito identity has a proper IoT policy attached to it.
More details and the message from the official AWS support:
This code shows how you can dynamically attach a policy to the authenticated identity.
Make sure that your Authenticated IAM in the Cognito User Pool has proper IoT permissions.
pveller / transcript.js
Last active April 11, 2017 16:34
Conversation Transcript with Bot Framework
View transcript.js
//
const transcript = function (session, direction, message, next) {
session.privateConversationData.transcript = session.privateConversationData.transcript || [];
timestamp: new Date().toUTCString()
View sitecore-text-classifier.ps1
$page = Get-Item -Path '/sitecore/content/Habitat/Home/Modules/Feature/Accounts'
$links = [Sitecore.Globals]::LinkDatabase
$processed = New-Object System.Collections.ArrayList
# template names of items that will be linked from the presentation field that are not datasources
$skip = @('Device','Layout','View rendering', 'Controller rendering', 'Test Definition', 'Multivariate Test Variable')
# shared and final layout
$layouts = @('{F1A1FE9E-A60C-4DDB-A3A0-BB5B29FE732E}', '{04BF00DB-F5FB-41F7-8AB7-22408372A981}')
pveller / sitecore-images-classifier.ps1
Created September 7, 2016 02:36
Using Microsoft Computer Vision API to automatically tag and describe Sitecore Habitat images (
View sitecore-images-classifier.ps1
$vision = ''
$features = 'Categories,Tags,Description,Color'
$images = Get-ChildItem -Path '/sitecore/media library/Habitat/Images/Square'
$result = @()
foreach ($image in $images)
# Reading the binary of the image so that we could send it to the Computer Vision API
$media_url = New-Object 'Sitecore.Resources.Media.MediaUri' $image
pveller / import.ps1
Last active May 17, 2019 09:05
Sitecore Content Import with Powershell
View import.ps1
function NormalizeName($name)
# replace all special symbols with single spaces
$name = $name -replace "[^a-zA-Z0-9]", " " -replace "\s+", ""
return $name.Trim()
pveller /
Created June 1, 2012 19:47
GWT Jetty Launcher to work with JNDI in the hosted mode (dev)
* Copyright 2008 Google Inc.
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
* Unless required by applicable law or agreed to in writing, software