View test.ts
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 { Application } from "https://deno.land/x/oak@v9.0.0/mod.ts"; | |
const app = new Application(); | |
app.use((ctx) => { | |
ctx.response.body = "Hello World! ini1"; | |
console.log(ctx); | |
}); | |
await app.listen({ port: 8000 }); |
View index.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
const { createClient } = require("@supabase/supabase-js"); | |
const OLD_PROJECT_URL = "https://xxx.supabase.co"; | |
const OLD_PROJECT_SERVICE_KEY = "old-project-service-key-xxx"; | |
const NEW_PROJECT_URL = "https://yyy.supabase.co"; | |
const NEW_PROJECT_SERVICE_KEY = "new-project-service-key-yyy"; | |
(async () => { | |
const oldSupabaseRestClient = createClient( |
View split.sh
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
convert image.png -colorspace YUV -sampling-factor 4:2:2 -separate \ | |
\( -clone 0 \) \ | |
\( -clone 1 -fill black -colorize 100% \) \ | |
\( -clone 1 -negate \) \ | |
\( -clone 1 \) \ | |
image_b_temp.png | |
convert image_b_temp-4.png image_b_temp-5.png image_b_temp-6.png -channel RGB -combine image_b.png | |
convert image.png -colorspace YUV -sampling-factor 4:2:2 -separate \ |
View async-decoding.html
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
<html> | |
<body> | |
<div class="jank-detector"> | |
Random numbers, to highlight jank: | |
<span class="rand"></span> | |
</div> | |
<script> | |
const rand = document.querySelector(".rand"); | |
function randFrame() { | |
rand.textContent = Math.random(); |
View image-decode-promise.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
const img = new Image(); | |
img.src = "cat.png"; | |
img.decode().then(() => { | |
// image fully decoded and can be safely rendered on the screen | |
const orig = document.getElementById("orig"); | |
orig.parentElement.replaceChild(img, orig); | |
}); |
View network-aware-sw.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
function modifyURL(url) { | |
// ect can be 'slow-2g', '2g', '3g', or '4g'. | |
const connectionType = navigator.connection.effectiveType; | |
if (connectionType === "slow-2g" || connectionType === "2g") { | |
return url + "?opt=aggressive"; | |
} else if (connectionType === "4g") { | |
return url + "?opt=mild"; | |
} else { | |
return url + "?opt=default"; | |
} |
View hapi.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
var fs = require('fs'); | |
var Hapi = require('hapi'); | |
var http2 = require('http2'); | |
var options = { | |
key: fs.readFileSync('./selfsigned.key'), | |
cert: fs.readFileSync('./selfsigned.crt'), | |
}; | |
var server = new Hapi.Server(); |
View http2-compatibility-api.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
const http2 = require('http2'); | |
const fs = require('fs'); | |
const options = { | |
key: fs.readFileSync('./selfsigned.key'), | |
cert: fs.readFileSync('./selfsigned.crt'), | |
allowHTTP1: true | |
} | |
const server = http2.createSecureServer(options, (req, res) => { |
View unregister.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
try { | |
navigator.serviceWorker.getRegistrations().then(function(registrations) { | |
registrations.forEach(function(registration) { | |
if (registration.active && registration.active.scriptURL.includes("dexecure")) { | |
console.log('removing registration', registration); | |
registration.unregister(); | |
} | |
}) | |
}) | |
} catch (e) { |
View brotli-sw.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
// MIT License | |
// Copyright (c) 2016 Dexecure | |
// Permission is hereby granted, free of charge, to any person obtaining a copy | |
// of this software and associated documentation files (the "Software"), to deal | |
// in the Software without restriction, including without limitation the rights | |
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
// copies of the Software, and to permit persons to whom the Software is | |
// furnished to do so, subject to the following conditions: |
NewerOlder