Skip to content

Instantly share code, notes, and snippets.

View dontpaniclabsgists's full-sized avatar

Don't Panic Labs dontpaniclabsgists

View GitHub Profile
<input id="js-username-input" />
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 7.cs
Created June 29, 2019 03:28
Custom Configuration Sections 7
using System.Configuration;
namespace LearnConfigCollection
{
public class ServerSection : ConfigurationSection
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 6.cs
Created June 29, 2019 03:27
Custom Configuration Sections 6
var servers = ConfigurationManager.GetSection("servers") as ServerSection;
foreach (ServerElement server in servers.Instances)
{
if (!IsAlive(server.IpAddress))
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 5.cs
Created June 29, 2019 03:26
Custom Configuration Sections 5
<configuration>
<configSections>
<section name="servers"
type="LearnConfigCollection.ServerSection, LearnConfigCollection" />
</configSections>
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 4.cs
Created June 29, 2019 03:24
Custom Configuration Sections 4
var serverAddress1 = ConfigurationManager.AppSettings["Server1"];
if ( !IsAlive(serverAddress1) )
{
// Uh oh, server ONE is dead! Do something!
}
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 3.cs
Created June 29, 2019 03:23
Custom Configuration Sections 3
<appSettings>
<add key="Server1" value="192.168.1.1"/>
<add key="Server2" value="192.168.1.6"/>
<add key="Server3" value="192.168.1.14"/>
</appSettings>
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 2.cs
Created June 29, 2019 03:21
Custom Configuration Sections 2
var serverAddress = ConfigurationManager.AppSettings["Server"];
if ( !IsAlive(serverAddress) )
{
// Uh oh, dead server! Do something!
}
@dontpaniclabsgists
dontpaniclabsgists / Custom Configuration Sections 1.cs
Last active June 29, 2019 03:23
Custom Configuration Sections 1
<appSettings>
<add key="Server" value="192.168.1.1"/>
</appSettings>
@dontpaniclabsgists
dontpaniclabsgists / lamp_stack_on_windows_1.yml
Created December 19, 2017 00:54
lamp_stack_on_windows_1
version: "3.3"
services:
web:
image: richarvey/nginx-php-fpm:latest
container_name: web
links:
- db
ports:
- "80:80"
volumes:
@dontpaniclabsgists
dontpaniclabsgists / azure_functions_8_1.cs
Created December 4, 2017 16:18
azure_functions_8_1
"index": {
"matchCondition": {
"route": "/",
"methods": [
"GET"
]
},
"backendUri": "https://XXX.blob.core.windows.net/webapp/index.html"
},