Skip to content

Instantly share code, notes, and snippets.

@deeja
deeja / RouteTableEntries.aspx
Last active June 15, 2017 15:59
Route Table Entry viewer - Useful for viewing MVC routes that have been added to the RouteTable - Built for Sitecore
<%@ Page Language="C#" Debug="true" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>RouteTable entries</title>
<style>
table, th, td {
@deeja
deeja / Install-Solr.ps1
Created April 29, 2019 10:34 — forked from jermdavis/Install-Solr.ps1
A PowerShell script to help installing Solr as a service - See https://jermdavis.wordpress.com/2017/10/30/low-effort-solr-installs/ for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
@deeja
deeja / SlackTeamNamesAndPhotos
Last active May 3, 2019 14:58
When you want an output of the members' names and photos of your slack team
//// SLACK group listing of people and photos!
/* Get the names and photos of the people in your slack group and prints to A4!
Instructions:
- Go to the web version of your slack channel
- Open the "Channel Details" tab
- Expand "members"
- Click the "See all people"
- Copy and paste this script into your JS console
- Scroll the members list up and down until all the members have been added to the array. You can see the count in the console
- Type show() to Show or print() to Print
@deeja
deeja / FindLessThan.cs
Created June 13, 2019 09:58
A Binary Search for the count of items that are less than a specified value
using System;
public class FindLessThanInOrderedList
{
public int ArrayCalls { get; private set; }
public int FindLessThanBinarySearch(int[] numbers, int lessThan, int startIndex = 0, int endIndex = -1)
{
if (endIndex == -1) endIndex = numbers.Length - 1;
if (endIndex - startIndex < 2)
@deeja
deeja / RaspberryPi-SSH-Bluetooth.md
Created October 7, 2019 20:56
The rapsberry pi part of connecting to a Raspberry Pi via Bluetooth SSH

Copied from https://hacks.mozilla.org/2017/02/headless-raspberry-pi-configuration-over-bluetooth/

Editing the image

Once you have the image mounted, and you are at the command prompt, you can start editing the configuration files necessary to get us going.

Let’s start by creating the main script that will set up and establish the default Bluetooth services and serial port you will connect to on startup.

You’ll create this file in the /home/pi directory, like so:

$ sudo nano /home/pi/btserial.sh
@deeja
deeja / DeploySitecoreArm.ps1
Last active October 15, 2019 09:45
Sitecore installation from XP ARM notes
# Taken from Sitecore-Azure-Quickstart-Templates
$ErrorActionPreference = "Stop" # So it just doesn't keep going if something goes wrong.
# Specify the parameters for the deployment
$ArmTemplateUrl = "https://raw.githubusercontent.com/Sitecore/Sitecore-Azure-Quickstart-Templates/master/Sitecore%209.0.2/XPSingle/azuredeploy.json"
$ArmParametersPath = $PSScriptRoot + "\azuredeploy.parameters.json"
$licenseFilePath = $PSScriptRoot + "\license.xml"
# Specify the certificate file path and password if you want to deploy Sitecore 9.0 XP or XDB configurations
$certificateFilePath = $PSScriptRoot + "\DEV-Cert.pfx"
@deeja
deeja / AzurePowershellSetConnectionStrings.ps1
Created October 16, 2019 15:18
Azure Powershell Set ConnectionStrings and App Settings
function UpdateConnectionStrings {
param(
[string]$ResourceGroup,
[string]$WebAppName,
[string]$Slot,
[hashtable]$ConnectionStrings,
[hashtable]$AppSettings
)
Write-Host "Loading Existing Connectionstrings"
@deeja
deeja / AWS-Iot-Blinkt.py
Created October 16, 2019 22:46
AWS IoT pushing through led colours on the Pi Zero Blinkt
# Need to set the policies for the subscribe and client ID within AWS
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import logging
import time
import argparse
import json
# > pip install blinkt
import blinkt
@deeja
deeja / Precompile.bat
Created October 18, 2019 17:19
Precompile Views using AspNet compiler
C:\windows\Microsoft.NET\Framework\v4.0.30319\aspnet_compiler.exe -v / -c -p C:\dev\src\Website\Website\code\obj\Release\Aspnet
CompileMerge\Source -u C:\dev\src\Website\Website\code\obj\Release\AspnetCompileMerge\TempBuildDir
@deeja
deeja / pages.json
Last active May 5, 2020 11:28
The content that generates the site danbl.com [Obsolete - Site now uses storyblok CMS]
[
{
"name":"About Me",
"slug":"",
"components":[
{
"type":"TextCard",
"content":"### Senior C# Developer\n\n I've been programming since the early 2000's, and almost all my projects have involved C# in some capacity. - Asp.NET (Forms, MVC, WebAPI) - .NET Standard / Core"
},
{