- Masterpage
-
[Website values](#website-values)
-
[Output](#output)
-
[Macroes in Umbraco](#macroes-in-umbraco)
-
[Example: Create a parameter "footer"](#example-create-a-parameter-footer)
-
[Razor](#razor)
- Try-catch snippet
This file contains 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
// Reading (bad) news can be hard. | |
// This script you should run in the console and then hover over headlines to get a new random headline. | |
// Simply copy it | |
// Open developer toolbar (press F12) | |
// In the "console" paste the script, press ENTER | |
// Enjoy! Simply hover over a headline to get a new random text :-) | |
// Try reading it seeing the photo together with the new random text | |
// THIS VERSION is for https://www.dr.dk | |
// | |
var HEADLINE_SELECTOR = '.dre-title-text, .dre-teaser-title__text, #dr-frontpage__top-spot #text' |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" | |
> | |
<xsl:output method="xml" indent="no"/> | |
<xsl:variable name="groups" select="'265, 256'" /> | |
<xsl:template match="root"> | |
<xsl:variable name="items"> | |
<xsl:call-template name="splitStringToItems"> |
This file contains 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 workLocation = { longitude: 10.21377573, latitude: 56.15343598 }; // DOKK1 | |
const currentLocation = await Location.current(); | |
const distanceToWork = calcCrow( | |
currentLocation.latitude, | |
currentLocation.longitude, | |
workLocation.latitude, | |
workLocation.longitude | |
).toFixed(1); | |
const notification = new Notification(); |
This file contains 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
Element.prototype.getDirectDesc = function () { | |
const descendants = Array.from(this.querySelectorAll("*")); | |
const directDescendants = descendants.filter( | |
(ele) => | |
ele.parentElement === this && | |
!["script", "iframe"].includes(ele.nodeName.toLowerCase()) | |
); | |
return directDescendants; | |
}; |
This file contains 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
var columns = Array.from(document.querySelectorAll('.ghx-column-title')).map( | |
(title) => `${title.textContent}\n${'*'.repeat(title.textContent.length + 5)}` | |
); | |
document.querySelectorAll('.ghx-columns').forEach((col) => { | |
const cols = col.querySelectorAll('.ghx-column'); | |
cols.forEach((col, i) => { | |
col.querySelectorAll('.ghx-issue-fields').forEach((ele) => { | |
const mev = ele.querySelector('.ghx-key').textContent; | |
const txt = ele.querySelector('.ghx-inner').textContent; | |
columns[i] += `\n${mev}: ${txt}`; |
This file contains 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
// deno run --allow-net mousse.ts | |
import { Mousse } from 'https://github.com/Tyrenn/mousse/raw/main/mod.ts'; | |
let mousse = new Mousse({ port: 8080 }); | |
async function handleRequest(c: any) { | |
const _body = { | |
...c.params, | |
}; | |
const body = JSON.stringify(_body); |
This file contains 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
/* | |
Get Browser feature implementation state | |
- fetches data from caniuse.com | |
- checks each browser for support of known features | |
- generates a HTML table as seen here: https://codepen.io/netsi1964/pen/PoGWoWP | |
RUN: deno run --allow-net caniuse.ts | |
Created by Sten Hougaard @netsi1964 12/12-2020 | |
*/ | |
interface SupportStatus { | |
supported: number; |
This file has been truncated, but you can view the full file.
This file contains 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
{ | |
"eras": { | |
"e-83": "83 versions back", | |
"e-82": "82 versions back", | |
"e-81": "81 versions back", | |
"e-80": "80 versions back", | |
"e-79": "79 versions back", | |
"e-78": "78 versions back", | |
"e-77": "77 versions back", | |
"e-76": "76 versions back", |
This file contains 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 byCode = { | |
"1": { | |
"country": "United States Virgin Islands", | |
"code": "1", | |
"intPrefix": "011", | |
"natPrefix": "1", | |
"natNumber": "(340)+7 digits", | |
"utsDst": "-4", | |
"note": " " | |
}, |