User:Razziabuissa/sandbox

This is my personal wikipedia in one page. Here we go...

After reading User pages

I realize that I am using this for non-wikipedia purposes. I'll perhaps host my own wiki locally and continue.

Though this would be a good candidate for adding c-t support to the wikipedia editor. And that's much easier than my other projects here!

Adding c-t support to firefox
Long time coming! https://bugzilla.mozilla.org/show_bug.cgi?id=433972

Now building firefox: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Mac_OS_X_Prerequisites

Working in directory ~/src; not sure why this is the default

Getting a build error Alright I finally read the fine print of https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Mac_OS_X_Prerequisites#1.2_Get_the_local_macOS_SDK

They want to use xcode 7.3.1 to get macos 10.11 sdk. This is confusingly different from the 10.15 mentioned above. I'm trying the 10.11 first, which has a 4.7 gig xcode dependency...

Ok how weird! By default it put my mozconfig in ~/src, which is outside ~/src/mozilla-unified. But then I copied mozconfig into mozilla-unified, and it wasn't git tracked, and I got a different error. Alright! I had the following in my mozconfig But apparently having both flags causes an error. Removing --enable-artifact-builds got it further... it ended with ERROR: nasm 2.13 or greater is required for AV1 support. Either install nasm or add --disable-av1 to your configure options. Actually, just enabling artifact builds seems to have it working without the sdk at all! That could have saved a lot of time.

Ok first successful build! Let's take that link, shall we? https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/So_you_just_built_Firefox"Your new Firefox executable can be found in: $OBJDIR/dist/bin/firefox. You can run it from there."Alright, what's OBJDIR?

Scrolling up to the build output, I see"From /Users/razzi/src/mozilla-unified/obj-x86_64-apple-darwin19.4.0/dist/bin/browser"Aha, dist/bin. Bingo!

Trying to run:  Ok, that's not super helpful...

Back to the original page, I see at the bottom: To launch the application, try running the following:

Alright let's do that.

Woohoo! An app launched

Not sure if putting the image here is against copyright, but it's at https://i.imgur.com/NKWlmCQ.png

Ok, success. Now to figure out what kind of place to add c-t support, so back to the original bug page.

One reflection is that I spent hours trying to get a thing to work when it wasn't even reading my mozconfig. Could the documentation make it clearer where mozconfig is supposed to be relative to mozilla-unified?

Installing ubuntu on macbook air without usb stick
referring to https://apple.stackexchange.com/questions/312264/installing-ubuntu-without-dvd-or-flash-drive

Alright I discovered PureOS is FSF certified for Respects Your Freedom. So I'll go with that instead. Grabbed the 9.0 ISO from https://pureos.net/download/.

I made a 120GiB partition, so now my mac files are on 380 / my roughly 500GiB hard disk.

I need some partitions:


 * 1.5gb partition for ISO
 * 1 MiB bios boot partition
 * 8GiB linux swap
 * remainder for files: 120 - 8 - 1.5 - .001 ~= 110.5 GiB. Pretty good.

I don't know what format to put these partitions in.

Ok first I used Disk Utility to make a APFS partition of 120gb, which took my computer offline for a bit, but then I realized I wanted to resize the disk. Now I took out the partition and I will use gdisk to make some empty space at the end of my current disk.

Learning how to integrate SAML
There are service providers (SPs) and identity providers (IPs). An institution such as a university is going to be an IP, and an application I develop a SP.

Editing my own wikipedia here
https://en.wikipedia.org/wiki/Wikipedia:User_scripts/List

I can make user pages under my_account/topic. So I can make wikipedia.org my own personal resource!

Would be nice to have editing view automatically focus at bottom of textarea.

Now I'm using the visual editor. Does my keybinding work? No :)

In order to make things work with the visual editor, I want to "rebind" M-RET to C-H-S, the keybinding to open the publish changes modal.

So I'm going to open a html scratch page to play around with keybindings. https://gist.github.com/razzius/9479251bd33b655a94f044e6c798b422

One key thing is to dispatch the event where there is also a keybinding. seems to work for these.

I have things working for m-ret to save from the source view, but I also want it to work from the visual view, since that is how I am taking notes here these days. The element is very stubbornly not responsive to clicking, however... $0.click does not work. Sending a keybinding c-s-s (control + option + s) does work, so I might try to hook in to that. document.body.dispatchEvent(new KeyboardEvent('keydown', {key: 's', altKey: true, ctrlKey: true, bubbles: true, which: 83})) works in Safari at least. Previously I was trying to use 's' but apparently the `which` wants it to be 83, for capital S.

Now I'm realizing M-RET doesn't work in this textarea. Does M-s?

Ok, so M-s now works and I can publish with M-s M-s. I could make M-s open the modal and submit it, but it would be nice to avoid the modal altogether. Perhaps the visual editor api could help here?

Example API usage:

How can I use that to publish? Trying to set a js breakpoint to see what happens when I click the publish button...

Looks like the relevant js code actually loads from the .php file.

Note that M-s is less than ideal since it triggers a system ui if it's not bound. M-RET does not have this issue but has another...

Relevant code seems to be relatively close to the top of sandbox/Scripts/load.php. For example: if (postEdit) { mw.hook('postEdit').fire({                message: mw.msg('postedit-confirmation-' + postEdit, mw.user)             }); } Interesting for sure: data.message = $.parseHTML(mw.message(mw.config.get('wgEditSubmitButtonLabelPublish') ? 'postedit-confirmation-published' : 'postedit-confirmation-saved', data.user || mw.user).escaped); mw.hook( 'wikipage.editform' ).fire might be what I want.

https://www.mediawiki.org/wiki/VisualEditor/Gadgets#Triggering_a_command_using_a_toolbar_tool

Adding metadata to a file, so that it can be associated with a gist
mdls js-key-rebind.html shows a bunch of metadata. It makes sense; the date updated needs to be somewhere on the file!

https://stackoverflow.com/questions/8530825/mac-os-x-add-a-custom-meta-data-field-to-any-file is useful.

https://stackoverflow.com/a/16306231/1636613 recommends. Here's example usage: xattr -w com.apple.metadata:GistID d2a52d478d868a188607042b756e037c js-key-rebind.html

mdls -raw -n GistID js-key-rebind.html

Final function: