Skip to content

Instantly share code, notes, and snippets.

View DuncanWilder's full-sized avatar

Duncan Wilder DuncanWilder

View GitHub Profile
@DuncanWilder
DuncanWilder / normalize-reset.css
Last active January 25, 2020 14:58
normalize-reset.css
// Reset padding, margins, and get everything to use box-sizing: border-box
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
// Remove touch delay on mobile devices (where the browser is waiting 300ms for a double tap)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>if, else, switch, object</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@DuncanWilder
DuncanWilder / Wrap window object for testing.js
Created April 13, 2017 09:14
Wrap window object for testing
function $window() {
function wrapperFunction(value) {
return value;
}
return wrapperFunction(window);
}
@DuncanWilder
DuncanWilder / contenteditable.html
Last active April 20, 2023 15:42
Pressing enter/return on a contenteditable div places this into the html
contenteditable
Pressing enter/return on a contenteditable div places this into the html
Fix: http://jakiestfu.github.io/Medium.js/docs/ or http://stackoverflow.com/questions/18552336/prevent-contenteditable-adding-div-on-enter-chrome
Firefox: <br>
Chrome: <div><br></div> (<div>With text</div>)
Safari: <div><br></div> (<div>With text</div>)
IE11: <p><br></p> (<p>With text</p>)
IE10: <p>&nbsp;</p> (<p>With text</p>)
@DuncanWilder
DuncanWilder / List of temporary email domains
Last active November 19, 2022 08:24
List of temporary email domains
0-mail
815
845
0clickemail
0sg
0wnd
10mail
10minut
10minutemail
@DuncanWilder
DuncanWilder / List of personal email domains
Created August 12, 2015 11:02
List of personal email domains
aol
arnet
att
bellsouth
blueyonder
bt
btinternet
charter
comcast
cox
@DuncanWilder
DuncanWilder / generic email prefixes
Last active November 16, 2015 14:20
generic email prefixes
accountancy
accounts
actuarial
adec
admin
adminaei
administrator
adsrecruitment
alf.recruiting
applications
@DuncanWilder
DuncanWilder / camera.sh
Last active August 29, 2015 14:21
Raspberry Pi Timelapse camera script
#!/bin/bash
for number in 1 2
do
# Time of photo
DATE=$(date +"%Y-%m-%d %H:%M:%S")
# Name and location to photo
FILE="/home/pi/camera/$DATE.jpg"
@DuncanWilder
DuncanWilder / gist:277e6c2e5d0f2c9f4b8e
Created April 9, 2015 14:42
Extensive Stopword list
'tis
'twas
a
aah
aaron
abandon
abandoned
abbott
abby
abe
@DuncanWilder
DuncanWilder / gist:e051b7d04e31df9e8652
Last active September 1, 2015 10:54
Ultimate generic stopwords list
'll
've
a
a's
able
about
above
abroad
abst
accordance