Skip to content

Instantly share code, notes, and snippets.

View costr's full-sized avatar
📈

Adam Costenbader costr

📈
View GitHub Profile
@costr
costr / Node-Red-WebScrapper_to_Home_Assistant_Example.js
Created June 29, 2019 15:10
As someone who fishes near Okoboji, IA I wanted fishing reports but I found that the IA DNR site had annoying modals and required several clicks to get what I wanted. Instead I wanted to compile the fishing information and pump the information into Home Assistant for faster digestion.
[
{
"id": "338f10b4.b5013",
"type": "tab",
"label": "Fishing",
"disabled": false,
"info": ""
},
{
"id": "c551c71b.11cd28",
@costr
costr / ExecutionBuilder.cs
Last active May 30, 2019 03:44
Retry Utility
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Configuration;
namespace Utiltiies
{
public class ExecutionBuilder
{
public static class RepositoryTestingHelper
{
public static DbSet<T> GetQueryableMockDbSet<T>(List<T> sourceList) where T : class
{
var dbSet = GetMockDbSet(sourceList);
return dbSet.Object;
}
public static Mock<DbSet<T>> GetMockDbSet<T>(List<T> entities) where T : class
{
private string RandomString
{
get
{
var path = String.Empty; // returns random string of 11 chars
for (int i = 0; i < 9; i++)
{
path += Path.GetRandomFileName();
}
return path.Replace(".", "");
@costr
costr / gist:894473fc982f59c23526
Created January 10, 2015 04:40
CSS CALC() Example
#pageTitle {
margin-left: 50px; width: calc(100% - 50px);
...
}