The code and data behind xeiaso.net
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

support xedn resizable stickers

Signed-off-by: Xe Iaso <me@christine.website>

Xe Iaso 12d3a86c 16bf3a0f

+49 -41
+11
Cargo.toml
··· 89 89 members = [ 90 90 "./lib/*", 91 91 ] 92 + 93 + [profile.dev] 94 + opt-level = 3 95 + debug = true 96 + debug-assertions = true 97 + overflow-checks = true 98 + lto = false 99 + panic = 'unwind' 100 + incremental = true 101 + codegen-units = 256 102 + rpath = false
+11 -23
blog/🥺.markdown
··· 11 11 12 12 <xeblog-conv name="Mara" mood="hmm">I wonder how many people's RSS/JSONFeed 13 13 readers we broke with the title...</xeblog-conv> 14 - 15 14 <xeblog-conv name="Aoi" mood="cheer">Come on, it couldn't have been _that_ many, 16 15 things support Unicode now, right?</xeblog-conv> 17 - 18 16 <xeblog-conv name="Numa" mood="delet"><span style="color:green">&gt;implying 19 17 things support Unicode properly in the year of our lord two thousand and 20 18 twenty-three</span></xeblog-conv> 21 - 22 19 <xeblog-conv name="Aoi" mood="facepalm">They do support Unicode though...right? 23 20 They have to.</xeblog-conv> 24 - 25 21 <xeblog-conv name="Cadey" mood="coffee">We'll find out.</xeblog-conv> 26 22 27 23 Security is impossible. We just like to pretend otherwise so that we can ··· 59 55 Maybe the solution there is to use WebAssembly as a compile target instead of 60 56 making everything be native code. I wouldn't wish hppa's reverse stack growth on 61 57 anyone trying to write a compiler though.</xeblog-conv> 62 - 63 58 <xeblog-conv name="Aoi" mood="sus">Oh god...</xeblog-conv> 64 59 65 60 I'm tired of this situation and I bet a lot of the ecosystem is too. There's ··· 88 83 secure at all? If it doesn't ask you for your password how can you be sure that 89 84 an actual human is making the request and not some malicious 90 85 script?</xeblog-conv> 91 - 92 86 <xeblog-conv name="Numa" mood="delet">Using this program requires you to be able 93 87 to type an emoji. Most attack code is of such poor quality that they are unable 94 88 to run commands named with emoji. This makes the program secure.</xeblog-conv> 95 - 96 89 <xeblog-conv name="Aoi" mood="coffee">This is not how any of this 97 90 works.</xeblog-conv> 98 91 ··· 130 123 <xeblog-conv name="Aoi" mood="wut">Wait, what? Why is it returning that 131 124 everything is okay if the user is doing it wrong? Shouldn't it return some kind 132 125 of error code that the running program or shell can catch?</xeblog-conv> 133 - 134 126 <xeblog-conv name="Numa" mood="delet">It's a feature.</xeblog-conv> 135 - 136 127 <xeblog-conv name="Aoi" mood="coffee">I really hope I never have to maintain any 137 128 of your code.</xeblog-conv> 138 129 ··· 158 149 <xeblog-conv name="Aoi" mood="wut">Wait so the emoji works there, but it 159 150 probably isn't going to work in people's RSS feed readers? How does that make 160 151 any sense?</xeblog-conv> 161 - 162 152 <xeblog-conv name="Numa" mood="delet">It doesn't, lololol</xeblog-conv> 163 - 164 153 <xeblog-conv name="Cadey" mood="coffee">UNIX is mostly devoid of the concept of 165 154 character sets. Any character is fine as long as it doesn't have a null 166 155 terminator (this ends the string in C). I'd be more amazed if the emoji use ··· 210 199 Error: Os { code: 1, kind: PermissionDenied, message: "Operation not permitted" } 211 200 ``` 212 201 213 - <xeblog-conv name="Numa" mood="delet">Sure, this error message could be better, 214 - but that's a 2.0 feature. This is a disruptive program poised to totally reshape 215 - the security industry so we have to _move fast and break things_!</xeblog-conv> 202 + <xeblog-conv standalone name="Numa" mood="delet">Sure, this error message could 203 + be better, but that's a 2.0 feature. This is a disruptive program poised to 204 + totally reshape the security industry so we have to _move fast and break 205 + things_!</xeblog-conv> 216 206 217 207 I'm fairly sure that this program has no bugs that aren't either a part of the 218 208 syslog crate or the Rust standard library. ··· 224 214 installing it with `dpkg -i`. This will give you the `🥺` command that you can 225 215 use in place of `sudo`. 226 216 227 - <xeblog-conv name="Numa" mood="delet">This will let you stick it to the man and 228 - let you self-host your own sudo on a $5 a month VPS from a budget host. You 229 - can't have any vulnerabilities if there are no bugs to begin with!</xeblog-conv> 217 + <xeblog-conv standalone name="Numa" mood="delet">This will let you stick it to 218 + the man and let you self-host your own sudo on a $5 a month VPS from a budget 219 + host. You can't have any vulnerabilities if there are no bugs to begin 220 + with!</xeblog-conv> 230 221 231 222 <xeblog-sticker name="Aoi" mood="facepalm"></xeblog-sticker> 232 223 ··· 247 238 uid=0(root) gid=0(root) groups=0(root),10(wheel),1000(xe) 248 239 ``` 249 240 250 - <xeblog-conv name="Mara" mood="hacker">Pro tip! You can apparently pass a URL to 251 - a `.rpm` file to `yum install` and it will just download and install that `.rpm` 252 - file. This is incredibly cursed.</xeblog-conv> 241 + <xeblog-conv standalone name="Mara" mood="hacker">Pro tip! You can apparently 242 + pass a URL to a `.rpm` file to `yum install` and it will just download and 243 + install that `.rpm` file. This is incredibly cursed.</xeblog-conv> 253 244 254 245 The `.deb` package was built on Ubuntu 18.04 and the `.rpm` package was built on 255 246 Amazon Linux 2, so it should be compatible with enough distributions that you ··· 257 248 258 249 <xeblog-conv name="Mara" mood="hacker">There's even a manpage you can read with 259 250 `man 8 🥺`!</xeblog-conv> 260 - 261 251 <xeblog-conv name="Numa" mood="delet">And most importantly, [patches 262 252 welcome](https://github.com/Xe/xn--ts9h)!</xeblog-conv> 263 253 ··· 266 256 <xeblog-conv name="Numa" mood="delet">By the way, there are many more lovely 267 257 ways to get root than just by asking nicely with `setuid`. Why doesn't this 268 258 program use those?</xeblog-conv> 269 - 270 259 <xeblog-conv name="Cadey" mood="coffee">We gotta save _something_ for part 2, 271 260 otherwise that would spoil all the _fun_.</xeblog-conv> 272 - 273 261 <xeblog-conv name="Aoi" mood="sus">I don't know if I like what you mean by "fun" 274 262 there...</xeblog-conv> 275 263
+15 -8
lib/xesite_markdown/src/lib.rs
··· 111 111 .ok_or(Error::MissingElementAttribute("mood".to_string()))?; 112 112 let name = name.replace("_", " "); 113 113 114 - el.before(&format!(r#" 114 + let (size, class) = el 115 + .get_attribute("standalone") 116 + .map_or((64, "conversation-smol"), |_| { 117 + (128, "conversation-standalone") 118 + }); 119 + 120 + el.before( 121 + &format!( 122 + r#" 115 123 <div class="conversation"> 116 - <div class="conversation-picture conversation-smol"> 117 - <picture> 118 - <source srcset="https://cdn.xeiaso.net/file/christine-static/stickers/{name_lower}/{mood}.avif" type="image/avif"> 119 - <source srcset="https://cdn.xeiaso.net/file/christine-static/stickers/{name_lower}/{mood}.webp" type="image/webp"> 120 - <img src="https://cdn.xeiaso.net/file/christine-static/stickers/{name_lower}/{mood}.png" alt="{name} is {mood}"> 121 - </picture> 124 + <div class="{class}"> 125 + <img src="https://cdn.xeiaso.net/sticker/{name_lower}/{mood}/{size}" alt="{name} is {mood}"> 122 126 </div> 123 - <div class="conversation-chat">&lt;<b>{name}</b>&gt; "#), ContentType::Html); 127 + <div class="conversation-chat">&lt;<b>{name}</b>&gt; "# 128 + ), 129 + ContentType::Html, 130 + ); 124 131 el.after("</div></div>", ContentType::Html); 125 132 126 133 el.remove_and_keep_content();
+2 -2
lib/xesite_templates/src/lib.rs
··· 66 66 67 67 html! { 68 68 .conversation { 69 - ."conversation-picture"."conversation-smol" { 69 + ."conversation-standalone" { 70 70 picture { 71 71 source type="image/avif" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".avif"}; 72 72 source type="image/webp" srcset={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".webp"}; 73 - img alt={(name) " is " (mood)} loading="lazy" src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"}; 73 + img style="max-height:4.5rem" alt={(name) " is " (mood)} loading="lazy" src={"https://cdn.xeiaso.net/file/christine-static/stickers/" (name_lower) "/" (mood) ".png"}; 74 74 } 75 75 } 76 76 ."conversation-chat" {
+10 -8
static/css/shim.css
··· 22 22 display: flex; 23 23 } 24 24 25 - .conversation-picture { 25 + .conversation-standalone { 26 26 flex: 1; 27 - min-width: 9rem; 28 - max-width: calc(((70rem - 2rem)/6)); 27 + min-width: 6rem; 28 + max-width: 6rem; 29 + padding: 0.5rem; 29 30 } 30 31 31 32 .conversation-smol { 32 - min-width: 6rem; 33 - max-width: 6rem; 34 - padding: 0.5rem; 33 + flex: 1; 34 + min-width: 4.5rem; 35 + max-width: 4.5rem; 36 + padding: 0.25rem; 35 37 } 36 38 37 39 .conversation-chat { 38 - align-self: center; 39 - min-width: 0; 40 + align-self: center; 41 + min-width: 0; 40 42 } 41 43 42 44 .gruvbox-dark pre, pre {