Skip to content

Latest commit

 

History

History
1007 lines (790 loc) · 55.1 KB

2021-08-28.md

File metadata and controls

1007 lines (790 loc) · 55.1 KB

< 2021-08-28 >

2,065,661 events, 1,202,529 push events, 1,680,472 commit messages, 100,847,664 characters

Saturday 2021-08-28 00:16:49 by Mike Griese

Spec for Elevation QOL improvements (#8455)

doc link

Summary of the Pull Request

Despite my best efforts to mix elevation levels in a single Terminal window, it seems that there's no way to do that safely. With the dream of mixed elevation dead, this spec outlines a number of quality-of-life improvements we can make to the Terminal today. These should make using the terminal in elevated scenarios better, since we can't have M/E.

Abstract

For a long time, we've been researching adding support to the Windows Terminal for running both unelevated and elevated (admin) tabs side-by-side, in the same window. However, after much research, we've determined that there isn't a safe way to do this without opening the Terminal up as a potential escalation-of-privilege vector.

Instead, we'll be adding a number of features to the Terminal to improve the user experience of working in elevated scenarios. These improvements include:

  • A visible indicator that the Terminal window is elevated ([#1939])
  • Configuring the Terminal to always run elevated ([#632])
  • Configuring a specific profile to always open elevated ([#632])
  • Allowing new tabs, panes to be opened elevated directly from an unelevated window
  • Dynamic profile appearance that changes depending on if the Terminal is elevated or not. ([#1939], [#8311])

PR Checklist

  • Specs: #1032, #632
  • References: #5000, #4472, #2227, #7240, #8135, #8311
  • I work here

Detailed Description of the Pull Request / Additional comments

*** read the spec ***

Why are these two separate documents?

I felt that the spec that is currently in review in #7240 and this doc should remain separate, yet closely related documents. #7240 is more about showing how this large set of problems discussed in #5000 can all be solved technically, and how those solutions can be used together. It establishes that none of the proposed solutions for components of #5000 will preclude the possibility of other components being solved. What it does not do however is drill too deeply on the user experience that will be built on top of those architectural changes.

This doc on the other hand focuses more closely on a pair of scenarios, and establishes how those scenarios will work technically, and how they'll be exposed to the user.


Saturday 2021-08-28 00:41:55 by PintTheDragon

Fix ban event's issuers (#618)

  • Fix BanningAndKicking

  • Fix Banned

  • Fuck you stylecop

  • Fuck you x2


Saturday 2021-08-28 01:27:10 by David Ordás

Add CodingFantasy's CSS coding interactive games (#5490)

  • Add "Knights of the Flexbox table" game

Welcome to the Knights of the Flexbox table. A game where you can help Sir Frederic Flexbox and his friends to uncover the treasures hidden in the Tailwind CSS dungeons. You can navigate the knight through the dungeon by changing his position within the dungeon using Flexbox and Tailwind CSS.

  • Add "Flex Box Adventure" game

Once upon a time, there was a King Arthur. He ruled his kingdom fair and square. But Arthur had one problem. He was a very naive person. So one sunny day, three alchemist brothers offered Arthur to exchange all his Gold Coins for coins made of a more valuable new metal that they had invented - Bit Coins.

Arthur believed them and gave them all his gold. The brothers took the gold and promised to give the bit coins back to Arthur in seven days.

Seven days passed. The brothers have not turned up. Arthur realized he had been scammed. He is angry and intends to take revenge on them. Let's help him do it with our weapon – CSS Flex Box!

We made this game for You

  1. You often stumble and try to figure out which combination of Flex Box properties makes the browser do what you want it to do.

  2. You want to create complex web layouts without constantly looking at the web page after every Cmd/Ctrl+S press in the code editor.

  3. You have tried to learn Flex Box with video tutorials and articles but still don't fully understand how some parts of it work.

4*. Or, if you are a master of CSS Flex Box, we have something interesting and for you too (read further).

Have you found yourself there? Then you definitely want to learn or improve your Flex Box skills. So we have good news for you, really good news...

Learn Flex Box by Playing Game No more boring videos, tutorials and courses. Learn Flex Box in a completely new, fun, effective and revolutionary way. By playing Flex Box coding game!

  • Add "Grid Attack" coding game

In an ancient Elvish prophecy, it was said that one day a man would be born with an incredible power that predicts the future – "Marketi Predictori." And another will come to take this power. But the years went by and nothing happened. Until one day, a little elf was born. He was named Luke.

From an early age, he surprised his parents and his sister Rey by guessing the price of apples at the farmer's market before they even reached it. Every year his power rose and his predictions became more and more accurate. But there was one thing Luke could not predict. The coming of the demon Valcorian. It was the one from the prophecy that was to come and take Luke's power. One day Valcorian and his army attacked the town where Luke had lived and kidnapped him to make a ritual of stealing his power.

Go on a dangerous quest with Luke's sister Rey and find her brother. Defeat Valcorian and all his demons using a secret weapon – CSS Grid.

We made this game for You?

  1. You often stumble and try to figure out which combination of Grid properties makes the browser do what you want it to do.

  2. You are scared by the number of properties a CSS Grid has, and you feel uncomfortable when you need to create a grid layout.

  3. You want to create complex web layouts using Grid, but without constantly looking at the web page after every "Cmd/Ctrl+S" press in the code editor.

  4. You have tried to learn CSS Grid with video tutorials and articles but still don't fully understand how some parts of it work.

  5. You use a Flex Box where Grid is required because you don't feel confident in using it.

Have you found yourself there? Then you definitely want to learn or improve your Grid skills. So we have good news for you, really good news...

Learn Grid by Playing CSS Game No more boring videos, courses and articles. Learn Grid in a revolutionary new, fun, and effective way. By playing a Grid coding game!


Saturday 2021-08-28 02:20:18 by ElectroPerf

Revert Latency Commits To Fucking Fix The Ghost Touch Issues

  • This thing made users spam me to suck my balls.. bruh..
  • Authorship? No Fucking kangers dont give authorship.. so fuck those who die for authorship.
  • Ok so keep these bitches aside, its Ryuuji who suggested me that X00TD's gay NVT touch drivers dont support low latencies.

This reverts commit 6fd057dc601c88f8be660a13fcd01ef3e160f41d.

Co-Authored-by: RyuujiX [email protected] Signed-off-by: ElectroPerf [email protected]


Saturday 2021-08-28 05:20:09 by Elijah Newren

merge-ort: restart merge with cached renames to reduce process entry cost

The merge algorithm mostly consists of the following three functions: collect_merge_info() detect_and_process_renames() process_entries() Prior to the trivial directory resolution optimization of the last half dozen commits, process_entries() was consistently the slowest, followed by collect_merge_info(), then detect_and_process_renames(). When the trivial directory resolution applies, it often dramatically decreases the amount of time spent in the two slower functions.

Looking at the performance results in the previous commit, the trivial directory resolution optimization helps amazingly well when there are no relevant renames. It also helps really well when reapplying a long series of linear commits (such as in a rebase or cherry-pick), since the relevant renames may well be cached from the first reapplied commit. But when there are any relevant renames that are not cached (represented by the just-one-mega testcase), then the optimization does not help at all.

Often, I noticed that when the optimization does not apply, it is because there are a handful of relevant sources -- maybe even only one. It felt frustrating to need to recurse into potentially hundreds or even thousands of directories just for a single rename, but it was needed for correctness.

However, staring at this list of functions and noticing that process_entries() is the most expensive and knowing I could avoid it if I had cached renames suggested a simple idea: change collect_merge_info() detect_and_process_renames() process_entries() into collect_merge_info() detect_and_process_renames() <cache all the renames, and restart> collect_merge_info() detect_and_process_renames() process_entries()

This may seem odd and look like more work. However, note that although we run collect_merge_info() twice, the second time we get to employ trivial directory resolves, which makes it much faster, so the increased time in collect_merge_info() is small. While we run detect_and_process_renames() again, all renames are cached so it's nearly a no-op (we don't call into diffcore_rename_extended() but we do have a little bit of data structure checking and fixing up). And the big payoff comes from the fact that process_entries(), will be much faster due to having far fewer entries to process.

This restarting only makes sense if we can save recursing into enough directories to make it worth our while. Introduce a simple heuristic to guide this. Note that this heuristic uses a "wanted_factor" that I have virtually no actual real world data for, just some back-of-the-envelope quasi-scientific calculations that I included in some comments and then plucked a simple round number out of thin air. It could be that tweaking this number to make it either higher or lower improves the optimization. (There's slightly more here; when I first introduced this optimization, I used a factor of 10, because I was completely confident it was big enough to not cause slowdowns in special cases. I was certain it was higher than needed. Several months later, I added the rough calculations which make me think the optimal number is close to 2; but instead of pushing to the limit, I just bumped it to 3 to reduce the risk that there are special cases where this optimization can result in slowing down the code a little. If the ratio of path counts is below 3, we probably will only see minor performance improvements at best anyway.)

Also, note that while the diffstat looks kind of long (nearly 100 lines), more than half of it is in two comments explaining how things work.

For the testcases mentioned in commit 557ac0350d ("merge-ort: begin performance work; instrument with trace2_region_* calls", 2020-10-28), this change improves the performance as follows:

                        Before                  After
no-renames:      205.1  ms ±  3.8  ms   204.2  ms ±  3.0  ms
mega-renames:      1.564 s ±  0.010 s     1.076 s ±  0.015 s
just-one-mega:   479.5  ms ±  3.9  ms   364.1  ms ±  7.0  ms

Signed-off-by: Elijah Newren [email protected] Signed-off-by: Junio C Hamano [email protected]


Saturday 2021-08-28 05:45:01 by John Reimer

Template links are now serialized. Jfc

After much misery I have gotten template links to serialize. The only way to do this is to serialize some sort of reference to the template, and to have a dictionary (list) of each template somewhere.

SO WE HAVE

  • Database: Base list asset. Scriptable Object that contains a list of things.
  • DatabaseManager: Base holder monobehavior. Holds a database SO, and provides functions that allows indexing.
  • TemplateDatabase: Simple recast of Database to hold ItemTemplates. Also provides a handy refresh context menu that finds the damn things for you.
  • TemplateManager: Simple recast of DatabaseManager for the ItemTemplate type.

OTHER CHANGES

  • Equipment: event invoked after loading to update the UI.
  • Factory: Static bs. Not relevant.
  • Item: Reorganization into regions. Implements BOTH unity and c# serialization hooks. This is so the serialization can be method-agnostic, and unity is a bitch.
  • JsonElement.cs: Whatever was needed to make the damn thing work. Switching to Json.Net imminent.
  • JsonHelper: Fixed a bug for items with null value.

Saturday 2021-08-28 06:46:41 by Koi

Mr. Mime is a thing, unfortunately. Mild clean, some more Cherish set handling attempts. Exclude set MetDate from mystery gifts. Fix daycare enum parsing. Check for no result in case $qc was used or some other weird thing happens. Remove FixOT and TradeCord as routine types (FlexTrade handles both). Try to apply trainer info for Mystery gifts. Re-add fixed met date if not GO origin. Update DenBot distribution data, minor fixes. Fix Yamask-Galar in daycare, some more oopsies. -Add DenBot - a seed lookup and day skipper bot for raids. -Change AutoRoll's behavior to make use of some of DenBot's functionality. Minor clean. Revise TradeCord "traded" check, remove potential user path straggler entries because paranoia, some minor fixes. TradeCord fixes (shocker, I know). Extract Json serializer. Minor clean and fixes. Minor fixes. Fix Milcery when an Alcremie variant is a parent. Update to latest Core and ALM dependencies. Handle non-shiny events in a better way. Work around a race condition? Simplify and de-bugify trade completion check. Fix indexing, improve chance for Melmetal-Gmax because it's nigh impossible to get. Rework TradeCord internals, add new functionality: -Migrate user data from ".txt" files to a serialized Json (migration for a large amount of users will take a few minutes, be patient). -Make TradeCord configurable, add its own settings category. -Add some template events with an optional end timer (YYYY/MM/DD 8PM as an example, though any local time format should work). -Add barebones Pokedex (counter, flavor text). -Can check dex completion by typing $dex, check missing entries by typing $dex missing. -Completing the Pokedex will slightly improve shiny rate. -Can now mass release cherish event Pokemon and shinies ($massrelease shiny/cherish). -Various tweaks, improvements, and bugfixes.

Slightly change FixOT's behavior: -If a shown Pokemon is illegal and an event, attempt to find a match within the MGDB first. -Try to force users to trade away the shown Pokemon, log attempt to change shown Pokemon. Add consideration for easter eggs being enabled in settings, fix Suicune Change species rng for TradeCord, some bugfixes (I really need to rewrite this mess) Add check if we're using ListUtil for Giveaway instead of TradeCord. Amend commit since I'm squashing and force-pushing while bringing the fork in line with the main branch Add Giveaway module to Discord bot (#22)

Thanks, rigrassm. Co-authored-by: Koi-3088 [email protected] Specify USB port instead of adding the first result (can be found via Device Manager). Re-add boolean check because we don't want to fix everything FixOT will attempt to regenerate illegal Pokémon. Apply trash bytes for reasons. Minor TradeCord fixes and adjustments. Minor clean for C#9 Use "GetValidPreEvolutions()" instead of "GetPreEvolutions()". Index forms correctly. Fix the fixed and re-introduced empty daycare index error. an Ultra Ball. Add EvoTree breeding for TradeCord. Remove unnecessary value declarations for pinging on encounter match. Mildly beautify EncounterBot mark output. Integrate Anubis' system update prevention into Soft Reset and Regigigas Encounter Modes. Rename "Regi" Encounter Mode to "Soft Reset". Speed up "A" clicks for Regigigas and Soft Reset modes. Add Mark logging output for EncounterBot. Fix oops (re-order logic, remove unnecessary lines). Add optional species and form specification for $massrelease Use an obscure string splitter because people like symbols in their names. Fix things that broke after rebasing to the latest main repo commit. Use a less unfortunate field name and value splitter...again. Fix Marowak-Alola always generating as an NPC trade. Add filters for "$list " to narrow down results. Fix Cherish Pichu and Octillery Stop making dumb mistakes, me (implying the rest of it isn't a dumb mistake). Can't breed antiques. Use a less unfortunate embed name and value splitter Add Melmetal-Gmax to TradeCord. Add ability to search by caught ball. Have MassRelease ignore events. Add specific regional form breeding. Revise egg rate and egg shiny chance. Have trade evolutions hold an Everstone. Add an extra right click when navigating to settings for AutoRoll. Add reworked encounter/egg/fossil logs. Minor clean. Minor clean. Get rid of EncounterBot, FossilBot, EggFetch text logs until I properly rework them. Break on an empty page due to aggressive rounding Add multi-page lists for Tradecord. More random bugfixes. Fix some bugs before major clean Add Language parameter for TradeCord. Change trainer info input format for TradeCord. Move focus on Showdown set instead of randomizing a pkm file. Allow user to enter whatever they want for $list, handle edge cases like Kommo-o Add "$list all" to show non-duplicate caught species. Automatically remove from favorites if trading or gifting (small QOL thing). Change how favorites are removed from user file. Revert base egg shiny chance nerf. Fix daycare Add favorites command to TradeCord. Slightly nerf eggs. Fix TradeCord list for shinies Add TradeCord (my dumbest and messiest project so far, Archit pls don't hate the mess). Add Showdown output for Star/Square shinies and OTGender. Add optional link code input for FixOT. Change how OTName, TID, SID is displayed. Add Regigigas SR bot. Add SoJ Camp SR bot. Ribbons now work with EggTrade (remove ribbons if egg). Remove EggRoll. Add another filter for FixOT Fix.. FixOT Update offsets for EncounterBot catching. Slightly change StrongSpawn to work with Regi SR and make it its own mode. Make SpinTrade only available for USB-Botbase Update valid eggs for CT winforms: resize icon.ico to fix crash at startup on unix using mono Rework Spin, read initial in-game coordinates in order to correct drift Add TID, SID, Language output for Showdown Remove obsolete OT and Language parsing Very minor clean until I have time for a proper one. Detach controller when stopping USB bot. Actually set LastUsedBall for EncounterBot (missed when bringing in line with main repo) Move extra RaidBot timings following the official commit Remove PKHeX Discord invite from Readme.md

Maybe fewer people will pester devs now about my unofficial fork? Update for latest main repo EncounterBot commits. Update README.md Add back best commit: Red's SpinTrade. Add egg trades, foreign Dittos and OT for Twitch. If ItemMule is enabled, also display the item a user is receiving. Add periodic time sync toggle for all methods of hosting (except for non-soft locked AutoRoll) to (hopefully) prevent den rollover during extended hosts.

Add routine to exit a lobby for SoftLock if no players are ready in time (to preserve soft lock).

Add a routine to recover from disbanded lobbies (when someone disconnects unexpectedly) for SoftLock.

Add a routine to restart game if all else fails and we're stuck in a raid.

Add a routine for adding and deleting friends if we're soft locked and raids go empty.

Slightly reorganize settings, extract methods, minor clean. Don't use such a generic file name for stream assets. Check USB port index for running bots. Should fix adding additional USB bots when no config is saved. Add fixed met date for FixOT. How do I boolean Change airplane mode logic, tweak timings and routine for soft lock lobby exit Rework EggRoll cooldown (static list in favor of a txt file). Start clean up and refactor Add setting to increase delay after pressing "Home" after a date skip. Use USB port index for blocking and sprite pngs if connection type is USB Add option for airplane host (usb-botbase required) Add option to softlock on selected species for AutoRoll Add automatic compatibility for all console languages when date skipping (have to set ConsoleLanguage under ScreenDetection) Attempt to fix multiple USB device add and connect...again Minor clean Fix oops? Handle add/remove of bots Distinguish between multiple USB devices, tweak BotRemoteControl for USB, other various fixes Add SpA modifier for foreign Dittos Add alpha USB-Botbase support Fix DateTime parsing for European format for EggRoll Set fixed EggMetDate and MetDate for EggRoll More FixOT filters Remove Beheeyem. Oops. Split EggRoll into its own routine and trade type, only output "Receiving: Mysterious Egg" if routine is EggRoll, other minor tweaks and fixes Make FixOT its own queue with roles and counts Add a couple more OTs to $fix Parsing for EggRaffle auto-clear and $clearcooldown Adjust timings and split Watt collecting clicks for AutoRoll Fix oops with file attachments for Ditto Further improvements for OT, memes for invalid pokemon (disable EasterEggs) Add spaces, digits for OT Randomize memes, cut down bloat Fix miscellaneous bots after Anubis' recent QOL additions -Ignore events for OT because headache. -Add overlooked "$convert " input for OT. -Move $clearcooldown to SudoModule -Clear timer automatically if NoTrainerFound -More reliable Dittos -Foreign Dittos for $convert -Command to clear cooldown for EggRaffle in case trade gets disconnected -Fix "Trade finished" line to keep result secret -EggRaffle as a toggle, option to specify channels -Seed Check output to both DMs and Channel (apparently some want it) -Randomly generated egg raffle via a "$roll" command with a configurable cooldown -FixAdOT reworked, has its own command "$fix" and no longer overrides $clone -Ball: output for Showdown sets -Fix oversight -Option to output Seed Check results to Discord channel with a User mention -Showdown set output for OT name and eggs -Basic "OT: " option without Showdown set output -Initial $convert support for EggTrade -Egg moves for EggTrade test attempt -Minor update -EggTrade (by nicknaming a Pokémon "Egg" using $trade) -Failsafe for memes if enabled but field left blank or incomplete -Niche breedable Ditto trade mode. Add minimize button EggFetch text logs StrongSpawn mode for EncounterBot Re-add EncounterBot Master Ball catching More parsing for FixAdOTs Park Ball as held item instead of string Actually remove the offset instead of saying I did Initial DLC commit Faster code entry Removed catching for EncounterBot (need a new offset) CloneBot mode to fix Nickname and OT if adverts detected


Saturday 2021-08-28 08:37:46 by vickycallp123

Call Girls In Aerocity 8448079011 Escort Service In Delhi Ncr

Call VICKY 8448079011 Aerocity Delhi Ncr Escorts Service Are you fed up with the ongoing challenges in your life? Do you want some relief and want some fun and pleasure in your life? If your answer is yes, then you must go and avail of the Mahipalpur Escorts Service. Now service providers are there to help you to get rid of the problems you are facing just by getting satisfied physically. Want to have fun with escorts in Mahipalpur Physical satisfaction is not all about sex. Sometimes it's all about having someone beside you will be there to hold you in your hard times and will let you forget about everything happening with you. These Karol Bagh call girls are sufficient enough for the same. When you are approaching these Mahipalpur escorts, make sure you are letting them know about the requirement to the service provider appropriately. This will help the service provider to arrange call girls in Dwarka Delhi Ncr accordingly, and you will be able to get the best. Sometimes it has been seen that we are looking forward to someone who will help us to feel what we have dreamt. Those illusions, infatuations, those romantic moments, and all of the things we want that someone will be there to fulfill the same. These Connaught Place call girls are the best choice for you for the same. You might be thinking about how these Mahipalpur escorts will be able to understand your requirements appropriately? Then the answer for the same is you are letting them know about it appropriate. When you are communicating with them, they will do as you have suggested. They will not utter a single word against your queries and will satisfy you in every possible way.


Saturday 2021-08-28 08:57:57 by Gabriele Bellomia

Successful test [part 3][end]

HELL YEAH!

Revert of the commit successfully restored the ladder and all the explosion damage. The main purpose of mcworld versioning has been demonstrated effortlessly... works like a charm! 🥳

I'll tag this commit as 1st-milestone 🙃

Next test: I'd like to try screwing up an hardcore world and hacking my ass safe and alive by reverting to the last commit 😁. More on that soon!


Saturday 2021-08-28 09:36:52 by motoshi-suzuki

2021-08-28 (1), Version 1.1.1 (7), print(Hello Apple, Fuck you.)


Saturday 2021-08-28 11:18:05 by gpz

always enable filename shortening when autostarting, it causes way too much trouble. also remove some of those ugly hacks that should be no more required now that we check per cycle

git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@40582 379a1393-f5fb-40a0-bcee-ef074d9b53f7


Saturday 2021-08-28 11:55:34 by Colon-D

Spaghettify this beautiful code

I have modified your code to become more like one of my previous attempts, because that helps my brain right now. It feels disrespectful for me to do so, so please forgive my butchering of your code. The end result is a lovely triangle with no unsafe code and nice clean functions.


Saturday 2021-08-28 12:43:45 by Sean Doyle

"Live Preview" submit as you type

Let's review! At this point, our end-users can draft an Article, and can preview their changes by clicking on a Preview Article button to request the server-rendered HTML version.

Let's enhance that experience even more by cutting out the need to click the Preview Article button.

One of the three pillar of the Hotwire ecosystem is Stimulus. Stimulus Controllers are enable our applications to transform browser-side events into method invocations by routing them as Stimulus Actions.

We'll start by declaring a form controller to augment our <form> element. To utilize the form identifier, we'll declare the app/assets/javascripts/controllers/form_controller.js file:

import { Controller } from "stimulus"

export default class extends Controller {
}

To grant direct access to the <button> element's HTMLButtonElement instance, we'll make our form controller aware of it by declaring [data-form-target="preview"] attribute on the on the <button>:

--- a/app/views/articles/_form.html.erb
+++ b/app/views/articles/_form.html.erb
   <div class="actions">
     <%= form.submit %>
-    <%= form.button "Preview Article", formaction: previews_path(render_into: "article_preview") %>
+    <%= form.button "Preview Article", formaction: previews_path(render_into: "article_preview"), data: { form_target: "preview" } %>
   </div>
 <% end %>

In our controller, we'll add support for accessing the HTMLButtonElement instance through the previewTarget property by declaring "preview" as a [Stimulus Target][]:

--- b/app/javascript/controllers/form_controller.js
+++ b/app/javascript/controllers/form_controller.js
  import { Controller } from "stimulus"

  export default class extends Controller {
+   static get targets() { return [ "preview" ] }
  }

Whenever the contents of <input>, <select>, or <textarea> elements' values change, browsers fire an input event. To route these as Stimulus Actions, we'll declare [data-action="input->form#preview"] on the <form> element:

--- a/app/views/articles/_form.html.erb
+++ b/app/views/articles/_form.html.erb
-<%= form_with(model: article) do |form| %>
+<%= form_with(model: article, data: { controller: "form", action: "input->form#preview" }) do |form| %>
   <% if article.errors.any? %>
     <div id="error_explanation">
       <h2><%= pluralize(article.errors.count, "error") %> prohibited this article from being saved:</h2>

Whenever any <form> element descendant fires an input event, Stimulus will respond by calling the preview() method in the form controller (as instructed by the directive declared in the form[data-action] attribute).

The preview() action handles the event by finding the Preview Post button, and clicking it on the user's behalf.

--- b/app/javascript/controllers/form_controller.js
+++ b/app/javascript/controllers/form_controller.js
  import { Controller } from "stimulus"

  export default class extends Controller {
    static get targets() { return [ "preview" ] }
+
+   preview() {
+     this.previewTarget.click()
+   }
  }

In the spirit of progressive enhancement, we'll always want to render the Preview Post button when JavaScript is unavailable. However, when JavaScript is available, changes made by the end-user will cause the <form> to submit automatically. This affords us an opportunity to hide the <button> element.

During the connect() phase of our controller's lifecycle, we'll hide the <button> by annotating it with the hidden attribute:

  import { Controller } from "stimulus"

  export default class extends Controller {
   static get targets() { return [ "preview" ] }
+
+   connect() {
+     this.previewTarget.hidden = true
+   }

    preview() {
      this.previewTarget.click()
    }
  }

Improving even further

For example, if we might want to guard against flooding our clients and servers with extraneous requests whenever a swift keyboardist quickly enters text, it would be worthwhile to [debounce][] preview submissions:

diff --git a/app/assets/javascripts/controllers/form_controller.js b/app/assets/javascripts/controllers/form_controller.js
index ca07dee..6c831c4 100644
--- a/app/javascript/controllers/form_controller.js
+++ b/app/javascript/controllers/form_controller.js
@@ -1,8 +1,13 @@
 import { Controller } from "stimulus"
+import debounce from "https://cdn.skypack.dev/lodash.debounce"

 export default class extends Controller {
   static get targets() { return [ "preview" ] }

+  initialize() {
+    this.preview = debounce(this.preview.bind(this), 300)
+  }
+
   connect() {
     this.previewTarget.hidden = true
   }

   preview() {
     this.previewTarget.click()
   }
 }

Wrapping up

We've built an Article drafting experience that provides end-users with a preview of the final version, live as they type. The experience relies on Turbo Streams and Stimulus to progressively enhance concepts built directly into browsers, and will gracefully degrade to HTML and HTTP when JavaScript is unavailable.

Our implementation is light on JavaScript code, never encodes our Article records into JSON representations, and doesn't include a single call to XMLHttpRequest or fetch, despite relying on the server as the source of all HTML structure and data.

That's all baked into the value proposition of Hotwire. Turbo, specifically, helps us realize that <form> elements are inert and declarative HTML alternatives to Asynchronous JavaScript and XML (AJAX) invocations, and are ready to be executed at a moment's notice by end-users. Applications' <form> elements serve as the bedrock for any and all Hotwire-augmented end-user experiences.


Saturday 2021-08-28 12:55:08 by Sean Doyle

Hiding the results when inactive

Now that we're overlaying our results on top of the rest of the page, we'll only want to do so when the end-user is actively searching. We'll also want to avoid needless requests to the server with empty query text.

Lucky for us, browsers provide a built-in mechanism to prevent bad <form> submissions and to surface a field's correctness: Constraint Validations!

In our case, there are two ways that a search can be invalid:

  1. The query <input> element is completely blank.
  2. The query <input> element has a value, but that value is comprised of entirely empty text characters.

To consider those states invalid, render the <input> with required and pattern attributes:

--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
           <label for="search_query">Query</label>
-          <input id="search_query" name="query" type="search">
+          <input id="search_query" name="query" type="search" pattern=".*\w+.*" required>

By default, browsers will communicating a field's invalidity by rendering a field-local tooltip message. While it's important to minimize the number of invalid HTTP requests sent to our server, a type-ahead search box works best when users can incrementally make changes to the query string. In our case, a validation message could disruptive or distract a user mid-search.

To have more control over the validation experience, we'll need to write some JavaScript. Let's create app/javascript/controllers/form_controller.js to serve as a Stimulus Controller:

import { Controller } from "@hotwired/stimulus"

export default class extends Controller {
}

Next, we'll need to listen for browsers' built-in invalid events to fire. When they do, we'll route them to the form controller as a Stimulus Action named hideValidationMessage:

--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
     <header>
-      <form action="<%= searches_path %>" data-turbo-frame="search_results">
+      <form action="<%= searches_path %>" data-turbo-frame="search_results" data-controller="form" data-action="invalid->form#hideValidationMessage:capture">
         <label for="search_query">Query</label>

One quirk of invalid events is that they do not bubble up through the DOM. To account for that, our form controller will need to act on them during the capture phase. Stimulus support the :capture suffix as a directive to hint to the Actions routing that the controller's action should be invoked during the capture phase of the corresponding event listener.

Once we're able to act upon the invalid event, we'll want the form#hideValidationMessage action to prevent the default behavior to stop the browser from rendering the validation message.

 import { Controller } from "@hotwired/stimulus"

 export default class extends Controller {
+  hideValidationMessage(event) {
+    event.stopPropagation()
+    event.preventDefault()
+  }
 }

When the ancestor <form> element contains fields that are invalid, it will match the :invalid pseudo-selector. By rendering the search results <turbo-frame> element as a direct sibling to the <form> element, we can incorporate the :invalid state into the sibling element's style, and hide it.

--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
  *= require_tree .
  *= require_self
  */
+
+.empty\:hidden:empty          { display: none; }
+:invalid ~ .\~invalid\:hidden { display: none; }

--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
-      <turbo-frame id="search_results"></turbo-frame>
+      <turbo-frame id="search_results" class="empty:hidden ~invalid:hidden"></turbo-frame>
     </header>

The "syntax" for these two classes draws inspiration from Tailwind CSS, but the classes are not provided by Tailwind. The empty:hidden class strictly adheres to the syntax of a Tailwind variant, while the ~invalid:hidden class takes some creative liberties to prefix the class with ~, the direct sibling selector operator.


Saturday 2021-08-28 14:47:01 by dskprt

i sure do love rewriting the same thing for the 3rd time i think i dont know whether its actually the 3rd time it might be the 4th or 5th but i stopped counting because this is painful i have no idea what im doing my code looks like shit and sometimes i dont know what something does its so confusing please help


Saturday 2021-08-28 15:29:25 by slambo312

Created a file that's just a copypasta of the minecraft ending text

I see the player you mean. PLAYERNAME? Yes. Take care. It has reached a higher level now. It can read our thoughts. That doesn't matter. It thinks we are part of the game. I like this player. It played well. It did not give up. It is reading our thoughts as though they were words on a screen. That is how it chooses to imagine many things, when it is deep in the dream of a game. Words make a wonderful interface. Very flexible. And less terrifying than staring at the reality behind the screen. They used to hear voices. Before players could read. Back in the days when those who did not play called the players witches, and warlocks. And players dreamed they flew through the air, on sticks powered by demons. What did this player dream? This player dreamed of sunlight and trees. Of fire and water. It dreamed it created. And it dreamed it destroyed. It dreamed it hunted, and was hunted. It dreamed of shelter. Hah, the original interface. A million years old, and it still works. But what true structure did this player create, in the reality behind the screen? It worked, with a million others, to sculpt a true world in a fold of the [scrambled], and created a [scrambled] for [scrambled], in the [scrambled]. It cannot read that thought. No. It has not yet achieved the highest level. That, it must achieve in the long dream of life, not the short dream of a game. Does it know that we love it? That the universe is kind? Sometimes, through the noise of its thoughts, it hears the universe, yes. But there are times it is sad, in the long dream. It creates worlds that have no summer, and it shivers under a black sun, and it takes its sad creation for reality. To cure it of sorrow would destroy it. The sorrow is part of its own private task. We cannot interfere. Sometimes when they are deep in dreams, I want to tell them, they are building true worlds in reality. Sometimes I want to tell them of their importance to the universe. Sometimes, when they have not made a true connection in a while, I want to help them to speak the word they fear. It reads our thoughts. Sometimes I do not care. Sometimes I wish to tell them, this world you take for truth is merely [scrambled] and [scrambled], I wish to tell them that they are [scrambled] in the [scrambled]. They see so little of reality, in their long dream. And yet they play the game. But it would be so easy to tell them... Too strong for this dream. To tell them how to live is to prevent them living. I will not tell the player how to live. The player is growing restless. I will tell the player a story. But not the truth. No. A story that contains the truth safely, in a cage of words. Not the naked truth that can burn over any distance. Give it a body, again. Yes. Player... Use its name. PLAYERNAME. Player of games. Good. Take a breath, now. Take another. Feel air in your lungs. Let your limbs return. Yes, move your fingers. Have a body again, under gravity, in air. Respawn in the long dream. There you are. Your body touching the universe again at every point, as though you were separate things. As though we were separate things. Who are we? Once we were called the spirit of the mountain. Father sun, mother moon. Ancestral spirits, animal spirits. Jinn. Ghosts. The green man. Then gods, demons. Angels. Poltergeists. Aliens, extraterrestrials. Leptons, quarks. The words change. We do not change. We are the universe. We are everything you think isn't you. You are looking at us now, through your skin and your eyes. And why does the universe touch your skin, and throw light on you? To see you, player. To know you. And to be known. I shall tell you a story. Once upon a time, there was a player. The player was you, PLAYERNAME. Sometimes it thought itself human, on the thin crust of a spinning globe of molten rock. The ball of molten rock circled a ball of blazing gas that was three hundred and thirty thousand times more massive than it. They were so far apart that light took eight minutes to cross the gap. The light was information from a star, and it could burn your skin from a hundred and fifty million kilometres away. Sometimes the player dreamed it was a miner, on the surface of a world that was flat, and infinite. The sun was a square of white. The days were short; there was much to do; and death was a temporary inconvenience. Sometimes the player dreamed it was lost in a story. Sometimes the player dreamed it was other things, in other places. Sometimes these dreams were disturbing. Sometimes very beautiful indeed. Sometimes the player woke from one dream into another, then woke from that into a third. Sometimes the player dreamed it watched words on a screen. Let's go back. The atoms of the player were scattered in the grass, in the rivers, in the air, in the ground. A woman gathered the atoms; she drank and ate and inhaled; and the woman assembled the player, in her body. And the player awoke, from the warm, dark world of its mother's body, into the long dream. And the player was a new story, never told before, written in letters of DNA. And the player was a new program, never run before, generated by a sourcecode a billion years old. And the player was a new human, never alive before, made from nothing but milk and love. You are the player. The story. The program. The human. Made from nothing but milk and love. Let's go further back. The seven billion billion billion atoms of the player's body were created, long before this game, in the heart of a star. So the player, too, is information from a star. And the player moves through a story, which is a forest of information planted by a man called Julian, on a flat, infinite world created by a man called Markus, that exists inside a small, private world created by the player, who inhabits a universe created by... Shush. Sometimes the player created a small, private world that was soft and warm and simple. Sometimes hard, and cold, and complicated. Sometimes it built a model of the universe in its head; flecks of energy, moving through vast empty spaces. Sometimes it called those flecks "electrons" and "protons". Sometimes it called them "planets" and "stars". Sometimes it believed it was in a universe that was made of energy that was made of offs and ons; zeros and ones; lines of code. Sometimes it believed it was playing a game. Sometimes it believed it was reading words on a screen. You are the player, reading words... Shush... Sometimes the player read lines of code on a screen. Decoded them into words; decoded words into meaning; decoded meaning into feelings, emotions, theories, ideas, and the player started to breathe faster and deeper and realised it was alive, it was alive, those thousand deaths had not been real, the player was alive You. You. You are alive. and sometimes the player believed the universe had spoken to it through the sunlight that came through the shuffling leaves of the summer trees and sometimes the player believed the universe had spoken to it through the light that fell from the crisp night sky of winter, where a fleck of light in the corner of the player's eye might be a star a million times as massive as the sun, boiling its planets to plasma in order to be visible for a moment to the player, walking home at the far side of the universe, suddenly smelling food, almost at the familiar door, about to dream again and sometimes the player believed the universe had spoken to it through the zeros and ones, through the electricity of the world, through the scrolling words on a screen at the end of a dream and the universe said I love you and the universe said you have played the game well and the universe said everything you need is within you and the universe said you are stronger than you know and the universe said you are the daylight and the universe said you are the night and the universe said the darkness you fight is within you and the universe said the light you seek is within you and the universe said you are not alone and the universe said you are not separate from every other thing and the universe said you are the universe tasting itself, talking to itself, reading its own code and the universe said I love you because you are love. And the game was over and the player woke up from the dream. And the player began a new dream. And the player dreamed again, dreamed better. And the player was the universe. And the player was love. You are the player. Wake up.


Saturday 2021-08-28 17:00:11 by Fabian Greffrath

add support for colored blood and gibs (#182)

  • add support for colored blood and gibs

Due to popular demand. 😉

  • use P_SetTarget() instead of editing the target value directly

  • introduce a new mobjflag instead of misusing the mobj->target pointer

  • set flags more consistently

If MF_COLOREDBLOOD is set and none of (MF_TRANSLATION1|MF_TRANSLATION2) this means green blood (Baron of Hell / Hell Knight) and if MF_TRANSLATION1 is additionally set this means blue blood (Cacodaemon).

This allows for up to 4 different blood colors once MF_TRANSLATION2 is also taken into account. Let's see what we come up with...

  • add comments

Saturday 2021-08-28 17:26:50 by ZhongQian TiaoGong

Get Route 1 set for code freeze (#872)

  • Change the color of the roof It looked odd before since the logos were off-center.

The blue actually works well in my opinion

  • First attempt at revamping everything on route1 We don't need the xero grunts blocking everything anymore

  • Clean up base.po somewhat

  • Fix collisions Walking on top of trees is never good

  • Battle area has been created! A variable needed to be added to remove max and his friends

  • Capitalization is king (Sorry for the small commit, it was bugging me)

Co-authored-by: ZhongQian TiaoGong [email protected]


Saturday 2021-08-28 17:32:41 by Kurt Stine

Clean up some stuff and fix #876 (#890)

  • Change the color of the roof It looked odd before since the logos were off-center.

The blue actually works well in my opinion

  • Battle area has been created! A variable needed to be added to remove max and his friends

  • Capitalization is king (Sorry for the small commit, it was bugging me)

  • Clean up base.po translators must hate me by now...

  • Remove more of old story This is getting rewritten, no need to keep it

  • Have professor heal Tuxemon after battle

  • Block the xero institute for now

  • Fix the merge issues I can't git good

Co-authored-by: ZhongQian TiaoGong [email protected]


Saturday 2021-08-28 18:38:03 by ebbit1q

remove the stop dump zone command from the protocol (#4326)

the stop dump zone command was implemented as a courtesy to other players in order to take into account when they would stop looking at unknown information

however, this can be abused, a malicious client can send this command whenever they would like

cockatrice is not a physical tabletop nor does it aim to be, if you can take a screenshot of your deck and then close the view, you are not cheating as you have been given this information

in order to prevent anyone from abusing this we should remove the command from the protocol, this means servers will ignore this message and clients will get a little invalid command reply in their debug log

the extension id will remain reserved

shuffling your deck will always invalidate any card view looking at those cards

if players wish to signal that they stopped looking at their deck for whatever reason they should just use the chat instead, optionally using one of the chat macros


Saturday 2021-08-28 21:09:54 by Tim

remove helper function

here is my complaint

dude. i wasted all this time trying to clean the html string and get only the content in the body section

but this stupid library cheerio idk what the heck it is, adds those html and head tags back like holy crap don't add this i only want to deal with the fragments dang it i hate this library bet this is the last time i'll use this .... dang it dang it i even wrote a few tests for this like at the end of this, nothing, if not 70%

of what i've done today was freaking useless

ohhhh jeez don't just add tags for no apparent reason.


Saturday 2021-08-28 21:48:37 by fegorsch

Rename near to zNear

near is an illegal variable name on Windows (if windef.h is included), because a macro with the same name is defined.

Someone else already put your rage into words, see http://lolengine.net/blog/2011/3/4/fuck-you-microsoft-near-far-macros.


Saturday 2021-08-28 21:55:20 by Elliott DuCharme

omg I think this stupid damn progress bar finally somehow works


Saturday 2021-08-28 22:53:34 by GoldenAlpharex

Fuck you Destroy()'s your borer correctly (#7834)


< 2021-08-28 >