This serves as a quick reference and showcase of GitHub Flavored Markdown. For more complete info, see John Gruber's original spec and the Github-flavored Markdown info page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| A tiny calculator for the XFCE whisker menu search box | |
| "Install" by right-clicking the XFCE top-left ("whisker") menu | |
| and saying Properties. Then, in "Search Actions", add a new | |
| Search Action with Name: calculator, Pattern: ^[0-9+/* -]+$ | |
| Command: python path/to/this/file/whisker-calculator.py | |
| and tick "Regular expression". | |
| You should now be able to type "2 + 3+4" into the search box |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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; // ¯\\_(ツ)_/¯ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Check that the request is coming from my site. | |
| if (!isset($_SERVER['HTTP_REFERER']) || !stristr(strtolower($_SERVER['HTTP_REFERER']), strtolower($_SERVER['SERVER_NAME']))) { | |
| http_response_code(403); | |
| exit; | |
| } | |
| // There has to be a URL provided in the query string. | |
| if (!isset($_GET['url'])) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :root { | |
| --none: linear(0, 1); | |
| --power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 ); | |
| --power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 ); | |
| --power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 ); | |
| --power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 ); | |
| --power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 ); | |
| --power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // getDescription - given a url, this Eleventy filter extracts the meta | |
| // description from within the <head> element of a web page using the cheerio | |
| // library. | |
| // | |
| // The full html content of the page is fetched using the eleventy-fetch plugin. | |
| // If you have a lot of links from which you want to extract descriptions, the | |
| // initial build time will be slow. However, the plugin will cache the content | |
| // for a duration of your choosing (in this example, it's set to 1 day). | |
| // | |
| // The description is extracted from the <meta> element with the name attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This little program convert all the indented code blocks | |
| in a markdown file to a fenced code blocks style. | |
| It adds python language highlight argument by default. | |
| This program is argely inspired by the php gist made by tobice | |
| https://gist.github.com/tobice/1beab9616bb48e56ac1f1eb48c11dd97 | |
| -p, --path : path to the file to convert | |
| -t, --type : change the language highlight for the code blocks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const sortByOrder = require('./sort-by-order.js'); | |
| module.exports = function(eleventyConfig) { | |
| eleventyConfig.addFilter('sortByOrder', sortByOrder); | |
| } |
Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams.
You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.
Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.
This feature is powered by flowchart.js.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * Replacing SVG strings in data-uri style situations | |
| * by Jakob Erikson -- https://github.com/jakob-e | |
| * | |
| * http://codepen.io/jakob-e/pen/doMoML | |
| */ | |
| // Function to replace characters in a string | |
| @function str-replace($string, $search, $replace: '') { | |
| $index: str-index($string, $search); |
NewerOlder