Skip to content

Instantly share code, notes, and snippets.

View jsturtevant's full-sized avatar
💻
right clicking and viewing the source

James Sturtevant jsturtevant

💻
right clicking and viewing the source
View GitHub Profile
h1.happy .happy{
color:green;
}
h1.sad .not{
color:red;
}
<span class="happy"><i class="fa fa-smile-o fa-2x"></i>Happy</span>
<br/>
@jsturtevant
jsturtevant / StartupTask.cs
Created March 24, 2016 14:07
Windows IoT 10 Servo Motor Example
// Copyright (c) Microsoft. All rights reserved.
// Modified and Licensed under MIT from https://github.com/ms-iot/samples
using Windows.ApplicationModel.Background;
using Windows.Devices.Gpio;
using System.Diagnostics;
using Windows.System.Threading;
// The Background Application template is documented at http://go.microsoft.com/fwlink/?LinkID=533884&clcid=0x409
namespace ServoMotorBasics
//usage
int height = Resources.DisplayMetrics.HeightPixels;
int width = _imageView.Height;
Bitmap bitmap = _file.Path.ResizeAndRotate(width, height);
@jsturtevant
jsturtevant / python2.7
Last active November 12, 2016 21:37
Python Cognitive Services Strongest Emotion
import httplib, urllib, base64
import json
def get_strongest_emotion(raw_result):
"""
Returns:
The strongest emotion in image or if there's multiple faces a list representing
strongest emotion in each face is returned.
MIT liscence for this function from https://github.com/zooba/projectoxford
"""
@jsturtevant
jsturtevant / Message.csx
Last active April 7, 2023 16:46
Azure IoT C2D Azure Function
public class DeviceMessage {
public string DeviceId {get;set;}
public string Message {get;set;}
}
@jsturtevant
jsturtevant / docker_windows_networking.cmd
Created June 16, 2017 15:31
Docker Windows Networking
docker network create -d nat jstest
docker network ls
docker network inspect jstest
docker run -itd --name js1 --net=jstest microsoft/nanoserver
docker run -itd --name js2 --net=jstest microsoft/nanoserver
docker ps
@jsturtevant
jsturtevant / launch.json
Created July 25, 2017 20:36
Azure Functions VS Code debugging scripts
{
"version": "0.2.0",
"configurations": [
{
"name": "Attach to Azure Functions",
"type": "node",
"request": "attach",
"port": 5858
},
{
@jsturtevant
jsturtevant / Dockerfile
Created December 8, 2017 17:04
Minecraft stateful windows 2016
FROM minecraft-server:nanoserver
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV EULA=TRUE `
ONLINE_MODE=FALSE `
SEED=-9363708386013540 `
VERSION=1.12.1 `
DIFFICULTY=peaceful `
GUI=FALSE `
@jsturtevant
jsturtevant / fluentd.conf
Last active May 21, 2019 16:09
simple fluentd conf
<source>
@type forward
</source>
<match test.**>
@type stdout
</match>
input { stdin { } }
output {
stdout { codec => rubydebug }
}