Add this file to your AI assistant's system prompt or context to help it avoid common AI writing patterns. Source: tropes.fyi by ossama.is
| 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:
- It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
- It is free, with no quotas.
- Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.