convert this code to work in firefox
async function saveToFile() { const handle = await showSaveFilePicker({ suggestedName: 'index.html', types: [{ description: 'HTML',
def isAnagram(s1: String, s2: String): Boolean = | |
(s1 diff s2).isEmpty | |
isAnagram("barbie", "oppenheimer").ensuring(_ == false) | |
isAnagram("race", "care").ensuring(_ == true) | |
isAnagram("tree", "tere").ensuring(_ == true) |
import scala.util.Try | |
case class Pattern(pattern: String): | |
def find(part: String)(s: String) = | |
val start = pattern.indexOf(part) | |
s.substring(start, start + part.length) | |
case class Parser(p: Pattern, s: String): | |
def extract(x: String) = p.find(x)(s) |
convert this recipe to json+ld recipe schema
As served at the Tourist Bar, Port-au-Prince, Haiti, soon after the post-WWII beginnings of tourism on the island. Named after the Haitian revolutionary hero General Alexandre Pétion, who succeeded Dessalines as head of state. Pétion downgraded the office he assumed from "Emperor For Life" to the more egalitarian "President For Life." Recipe from the 1949 Esquire's Handbook For Hosts.
¾ ounce Bénédictine
¾ ounce clairin*
<script src="https://unpkg.com/htmx.org@1.8.4"></script> | |
<script> | |
document.body.addEventListener('htmx:configRequest', function(evt) { | |
const key = '<your key here>'; | |
evt.detail.headers['apikey'] = key; | |
evt.detail.headers['Authorization'] = "Bearer " + key; | |
}); | |
document.body.addEventListener('htmx:beforeSwap', function (evt) { | |
// trim quotes from response | |
evt.detail.serverResponse = evt.detail.serverResponse.slice(1, -1); |
create function home() returns XML | |
language sql as $$ | |
select xmlelement(name table, | |
xmlelement(name th, 'Column 1'), | |
xmlelement(name th, 'Column 2'), | |
xmlagg( | |
xmlelement(name tr, | |
xmlforest(column_one as td, | |
column_two as td)))) | |
from home_page_content; |
import scala.annotation.tailrec | |
object Solution { | |
def validUtf8(data: Array[Int]): Boolean = validUtf8(data.toList) | |
@tailrec | |
def validUtf8(data: List[Int]): Boolean = data match { | |
case Nil => true | |
case n1 :: ns if ASCII_SEQ(n1) => validUtf8(ns) | |
case n1 :: n2 :: ns if TWO_BYTE(n1, n2) => validUtf8(ns) |
function uppercaseNumbers(num) { | |
if (num === 1) | |
return "¹" | |
if (num === 2 || num === 3) | |
return String.fromCodePoint("²".codePointAt(0) + (num - 2)) | |
return String.fromCodePoint("⁴".codePointAt(0) + (num - 4)) | |
} | |
for (let i = 0; i < 10; i++) | |
console.log(i + "\t" + uppercaseNumbers(i)) |
Here's how I bissected this section of git for windows history and made this table: git-for-windows/git#3509 (comment)
Date | Version | Good/Bad |
---|---|---|
2021-10-30-13:38:26 | PortableGit-2.34.0-rc0-64-bit.7z.exe | Bad |
2021-10-29-14:11:24 | PortableGit-prerelease-2.33.1.windows.1-36-gbd465d70df-20211029141659-64-bit.7z.exe | |
2021-10-28-19:16:10 | PortableGit-prerelease-2.33.1.windows.1-27-gf8f57df4d5-20211028224346-64-bit.7z.exe | |
2021-10-15-13:12:48 | PortableGit-prerelease-2.33.1.windows.1-13-g3f28c5f141-20211015131715-64-bit.7z.exe | |
2021-10-14-12:22:50 | PortableGit-prerelease-2.33.1.windows.1-2-gc7d0a86b02-20211014122857-64-bit.7z.exe | |
2021-10-1 |
# determine necessary partition size | |
set ISOSIZE (wc -c image.iso) | |
# resize partition | |
sudo u3-tool -p $ISOSIZE /dev/sg3 | |
# load | |
sudo u3-tool -l image.iso /dev/sg3 |