Skip to content

Instantly share code, notes, and snippets.

@marcoscaceres
marcoscaceres / webshare.md
Last active August 24, 2020 01:38
How we implemented web share

How we implemented Web Share

Written by: Marcos Cáceres Technical reviewers: Kagami Sascha Rosylight, Sid Vishnoi.

This post describes how we implemented the Web Share API in Gecko, which is exposed as a DOM API to the Web. As it can be challenging to know how to implement new features in Gecko, it's intended to serve as a reference guide for other Gecko developers who need to implement similar DOM APIs in the future. For the impatient, the final implementation is available in Phabricator.

Before you start - some general advice about how things work

The following subsections give some general advice about what you should expect as you embark on implementing a new DOM feature.

@arachsys
arachsys / README
Last active April 23, 2024 19:02
Obtaining a shell on Yamaha Montage
This content has moved to https://arachsys.github.io/montage/
@mystor
mystor / cstring_outparam
Created July 19, 2019 22:05
Example session getting cstring outparameter
(rr) p (nsCString*)malloc(sizeof(nsCString))
$65 = (nsCString *) 0x7f74904b3430
(rr) p $65->nsTString()
$66 = void
(rr) p uri->GetSpec(*$65)
$67 = nsresult::NS_OK
(rr) p $65->get()
$68 = 0x7f748a61c50c "about:blank"
@bvaughn
bvaughn / updating-subscriptions-when-props-change-example.js
Last active March 27, 2022 09:29
Advanced example for manually updating subscriptions in response to props changes in an async-safe way
// This is an advanced example! It is not typically required for application code.
// If you are using a library like Redux or MobX, use the container component provided by that library.
// If you are authoring such a library, use the technique shown below.
// This example shows how to safely update subscriptions in response to props changes.
// In this case, it is important to wait until `componentDidUpdate` before removing a subscription.
// In the event that a render is cancelled before being committed, this will prevent us from unsubscribing prematurely.
// We also need to be careful about how we handle events that are dispatched in between
// `getDerivedStateFromProps` and `componentDidUpdate` so that we don't put stale values into the `state`.
@shubheksha
shubheksha / brackets-pair-colorizer.md
Last active June 14, 2024 09:15
A list of extensions/plugins that highlight matching parens/braces for various editors/IDEs.
@ceejbot
ceejbot / esm_in_node_proposal.md
Last active June 20, 2024 10:45
npm's proposal for supporting ES modules in node

ESM modules in node: npm edition

The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.

Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.

This repo also contains a bundled version of npm that has a new command, asset. You can read the documentation for and goals of that comma

@jrburke
jrburke / styles.less
Last active May 17, 2017 06:10
Prevent Atom 1.17 docks from animating their toggle buttons
/*
Choose Atom, Stylesheet... menu to add these to your local style overrides.
These styles only work on the .left and .bottom toggle buttons, but should
be straightforward to copy the .left selectors and adjust for other edges.
*/
.atom-dock-toggle-button:not(.atom-dock-toggle-button-visible) .icon {
opacity: 1;
transition: unset;
}
#!/usr/bin/python
import sys
def parse_nm_output(handle):
current_object = None
symbols = {}
symbol_to_object = {}
for line in handle.readlines():
@alirobe
alirobe / reclaimWindows10.ps1
Last active July 3, 2024 09:36
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@rnewman
rnewman / bookmark-sync-2.md
Created December 5, 2015 01:58
Bookmark Sync 2

Implementing bookmarks sync… again

Since our first installment we've implemented batched downloading for bookmarks: Bug 1201108.

This incrementally populates a local snapshot of the server (initially termed the ‘mirror’, now more accurately renamed the ‘buffer’), validating each record and fitting the contents into a relational schema. As it processes folders it also fills a table with the top-down structure of the downloaded records. We can be confident that when the downloader finishes, we'll have everything the server currently contains, minus any records that aren't well-formed.

What's next?

We're not done with schema changes: Bug 1201110. The buffer is a blind and forgetful one: it truly represents the current state of the server. We need more than that to sync — in order to find out what changed on each end since we last synced we n