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
// Within SPA webapp | |
import { useEffect } from 'react'; | |
export default function() { | |
useEffect(() => { | |
window.addEventListener('keydown', (event) => { | |
if ((event.ctrlKey || event.metaKey) && event.code === "KeyC") { | |
document.execCommand("copy"); | |
} else if ((event.ctrlKey || event.metaKey) && event.code === "KeyX") { | |
document.execCommand("cut"); |
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
import { useState, useEffect, useCallback } from 'react'; | |
const getSize = () => { | |
return { | |
width: window.innerWidth, | |
height: window.innerHeight, | |
}; | |
}; | |
export function useResize() { |
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
function hashString(s) { | |
let hashValue = 0; | |
for (let i = 0; i < s.length; i++) { | |
hashValue = (hashValue * 31 + s.charCodeAt(i)) % 4294967296; | |
} | |
let bucket = Math.floor((hashValue / 4294967296) * 8); | |
return bucket; | |
} | |
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
@prmichaelsen/[email protected] /Users/patrick/workplace/parm-v1.0.0 | |
├─┬ @angular/[email protected] | |
│ ├─┬ @angular/[email protected] | |
│ │ ├── @angular/[email protected] deduped | |
│ │ ├── [email protected] deduped | |
│ │ └── [email protected] deduped | |
│ ├─┬ @angular/[email protected] | |
│ │ ├── [email protected] deduped | |
│ │ ├── [email protected] deduped | |
│ │ └─┬ [email protected] |
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
import React, { | |
useEffect, useRef, | |
useState, useCallback, | |
} from 'react'; | |
export function useResize() { | |
const getSize = () => { | |
return { | |
width: window.innerWidth, | |
height: window.innerHeight |
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
#!/usr/bin/env ts-node | |
const grades: [number, string][] = [ | |
[96, 'A+'], | |
[93, 'A' ], | |
[90, 'A-'], | |
[86, 'B+'], | |
[83, 'B '], | |
[80, 'B-'], | |
[76, 'C+'], |
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
#!/usr/bin/env ts-node | |
const thresholds = [ | |
90, | |
80, | |
70, | |
60, | |
0, | |
]; |
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
/** | |
resources referred when writing this script: | |
- https://gitlab.com/MPuschi/lotr-skip/-/blob/main/skip.js | |
- https://codepen.io/wellingguzman/pen/XqYqmG | |
- https://stackoverflow.com/questions/5235145/changing-source-on-html5-video-tag | |
*/ | |
// Create Video and Canvas-Element | |
var canvas = document.createElement("canvas"); |
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
{ | |
"$schema": "http://json-schema.org/draft-04/schema#", | |
"title": "$id$", | |
"description": "WidgetGroupConfig_2-15", | |
"type": "object", | |
"additionalProperties": false, | |
"required": [ | |
"widgetGroupId", | |
"cti", | |
"configurations" |