Skip to content

Instantly share code, notes, and snippets.

View darkwing's full-sized avatar

David Walsh darkwing

View GitHub Profile

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@darkwing
darkwing / keybase.md
Created December 6, 2019 23:57
keybase.md

Keybase proof

I hereby claim:

  • I am darkwing on github.
  • I am davidwalsh (https://keybase.io/davidwalsh) on keybase.
  • I have a public key ASBLmc9ZRCsuaSj2i3Lb14HekUhk0bmuV2f4j8TGPG5Otgo

To claim this, I am signing this object:

@darkwing
darkwing / selectLocation.md
Last active March 26, 2018 15:30
Mo selectLocation mo problems

Fixing selectLocation Madness

At present the selectLocation method is trying to do too much, specifically because the auto-pretty-print logic is a bit weak:

if (
  prefs.autoPrettyPrint &&
  !getPrettySource(getState(), sourceId) &&
  shouldPrettyPrint(selectedSource) &&
 isMinified(selectedSource)
@darkwing
darkwing / emptylines.md
Last active November 6, 2017 17:36 — forked from bomsy/emptylines.md
How do we use babel: Empty Lines

The Firefox debugger has undergone a massive rewrite in the last two years, moving away from old Mozilla-specific technologies like XUL etc, to more modern technologies like React, webpack and babel.

[Babel][babel] is a tool for compiling Javascript into Javascript. It generates an [Abstract Syntax Tree (AST)][ast_wiki] which can be transformed, transversed or manipulated in various ways for use. Babel and AST's have played a major part in growth of the modern web tooling ecosystem.

Over the past year, we have used babel extensively in building the debugger, from disabling non-executable lines so breakpoints cannot be set to highlighting out of scope code and much more.

I felt it would be cool to write a couple of blog posts, documenting some of our coolest use cases and looking into some debugger internals as we go.

package Bugzilla::Extension::PhabBugz::WebService;
use 5.10.1;
use strict;
use warnings;
use base qw(Bugzilla::WebService);
use Bugzilla::Attachment;
Internal Errors
==============================
Response {
status: 500, // HTTP Code
data: {
error: "Internal error: {description of error}. This error has been logged and the team will address the problem shortly.",
}
}
Bugzilla
@darkwing
darkwing / common.less
Created May 9, 2016 18:43
MozReview "redesign"; mostly colors, not text-size and line-height.
#accountnav li {
visibility: hidden;
}
/*
Redesign below
*/
body {
@darkwing
darkwing / service-worker.js
Created October 22, 2015 20:00
This is the service worker
var EXTRA_FILES = [
"/xjs/_/js/k=xjs.ntp.en_US._WU8vYndmIc.O/m=jsa,ntp,d,csi/rt=j/d=1/t=zcms/rs=ACT90oH3VDY16AdrgBkBZukM4ZIP3OM-xQ",
];
var CHECKSUM = "e0n4rd";
var BLACKLIST = [
'/gen_204\?',
'/async/',
];
@darkwing
darkwing / gulpfile.js
Created October 13, 2015 14:45
"punky" theme build file for David Walsh Blog
'use strict';
/*
Ways to improve site speed for theme:
===========================================
- Store fonts.css in localStorage, don't make request if it's there
- Create a custom FontAwesome lib, lazyload
*/
var gulp = require('gulp');
var runSequence = require('run-sequence');
var minifyCss = require('gulp-minify-css');
var buildDir = './build/';
var build = new Date().getTime();
var minifyCssSettings = { advanced: true, aggressiveMerging: true };
// Main build