Skip to content

Instantly share code, notes, and snippets.

View winterstein's full-sized avatar

Daniel Winterstein winterstein

View GitHub Profile
@winterstein
winterstein / index.html
Created July 15, 2021 16:53
Simple Advert
<style>
@import url('https://fonts.googleapis.com/css2?family=Festive&display=swap');
</style>
<div id='box'>
<div id='bg'></div>
<img id='product' src='https://source.unsplash.com/dcPNZeSY3yk'>
<img id='person' src='https://source.unsplash.com/UOavP_Z38lE/800x450'>
<div id='tagline' class="text">Spring Sale!</div>
<div id='cta' class="btn btn-lg btn-outline-dark bg-light">Don't Miss It!</div>
@winterstein
winterstein / Enum.js
Created February 3, 2014 09:56
Javascript Enum
/**
* Make a bag of string constants, kind of like a Java enum.
* e.g. var Kind = new Enum('TEXT PERSON');
* gives you Kind.TEXT == 'TEXT', Kind.PERSON = 'PERSON'
*
* Each of the constants has an isCONSTANT() function added, so you can write:
* Kind.isTEXT(myvar) -- which has the advantage that it will create a noisy error if
* Kind.TEXT ceased to be a valid value, or if myvar is invalid.
*
* Use-case: It's safer than using strings for constants, especially around refactoring.