By using ReturnType
we don't have to manually write type for Context
See also gist for SolidJS https://gist.github.com/JLarky/a46055f673a2cb021db1a34449e3be07
And original tweet https://twitter.com/JLarky/status/1554152932425117697
name: example action | |
on: | |
push: | |
branches: [ dev ] | |
pull_request: | |
branches: [ master ] | |
jobs: |
<html> | |
<body> | |
<div class="has-emoji">Hello world! I'm a unicorn: 🦄</div> | |
<script> | |
// Stolen from Modernizr: https://github.com/Modernizr/Modernizr/blob/v3.5.0/feature-detects/emoji.js | |
const hasEmojiSupport = () => { | |
var pixelRatio = window.devicePixelRatio || 1; | |
var offset = 12 * pixelRatio; | |
var node = document.createElement('canvas'); |
By using ReturnType
we don't have to manually write type for Context
See also gist for SolidJS https://gist.github.com/JLarky/a46055f673a2cb021db1a34449e3be07
And original tweet https://twitter.com/JLarky/status/1554152932425117697
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
Examples here use the default settings, see the VidStab readme on GitHub for more advanced instructions.
Here's an example video I made
brew install ffmpeg --with-libvidstab
/* | |
* Join the elements in an javascript array, | |
* but let the last separator be different eg: `and` / `or` | |
* Stackoverflow link: http://stackoverflow.com/questions/15069587/is-there-a-way-to-join-the-elements-in-an-js-array-but-let-the-last-separator-b | |
* Credit: Chris Barr - http://stackoverflow.com/users/79677/chris-barr | |
*/ | |
function formatArray(arr){ | |
var outStr = ""; | |
if (arr.length === 1) { | |
outStr = arr[0]; |
#!/usr/bin/env bash | |
# Source: https://gist.github.com/fritz-c/c1e528b09bc1c0827a3c | |
# Original: https://gist.github.com/jordan-brough/48e2803c0ffa6dc2e0bd | |
# Download this script as "git-recentco" (no extension), chmod it to be executable and put it in your | |
# path somewhere (e.g. /usr/bin). You can then use it via `git recentco` from inside any git repo. | |
# Example: | |
# |
This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.
A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:
var mongoObjectId = function () { | |
var timestamp = (new Date().getTime() / 1000 | 0).toString(16); | |
return timestamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, function() { | |
return (Math.random() * 16 | 0).toString(16); | |
}).toLowerCase(); | |
}; |