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 { remote } = require("electron"); | |
remote.getCurrentWindow().setBounds({ | |
x: 0, | |
y: 0, | |
width: 1920, | |
height: 1080, | |
}); |
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
tell application "Google Chrome" | |
set bounds of front window to {0, 0, 1440, 900} | |
end tell |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ES modules in the browser - almost - now | Basics: script type module</title> | |
</head> | |
<body> | |
<!-- Use a type set to "module" with a fallback --> | |
<script type="module" src="app.js"></script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ES modules in the browser - almost - now | unpkg getLibs</title> | |
<!-- Include the getlibs endpoint --> | |
<script src="https://unpkg.com/getlibs"></script> | |
</head> | |
<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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ES modules in the browser - almost - now | Service worker</title> | |
</head> | |
<body> | |
<script> | |
// Register |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>ES modules in the browser - almost - now | Package name maps</title> | |
</head> | |
<body> | |
<!-- Declare the package map --> | |
<script type="packagemap"> |
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 clamp from "lodash/clamp"; | |
const num = Infinity; | |
const answer = clamp(num, 0, 42); | |
console.log(answer); | |
export default answer; |
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
// Disclaimer: this is not stable nor properly tested | |
// Not sure about the security implications of hijacking the fetch request either | |
// https://gist.github.com/pilwon/ff55634a29bb4456e0dd | |
const ES_MODULE_IMPORT_REGEX = /\bimport\s+(?:.+\s+from\s+)?[\'"]([^"\']+)["\']/g; | |
const packages = new Map().set( | |
"lodash/clamp", | |
"https://cdn.jsdelivr.net/npm/lodash-es@4.17.8/clamp.js" | |
); |
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
for voice in `say -v '?' | awk '{print $1}'`; do say -v "$voice" "Hi `whoami` my name is ${voice}"; done |
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
// Implementation 4: prevent the creation of an instance | |
class SingletonNoInstance { | |
constructor(enforcer) { | |
throw new Error('Cannot construct singleton'); | |
} | |
static singletonMethod() { | |
return 'singletonMethod'; | |
} |