trait Parser<'a> {
type Input;
type Output;
type Error;
fn parse(&self, input: &mut 'a Self::Input) -> Result<ParsedValue<'a>, Self::Error>;
}
enum ParsedValue<'a> {
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title></title> | |
<script type="module"> | |
import "@theme/default"; | |
</script> | |
</head> |
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
body { | |
color: red; | |
} |
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
class IconSerializer { | |
toURL(iconData: string, path: string): string { | |
// for build-time, we emit an asset with iconData and a name derived from path | |
// for run-time, we return a base64 data url of iconData | |
return ""; | |
} | |
} | |
class Icon { | |
constructor( |
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
async function expandAll() { | |
const nonShownLargeDiffExpanders = Array.from(document.querySelectorAll(".load-diff-button")); | |
for (const e of nonShownLargeDiffExpanders) { | |
e.click(); | |
} | |
await new Promise(r => setTimeout(r, 200)); | |
let expanders; | |
do { | |
expanders = Array.from(document.querySelectorAll(".js-expand")); | |
for (const e of expanders) { |
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
Array.from(document.querySelectorAll(".ajax-pagination-btn")).forEach(b => b.click()) | |
// wait a bit for everything to load | |
Array.from(document.querySelectorAll(".Details-content--closed")).forEach(e => e.click()) |
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> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
body { | |
padding: 10px; | |
margin: 0; | |
display: flex; | |
flex-direction: column; |
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/gjs | |
imports.gi.versions.Gtk = '4.0'; | |
const Gtk = imports.gi.Gtk; | |
const Gio = imports.gi.Gio; | |
const Mainloop = imports.mainloop; | |
const GObject = imports.gi.GObject; | |
const RoomTileViewModel = GObject.registerClass({ |
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> | |
<head> | |
<meta charset="utf-8"> | |
<style type="text/css"> | |
#route { | |
fill:none; | |
stroke:green; | |
stroke-width:4px; | |
stroke-linecap:butt; | |
stroke-linejoin:miter; |
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
//run with: for file in ~/Downloads/bikeblog/*.html; do node index.js "$file" ~/dev/nonwork/bikeblog/bikeblog/content/; done | |
const cheerio = require("cheerio"); | |
const slug = require("slug"); | |
const fs = require("fs"); | |
const {execSync} = require("child_process"); | |
const path = require("path"); | |
const file = process.argv[2]; | |
const targetbasedir = process.argv[3]; | |
const dir = path.dirname(file); | |
console.log(file, targetbasedir); |
NewerOlder