Skip to content

Instantly share code, notes, and snippets.

View dsanders11's full-sized avatar

David Sanders dsanders11

View GitHub Profile
@dsanders11
dsanders11 / StringConstant.h
Last active February 15, 2023 21:53
An implementation of compile time string constants in C++14. The StringConstant class provides an intuitive interface for concatenating and comparing equality of the string constants. Heavily commented since example template code never seems to be.
#ifndef STRING_CONSTANT_H
#define STRING_CONSTANT_H
#include <cstddef>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
@dsanders11
dsanders11 / designer.html
Last active August 29, 2015 14:05
designer
<link rel="import" href="../core-animated-pages/core-animated-pages.html">
<link rel="import" href="../core-animated-pages/transitions/hero-transition.html">
<link rel="import" href="../core-animated-pages/transitions/cross-fade.html">
<link rel="import" href="../core-animated-pages/transitions/slide-down.html">
<link rel="import" href="../core-animated-pages/transitions/slide-up.html">
<link rel="import" href="../core-animated-pages/transitions/tile-cascade.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<polymer-element name="my-element">
@dsanders11
dsanders11 / dyndns_route53.py
Last active August 29, 2015 14:16 — forked from mariocesar/dyndns_route53.py
A script to use Route53 as a dynamic DNS like service
""" A script to use Route53 as a dynamic DNS like service
Requirements:
$ sudo pip install boto dnspython
Edit ~/.boto to use your AWS credentials
"""
@dsanders11
dsanders11 / storage.py
Created June 13, 2015 04:26
File storage backend for Django which adds the file contents hash to the filename (like CachedStaticFilesStorage)
import os
try:
# Django 1.7+
from django.contrib.staticfiles.storage import HashedFilesMixin
except:
from django.contrib.staticfiles.storage import (
CachedFilesMixin as HashedFilesMixin)
from django.core.files.storage import FileSystemStorage
@dsanders11
dsanders11 / index.html
Created May 26, 2021 03:40
Renderer `repl.start` Crash
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
@dsanders11
dsanders11 / index.html
Created June 6, 2021 08:22
'select-client-certificate' Test
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
@dsanders11
dsanders11 / index.html
Created June 7, 2021 12:50
interceptHttpProtocol Corruption
<!doctype html>
<body>
<h1>Loading</h1>
<script src="test.js"></script>
</body>
@dsanders11
dsanders11 / index.html
Created January 4, 2022 02:29
Windows BrowserWindow.restore Bug
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@dsanders11
dsanders11 / index.html
Created January 5, 2022 10:49
Unmaximize Shouldn't Unminimize
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
@dsanders11
dsanders11 / index.html
Created January 6, 2022 22:44
ShowInactive Shouldn't Restore Maximized
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>