Skip to content

Instantly share code, notes, and snippets.

View KatrinaHoffert's full-sized avatar

Katrina Mitchell KatrinaHoffert

View GitHub Profile
object Language {
def langs: Try[Seq[Language]] = {
Try { val m = for {
l<- current.configuration.getConfig("langs")
a <- l.getConfig("mapping")
} yield a
m.get.keys.map { c=>Language(c, m.get.getString(c).get)}.toList.sortBy(_.c)}
}}

I'm getting the error from the title when attempting to deploy a VM. I'm using the .NET library. My code pretty much follows the MSDN article "Get Started with the Management Libraries for .NET" (which seems to have many flaws, as it does not work verbatim).

Deviations from that tutorial are:

  1. The method of AD auth described in the tutorial doesn't work ("the request body must contain the following parameter: 'client_secret or client_assertion'."), so I used certificate-based auth.
  2. The data center used in the tutorial apparently doesn't work for accounts on the free credit, so I'm using east Asia (for everything).
  3. For simplicity, I've created the storage account and service through the portal and am creating just the VM programmatically (eventually it'd all be made programmatically). I've tested making the service programmatically and that works fine. Although the storage account can't seem to be done ("the 'Authorization' header is not present or provided in an invalid format").

As an aside, wh

@KatrinaHoffert
KatrinaHoffert / training.md
Last active June 6, 2017 03:31
Danny's front end training

Creating pages from scratch

Your first big page

Your first goal is to recreate this page from scratch. Don't inspect the source! Try and create it on your own. Use google as much as you can for stuff you don't know, can't remember, or are unsure of. Really you just don't want to look at the source to see how they did it. Don't worry about mobile support yet. Focus on just emulating the desktop appearance.

Some considerations and advice

@KatrinaHoffert
KatrinaHoffert / mass_delete.py
Last active June 16, 2019 20:11
Mass deletes reddit comments by URL, editing them first, waiting, then removing for real
import praw
import sys
import time
# Setup
# 1. Install Python 3.6+ <https://www.python.org/downloads/> and PRAW
# <https://praw.readthedocs.io/en/latest/getting_started/installation.html>.
# 2. Create a script here <https://www.reddit.com/prefs/apps/> and
# set the script ID and secret below, as well as your username and
# password.