Skip to content

Instantly share code, notes, and snippets.

@connorjclark
connorjclark / main.js
Last active December 5, 2021 23:23
web platform latest stable features script
const browserCompat = require('@mdn/browser-compat-data');
const browsersToConsider = [
'chrome',
'edge',
'firefox',
'safari_ios',
'safari',
];
@mbrubeck
mbrubeck / parallel-layout.md
Created September 22, 2017 23:48
Parallel layout in Gecko

Parallel Layout in Gecko

Now that Gecko uses Servo's parallel style system, we want to work outward from there. The next phase could be parallel frame construction, and after that, parallel layout using Servo layout code.

Dividing work between Gecko and Servo

We want to ship this work incrementally (every six weeks), without needing to replace the entire layout system at once. There are a few ways we can convert

@captainbrosset
captainbrosset / creative-toolbar.md
Last active August 29, 2015 14:14
Firefox creative toolbar

One of the goals for 2015 is to provide more creative ways for designers and developers to make changes to the layout, behavior and design of a webpage, without only relying on typing CSS properties or Javascript code or HTML tags.

We've started to introduce more visual tools over the course of 2014, like the box-model highlighter, the CSS transform previewer, the cubic-bezier editor tooltip, and lately the new animation inspection panel.

There is a need to introduce more of these tools, and tie them up together in a UI that makes sense for designers and creative developers.

Here's a list of tools that so far either exist or are being developed or are planned and that together would form a very interesting toolkit:

  • relative to an element:
  • the element picker
anonymous
anonymous / prototype.html
Created October 30, 2014 16:41
Prototype created with Firefox DevTools Prototyper
<!DOCTYPE html>
<html>
<head>
<script>
var y = 1/2;
function funct(x) {
x = eval(x);
var result = x*x - (2*Math.cos(y)*x)-Math.pow((Math.sin(y)),2);
alert(result)
}
@rpl
rpl / dev_panel_example.js
Last active August 29, 2015 14:07
Extending the Firefox Developer Tools
// import base Devtools SDK Panel constructor
const { Panel } = require("dev/panel");
// import Devtools SDK Toolbox manager constructor
const { Tool } = require("dev/toolbox");
// import Class helper from the Addon SDK
const { Class } = require("sdk/core/heritage");
// import self module needed to result data resources urls
var self = require('sdk/self');
anonymous
anonymous / untrusted-lvl12-solution.js
Created June 26, 2014 15:52
Solution to level 12 in Untrusted: http://alex.nisnevich.com/untrusted/
/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the
@timo22345
timo22345 / flatten.js
Last active August 12, 2024 06:19
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/
Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/
@bgrins
bgrins / firefoxautorun
Last active March 17, 2016 15:28
Start firefox in a loop, allowing you to quit and have it auto rebuild devtools and restart.
# Start firefox in a loop, allowing you to quit and have it auto rebuild devtools and restart.
if [ -f mach ];
then
echo "mach exists. Starting loop."
trap "exit" SIGHUP SIGINT SIGTERM
while true
do
./mach build faster
./mach run --devtools --jsconsole -P dev
@leibovic
leibovic / dominant-color.js
Created June 9, 2011 16:27
Dominant Color
function getDominantColor(aImg) {
let canvas = document.createElement("canvas");
canvas.height = aImg.height;
canvas.width = aImg.width;
let context = canvas.getContext("2d");
context.drawImage(aImg, 0, 0);
// keep track of how many times a color appears in the image
let colorCount = {};