Skip to content

Instantly share code, notes, and snippets.

View dmnsgn's full-sized avatar

Damien Seguin dmnsgn

View GitHub Profile
@dmnsgn
dmnsgn / JavaScript landscape: compilers, bundlers and others by the numbers.md
Last active October 31, 2023 22:28
A non-exhaustive list of tools for JavaScript development as it has become "complicated".

JavaScript landscape: compilers, bundlers and others by the numbers

A non-exhaustive list of tools for JavaScript development as it has become "complicated".

Compilers

Name: language Stars Last Commit Owner/Sponsorship
tsc: JavaScript GitHub Repo stars GitHub last commit Microsoft
[babel]
console.log("foo");
I am attesting that this GitHub handle dmnsgn is linked to the Tezos account tz2AmQarWLeMoQVt2h9a4QYywTUtg8bH5t5B for tzprofiles
sig:spsig1enZE4k2VP8aj8J6kJLQLLXrRVUXmT8R2CTDdKqYqKUdNH4rNxu1DwTcpdvdToMEnYnr5PgZuVohjZFnJiCCcLDz9Jkqnz
@dmnsgn
dmnsgn / resize-electron-window-from-devtools-in-renderer-process.js
Last active November 12, 2020 09:50
Resize Electron window from devtools in renderer process.
const { remote } = require("electron");
remote.getCurrentWindow().setBounds({
x: 0,
y: 0,
width: 1920,
height: 1080,
});
@dmnsgn
dmnsgn / resize-application.applescript
Created November 10, 2020 12:02
Resize the current front macOS window of an application
tell application "Google Chrome"
set bounds of front window to {0, 0, 1440, 900}
end tell
// Author: Abhishek Dutta, 12 June 2020
// License: CC0 (https://creativecommons.org/choose/zero/)
export default function uuid() {
var temp_url = URL.createObjectURL(new Blob());
var uuid = temp_url.toString();
URL.revokeObjectURL(temp_url);
return uuid.substr(uuid.lastIndexOf('/') + 1); // remove prefix (e.g. blob:null/, blob:www.test.com/, ...)
}
// 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"
);
import clamp from "lodash/clamp";
const num = Infinity;
const answer = clamp(num, 0, 42);
console.log(answer);
export default answer;
<!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">
<!DOCTYPE html>
<html>
<head>
<title>ES modules in the browser - almost - now | Service worker</title>
</head>
<body>
<script>
// Register