Skip to content

Instantly share code, notes, and snippets.

<#
.SYNOPSIS
This script migrates DNS settings from an old Azure Public IP to a new Azure Public IP and cleans up old resources.
.DESCRIPTION
The script performs several operations in Azure:
1. It prompts the user for confirmation before proceeding, due to potential brief connectivity downtime.
2. Retrieves the DNS settings (Domain Name Label and FQDN) from the old Public IP.
3. Applies these DNS settings to the new Public IP.
4. Removes the old Load Balancer and Public IP after confirming with the user.
@Romiko
Romiko / azure-pipelines.yaml
Created April 2, 2020 10:01 — forked from chadmcrowell/azure-pipelines.yaml
CI/CD Lesson in Course "Build and Deploy Pipelines with Microsoft Azure"
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4
trigger:
- master
stages:
- stage: Build
@Romiko
Romiko / eventInterceptor.js
Created August 4, 2015 00:51
Javascript intercept events on an element using jquery _data.
(function () {
    var element = $('#design-tile-2')[0];
    var clicks = $._data(element).events.click;
    clicks.forEach(function (click) {
        var handler = click.handler;
        click.handler = function () {
            debugger;
            handler.apply(this, arguments);
@Romiko
Romiko / _PartialModal.cshtml
Last active August 29, 2015 14:20
Modal Dialog Box
<div class="modal-dialog modal-dialog--transition-zoom-fade js-modal-dialog s-templatestabmodal is-visible" aria-hidden="true" aria-labelledby="modal-dialog-title" aria-describedby="modal-dialog-description" role="dialog" data-cs-callback="finishOnboarding" data-cs-allowclose="true">
<div class="modal-dialog__anim-target">
<div class="modal-dialog__content">
<h1 id="modal-dialog-title" class="modal-dialog__heading">Want to create a campaign?</h1>
<p id="modal-dialog-description" class="modal-dialog__text">This is where you manage templates. If you want to create and send a campaign, the easiest way is to go to the campaigns tab.</p>
<div class="modal-dialog__tour">
<ul class="modal-dialog__tour__features js-modal-dialog-feature-target">
<li class="modal-dialog__tour__feature-item js-modal-dialog-feature-item">
<div class="demo-header">
<div class="demo-header__main">
using System;
using System.Collections.Generic;
using System.Diagnostics;
using DicomObjects;
using DicomObjects.Enums;
namespace SB.Shared.Dicom
{
public class DicomQueryManager : IDicomQueryManager
{
@Romiko
Romiko / InstallNServicebus.ps1
Created February 17, 2015 00:51
Powershell install NServicebus
#requires -version 2.0
param (
[parameter(Mandatory=$true)] [string]$password,
[string]$type = "Release",
[string]$profile = "NServiceBus.Production",
[string]$userName = "IPO\ServiceBus",
[array]$binfolders = @("SB.Pacs.Pollers","SB.Orders.ScannedDocuments", "SB.Billing.SaveOrderParts", "SB.OrderService.SaveOrders", "SB.Orders.ProcessDicomImages"), #The Order is important!
[bool]$sideBySide = $false #Install multiple version, won't uninstall existing service.
)
@Romiko
Romiko / FormBoundToScreen
Last active August 29, 2015 14:15
Windows Form - Keep bounded within the viewable part of a multiple screen/monitor configuration
private void DockFormIfOutOfViewableArea()
{
var widthTolerance = Location.X + (Width / 2);
var heightTolerance = Location.Y + (Height / 2);
Screen.AllScreens.OrderBy(r => r.WorkingArea.X).ForEach(screen =>
{
if (!IsOnThisScreen(screen)) return;
if (heightTolerance > screen.WorkingArea.Height)
Location = new Point(screen.WorkingArea.X, screen.Bounds.Height - Height + screen.Bounds.Y);
@Romiko
Romiko / RebuildIndexes
Created November 24, 2014 22:19
Rebuild Indexes
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET NOCOUNT ON
GO
IF (OBJECT_ID('RebuildIndexes') IS NOT NULL)
DROP PROCEDURE RebuildIndexes
GO
source 'https://rubygems.org'
gem 'paperclip'
gem 'aws-sdk'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
@Romiko
Romiko / ReportChanged.cs
Created August 1, 2014 01:40
PowerScribe Status
private void ReportChanged(string siteName, string accessionNumbers, int radWhereReportStatus, bool isaddendum, string plaintext, string richtext)
{
Logger.Debug("Report {0} Site:{1} AccessionNumber: {2} Status: {3}", ReportEvent.Changed, siteName, accessionNumbers, (RadWhereReportStatus)radWhereReportStatus);
if (PowerscribeStatus.UnknownOrPending == (PowerscribeStatus)radWhereReportStatus)
return;
Hub.Publish(HubEvents.DictationSystem.PSInterop.ReportChanged);
}