Skip to content

Instantly share code, notes, and snippets.

View mathjazz's full-sized avatar

Matjaž Horvat mathjazz

View GitHub Profile
0:43.63 Compiling fluent-ffi v0.1.0 (/Users/mathjazz/src/mozilla-central/intl/l10n/rust/fluent-ffi)
0:44.82 error[E0053]: method `as_string` has an incompatible type for trait
0:44.82 --> intl/l10n/rust/fluent-ffi/src/builtins.rs:397:32
0:44.82 |
0:44.82 397 | fn as_string(&self, intls: &IntlLangMemoizer) -> Cow<'static, str> {
0:44.82 | ^^^^^^^^^^^^^^^^^
0:44.82 | |
0:44.82 | expected struct `intl_memoizer::IntlLangMemoizer`, found a different struct `intl_memoizer::IntlLangMemoizer`
0:44.82 | help: change the parameter type to match the trait: `&intl_memoizer::IntlLangMemoizer`
0:44.82 |
--- a/intl/l10n/rust/fluent-ffi/src/bundle.rs
+++ b/intl/l10n/rust/fluent-ffi/src/bundle.rs
@@ -18,21 +18,25 @@ pub type FluentBundleRc = FluentBundle<R
#[derive(Debug)]
#[repr(C, u8)]
pub enum FluentArgument {
Double_(f64),
String(*const nsCString),
}
Leopold:mozilla-central mathjazz$ hg diff
diff --git a/intl/l10n/rust/fluent-ffi/Cargo.toml b/intl/l10n/rust/fluent-ffi/Cargo.toml
--- a/intl/l10n/rust/fluent-ffi/Cargo.toml
+++ b/intl/l10n/rust/fluent-ffi/Cargo.toml
@@ -1,13 +1,13 @@
[package]
name = "fluent-ffi"
version = "0.1.0"
authors = ["Zibi Braniecki <zibi@braniecki.net>"]
edition = "2018"
@mathjazz
mathjazz / patch.diff
Created January 15, 2021 18:00
Machinery paging
diff --git a/frontend/src/modules/entitydetails/components/Helpers.css b/frontend/src/modules/entitydetails/components/Helpers.css
index 797833c17..e96f5e484 100644
--- a/frontend/src/modules/entitydetails/components/Helpers.css
+++ b/frontend/src/modules/entitydetails/components/Helpers.css
@@ -51,6 +51,7 @@
.react-tabs__tab-panel {
display: none;
+ height: calc(100% - 44px);
overflow-y: auto;
@mathjazz
mathjazz / utils.py
Last active December 11, 2020 10:24
More condensed utils.py
from django.db.models.functions import TruncMonth
from django.db.models import Avg, Sum
from pontoon.base.utils import aware_datetime, convert_to_unix_time, get_last_months
from pontoon.insights.models import LocaleInsightsSnapshot
def get_insights(query_filters=None):
"""Get data required by the Insights tab.
@mathjazz
mathjazz / patch.diff
Created January 22, 2020 17:04
CSS fixes
diff --git a/frontend/src/core/comments/components/AddComment.css b/frontend/src/core/comments/components/AddComment.css
index c88621bf2..a3fd9f5d1 100644
--- a/frontend/src/core/comments/components/AddComment.css
+++ b/frontend/src/core/comments/components/AddComment.css
@@ -1,10 +1,10 @@
.comments-list .add-comment textarea {
- background-color: #272a2f;
- border: solid 1px #272a2f;
- border-radius: 5px;
- color: #AAAAAA;
@mathjazz
mathjazz / changeset.diff
Last active December 10, 2019 19:28
Prevent empty response in reducer
diff --git a/frontend/package.json b/frontend/package.json
index 44bd0742f..e2f2f4108 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -22,6 +22,7 @@
"lodash.debounce": "4.0.8",
"lodash.escaperegexp": "^4.1.2",
"lodash.flattendeep": "4.4.0",
+ "lodash.isempty": "4.4.0",
"lodash.isequal": "4.5.0",
@mathjazz
mathjazz / review_counts.py
Last active November 28, 2019 22:18
Reviewers with review counts
"""
Retrieve a list of reviewers for given locales and timeframe with a number of
suggestions they approved or rejected.
Self-reviewed translations are excluded from calculaton.
Output is formatted as CSV with the following columns:
* Locale
* User
* Number of Approved Suggestions
* Number of Rejected Suggestions
@mathjazz
mathjazz / times_to_graduate.py
Last active November 28, 2019 23:20
Times to graduate to new roles
"""
Retrieve times to graduate to a new role for translators and managers
of a given locale.
Output is formatted as CSV with the following columns:
* Locale
* User
* Date
* New Role
* Days in Previous Role
@mathjazz
mathjazz / patch.diff
Created September 3, 2019 08:30
Debug DB calls
Leopold:pontoon mathjazz$ git diff pontoon/
diff --git a/pontoon/base/models.py b/pontoon/base/models.py
index 0627cc95..ca5cf160 100644
--- a/pontoon/base/models.py
+++ b/pontoon/base/models.py
@@ -2846,8 +2846,34 @@ class Translation(DirtyFieldsMixin, models.Model):
locale=self.locale
)
+ import logging