Skip to content

Instantly share code, notes, and snippets.

View Manishearth's full-sized avatar
🍃
yahaha! you found me!

Manish Goregaokar Manishearth

🍃
yahaha! you found me!
View GitHub Profile
diff --git a/components/script/dom/audionode.rs b/components/script/dom/audionode.rs
index e8c03fbd62..2868996876 100644
--- a/components/script/dom/audionode.rs
+++ b/components/script/dom/audionode.rs
@@ -21,7 +21,7 @@ pub static MAX_CHANNEL_COUNT: u32 = 32;
#[dom_struct]
pub struct AudioNode {
- reflector_: Reflector,
+ eventtarget: EventTarget,
diff --git a/src/sudoku.rs b/src/sudoku.rs
index d3be5ff..e39c035 100644
--- a/src/sudoku.rs
+++ b/src/sudoku.rs
@@ -222,7 +222,7 @@ impl Sudoku {
// until we can't solve any more values with this method
let mut found = None;
- for (row_i, row) in self.tiles.iter_mut().enumerate() {
+ 'inner: for (row_i, row) in self.tiles.iter_mut().enumerate() {
@Manishearth
Manishearth / pem_extract.js
Last active February 9, 2018 08:54
Certificate PEM extractor
// http://mxr.mozilla.org/mozilla-central/source/security/manager/pki/resources/content/pippki.js
function getDERString(cert)
{
var length = {};
var derArray = cert.getRawDER(length);
var derString = '';
for (var i = 0; i < derArray.length; i++) {
derString += String.fromCharCode(derArray[i]);
}
@Manishearth
Manishearth / measurements.txt
Last active December 8, 2017 02:37
firefox frame construction and layout measurements
Pages were opened and refreshed a few times to let the cache settle down before measuring.
"fc" is time spent in the frame constructor NOT including any style resolution that the frame constructor did.
fc-style is the amount of time the frame constructor spent resolving styles; i.e. fc + fc-style is the total amount of time spent
in the frame constructor. fc is the number that indicates potential wins from speeding up the frame constructor
Measured with https://github.com/Manishearth/gecko/commit/42d3d0d810423e07ae410a3f64c4e443be6510a7
incorrect vmin/vmax for overflow:scroll iframes [WONTFIX] https://bugzilla.mozilla.org/show_bug.cgi?id=1393603
./layout/reftests/css-valuesandunits/reftest.list:fails-if(styloVsGecko||stylo) == unit-vh-vw-overflow-scroll.html unit-vh-vw-overflow-scroll-ref.html
./layout/reftests/css-valuesandunits/reftest.list:fails-if(styloVsGecko||stylo) == unit-vh-vw-overflow-scroll-x.html unit-vh-vw-overflow-scroll-x-ref.html
./layout/reftests/css-valuesandunits/reftest.list:fails-if(styloVsGecko||stylo) == unit-vh-vw-overflow-scroll-y.html unit-vh-vw-overflow-scroll-y-ref.html
./layout/reftests/css-valuesandunits/reftest.list:skip-if(Android) fails-if(stylo) != unit-vh-vw-overflow-auto.html unit-vh-vw-overflow-scroll.html
@page, page-break-inside [YES] https://bugzilla.mozilla.org/show_bug.cgi?id=1396044
#[inline(never)]
fn stylo(intpart: &[u32], fracpart: &[u32]) -> f32 {
let mut integral = 0.0f64;
let mut fractional = 0.0f64;
let mut factor = 0.1;
for i in intpart {
integral = integral * 10. + *i as f64;
}
for i in fracpart {
fractional += *i as f64 * factor;
# need to fill in the PR number here
git fetch origin refs/pull/$1/merge
git diff FETCH_HEAD^..FETCH_HEAD^2 -- . ':!tests' >/tmp/p.patch
# cd to gecko dir
cd servo/
</tmp/p.patch patch -p1
./mach try -b do -p linux64-stylo -u crashtest,mochitests,reftest,reftest-1,reftest-2,reftest-3,reftest-4 -t none
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html>
<head>
<style>
#block-start div {
border-block-start-color: red;
border-block-start-width: 2px;
border-block-start-style: dotted;
}
@Manishearth
Manishearth / stuff.md
Last active June 15, 2016 09:27
Rust GC hooks -- type system considerations

Identifying roots

As I understand it, the core of the Rust GC support functionality will be a function that looks like fn gimme_roots() -> Vec<..> or fn walk_roots<F>(f: F) where F: Fn(..). This can be implemented via LLVM stack roots and then walking them.

The first question is: What does the compiler identify as a root? On the flipside, how do GC library writers tell the compiler that something should be included in walk_roots?

Root attribute

(this solution is flawed, skip to the trace trait one if you want) One way to do this is an attribute, #[root] or something.