This Web Components keeps the year in your copyright notice up-to-date.
export { CopyrightYearElement }
const name = "copyright-year";
class CopyrightYearElement extends HTMLSpanElement {| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
| /* | |
| JavaScript Caesar shift | |
| by Evan Hahn (evanhahn.com) | |
| "Encrypt" like this: | |
| caesarShift('Attack at dawn!', 12); // Returns "Mffmow mf pmiz!" | |
| And "decrypt" like this: |
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).
| # remove .DS_Store file from GitHub that MAC OS X creates | |
| # find and remove .DS_Store | |
| find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch | |
| # create .gitignore file, if needed | |
| touch .gitignore | |
| echo .DS_Store > .gitignore | |
| # push changes to GitHub |