Skip to content

Instantly share code, notes, and snippets.

View speir-wang's full-sized avatar
🎯
Focusing

He Wang speir-wang

🎯
Focusing
  • REA Group
  • Melbourne
View GitHub Profile
@speir-wang
speir-wang / cloudSettings
Last active August 23, 2019 00:37
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-08-23T00:37:53.682Z","extensionVersion":"v3.4.1"}
@speir-wang
speir-wang / video-play.js
Last active November 11, 2022 03:46
Avoid the HTML5 video play button being displayed automatically on iPhone when the Low Power mode is turned on.
let videoBackground = document.getElementById("video-background");
var promise = videoBackground.play();
if (promise !== undefined) {
promise
.catch(error => {
// Auto-play was prevented
// Show a UI element to let the user manually start playback
console.log(error);
})
@speir-wang
speir-wang / _element.scss
Last active November 14, 2018 04:52
Change pseudo element properties with JavaScript
// SCSS
.element {
--dynamic-width: 0%;
width: 200px;
height: 200px;
background-color: #ccc;
margin: 0 auto;
&:after {
content: "";
@speir-wang
speir-wang / machine.js
Last active October 28, 2019 02:34
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions