Skip to content

Instantly share code, notes, and snippets.

@danroot
danroot / Startup.cs
Last active Aug 21, 2021
Use WsFederation in ASP.NET Core 2.0
View Startup.cs
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.StaticFiles;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.WsFederation;
using System.Xml.Linq;
@danroot
danroot / ColorTheWeather.groovy
Last active Dec 26, 2017
SmartThings:Color the Weather
View ColorTheWeather.groovy
/*
Color the weather
Daniel Root
www.danielroot.info
Should work (but not yet tested with) Phillips Hue devices and any SmartThings device that supports "capability.colorControl".
See https://codebender.cc/sketch:28062 for Arduino code that works with the Arduino SmartShield.
*/
preferences {
section("Check the weather in"){
@danroot
danroot / frostedglass.js
Created Nov 27, 2017
frosted glass effect
View frostedglass.js
<script src="//cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
<script src="//rawgit.com/abduzeedo/ios7-blur-html5/master/js/StackBlur.js"></script>
var getElementOffset = function (element) {
var de = document.documentElement;
var box = element.getBoundingClientRect();
var top = box.top + window.pageYOffset - de.clientTop;
var left = box.left + window.pageXOffset - de.clientLeft;
return { top: top, left: left };
};
@danroot
danroot / AngularJsHtmlBundle.cs
Last active Jun 23, 2017
AngularJS v1 Template Bundler
View AngularJsHtmlBundle.cs
using System.Web.Optimization;
namespace Company.Web.UI
{
public class AngularJsHtmlBundle : Bundle
{
public AngularJsHtmlBundle(string moduleName, string virtualPath)
: base(virtualPath, null, new[] { (IBundleTransform)new AngularJsHtmlCombine(moduleName) })
{
@danroot
danroot / index.html
Last active Jun 1, 2016
Enter, Trello Dojo Status Board Starter Page. This page contains everything you need to stand up a page that shows time, StatusCake, Weather Underground, and Trello information. You may customize it as needed to fit your screen sizes and organization's needs. To learn more, check out http://leanpub.com/trellodojo
View index.html
<!DOCTYPE html>
<html>
<head>
<title>Status Board</title>
<script type="text/javascript">
//TODO:Fill out the information below to configure your board.
//This page contains everything you need to stand up a page that shows time, StatusCake,
//Weather Underground, and Trello information. To learn more, check out http://leanpub.com/trellodojo
//You may customize it as needed to fit your screen sizes and organization's needs.