zig build-exe main.zig
- The video must be in resolution 1920 x 1080.
./run.sh video-file
- get file "file-out" at current directory
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
'use strict'; | |
module.exports = { | |
workNextData, | |
parseWorkHTML, | |
parseEpisodeHTML, | |
}; | |
let lazy_JSDOM = null; |
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 std = @import("std"); | |
const Allocator = std.mem.Allocator; | |
pub fn box(allocator: Allocator, value: anytype) !*@TypeOf(value) { | |
const ptr = try allocator.create(@TypeOf(value)); | |
ptr.* = value; | |
return ptr; | |
} | |
test { |
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 std = @import("std"); | |
pub fn StructFieldsTuple(comptime T: type) type { | |
var info = switch (@typeInfo(T)) { | |
.Struct => |st| st, | |
else => @compileError("T must be a struct"), | |
}; | |
var newFields = info.fields[0..info.fields.len].*; | |
inline for (&newFields, 0..) |*f, i| f.name = std.fmt.comptimePrint("{}", .{i}); | |
info.decls = &.{}; |
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
fn Slice(comptime T: anytype) type { | |
return struct { | |
const Self = @This(); | |
const Error = error{EOF}; | |
left: T, | |
pub fn take(self: *Self, n: anytype) Error!@TypeOf(self.left[0..n]) { | |
if (self.left.len < n) return Error.EOF; | |
defer self.left = self.left[n..]; | |
return self.left[0..n]; | |
} |
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
document.body.onclick = () => { | |
document.body.onclick = null; | |
navigator.clipboard.writeText(location.href + '\n\n' + | |
document.querySelector('article .mod-entry-set').innerText); | |
al = document.querySelectorAll('div.entry-bottom-pn>a'); | |
if (al.length < 3) return alert('no next link'); | |
window.location = al[2].href; | |
}; | |
// bookmark this: |
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 c = @cImport(@cInclude("libdeflate.h")); | |
pub const Error = error{ | |
LibDeflateAlloc, | |
LibDeflateBadData, | |
LibDeflateShortOutput, | |
LibDeflateInsufficientSpace, | |
LibDeflateOther, | |
}; |
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 std = @import("std"); | |
const hea = std.heap.page_allocator; | |
pub fn main() anyerror!void { | |
const stderr = std.io.getStdErr().writer(); | |
const argv = try std.process.argsAlloc(hea); | |
defer std.process.argsFree(hea, argv); | |
if (argv.len > 1) { | |
if (std.mem.eql(u8, argv[1], "mono")) { | |
if (argv.len != 4) |
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 std = @import("std"); | |
const mem = std.mem; | |
const hea = std.heap.page_allocator; | |
pub fn main() !void { | |
const stderr = std.io.getStdErr().writer(); | |
const argv = try std.process.argsAlloc(hea); | |
defer std.process.argsFree(hea, argv); |
romfs/01_script/*.bin (except info.bin) (all numbers are in little endian) file head
first 16 bytes: 0x52, 0x53, 0x34, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00.
then u32: length of instruction part
then u32: length of string part (all strings here)
then u32: length of string indices part (referring the previous table)
then 4 bytes unknown.
NewerOlder