Skip to content

Instantly share code, notes, and snippets.

View zbraniecki's full-sized avatar

Zibi Braniecki zbraniecki

View GitHub Profile
~/projects/mozilla-unified central ⍉
▶ ./mach build -j80
0:00.49 /home/zbraniecki/.mozbuild/tup/tup upd /home/zbraniecki/projects/mozilla-unified/obj-x86_64-pc-linux-gnu-opt/<default> --debug-logging -j80
0:00.49 [ tup ] [0.001s] Scanning filesystem...
0:01.79 [ tup ] [1.296s] Reading in new environment variables...
0:01.79 [ tup ] [1.296s] No Tupfiles to parse.
0:01.79 [ tup ] [1.296s] No files to delete.
0:01.86 [ tup ] [1.367s] Executing Commands...
Traceback (most recent call last):
File "/usr/lib/python2.7/logging/__init__.py", line 892, in emit
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3360,6 +3360,13 @@ nsIDocument::LocalizationLinkAdded(Eleme
AutoTArray<nsString, 1> resourceIds;
resourceIds.AppendElement(href);
mDocumentL10n->AddResourceIds(resourceIds);
+ } else if (mReadyState == READYSTATE_COMPLETE) {
+ // Otherwise, if the document has already been parsed
+ // we need to lazily initialize the localization.
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -3360,6 +3360,12 @@ nsIDocument::LocalizationLinkAdded(Eleme
AutoTArray<nsString, 1> resourceIds;
resourceIds.AppendElement(href);
mDocumentL10n->AddResourceIds(resourceIds);
+ } else if (mReadyState == READYSTATE_COMPLETE) {
+ // Otherwise, if the document has already been parsed
+ // we need to lazily initialize the localization.
<Localized
id="create-account"
confirm={
<button onClick={createAccount}></button>
}
cancel={
<Link to="/"></Link>
}>
<p>{'<confirm>Create account</confirm> or <cancel>go back</cancel>.'}</p>
</Localized>
@zbraniecki
zbraniecki / first-line-indent.md
Last active August 17, 2018 16:22
Fluent 0.7 indentation feedback

Hi,

We're looking for feedback on the a behavior when writing multiline patterns in Fluent.

The decision we're trying to make is whether this message:

Variant 1

this-is-my-key =
@zbraniecki
zbraniecki / main.rs
Last active May 22, 2019 09:18
Generating Rust Functions
extern crate syn;
#[macro_use]
extern crate quote;
extern crate proc_macro2;
use quote::ToTokens;
use proc_macro2::{Ident, Span};
/**
* Generate a boilerplate for a plural rule function.
@zbraniecki
zbraniecki / fluent.vim
Created May 30, 2018 01:14
Fluent VIM syntax highlighting
if exists("b:current_syntax")
finish
endif
syntax match fluentComment "\v#.*$"
syntax match fluentIdentifier "^\v[a-zA-Z-]+" nextgroup=fluentDelimiter
syntax match fluentDelimiter "\s*=\s*" contained skipnl nextgroup=fluentPattern
syntax region fluentPattern contained start="" end="\v^(( )@!|( +[\.\[\*\}])@=)" contains=fluentPlaceableExpression
syntax match fluentAttribute "\v\.[a-zA-Z-]+" nextgroup=fluentDelimiter
syntax region fluentPlaceableExpression contained matchgroup=fluentPlaceableBraces start=+{+ end=+}+ contains=@fluentExpression
@zbraniecki
zbraniecki / ftl_migration.sh
Last active February 4, 2018 05:15 — forked from flodolo/ftl_migration.sh
FTL Migration script
#! /usr/bin/env bash
# trizen -S python2-virtualenv
# virutalenv2 migrate
# source migrate/bin/activate
# pip install mercurial
# pip install python-hglib
# sh ./ftl_migration.sh
function interrupt_code()
# This code runs if user hits control-c
@zbraniecki
zbraniecki / Description
Last active January 11, 2018 20:51
Powerstat on Lenovo X1 Carbon gen5, Arch Linux, Gnome, Wayland - Firefox usage w/ and w/o WebRender (2018-01-11)
This is a pretty unscientific study. I just had a browser with ~12 tabs open, including 3x gmail, slack, facebook, telegram, irccloud and a bunch of more static pages.
I placed Firefox window on half of my screen and terminal on the other. Selected the last tab (google results) and waited ~2 minutes,
until CPU was low.
Then I turned on powerstat, waited for 8 samples with Fx window not in focus, then started scrolling through each tab one after another.
I did this for about ~1min and then waited one more minute with Firefox not in focus (back on google search results).
Then I restarted the browser with WebRender on and performed the same procedure.
@zbraniecki
zbraniecki / attrs.ftl
Last active October 5, 2017 20:05
FTL ∞
key = Value
.attr = Attribute
.attr2 = Attribute 2
key.attr = Attribute
key.attr2 = Attribute 2
key
.attr = Attribute
.attr2 = Attribute 2