Skip to content

Instantly share code, notes, and snippets.

@tofumatt
tofumatt / linter.js
Created April 21, 2016 11:06
add hidden file scanner
// Line 372 in linter.js
scan(deps={}) {
return this.extractMetadata(deps)
.then((addonMetadata) => {
if (addonMetadata.hiddenFiles.length) {
// Make a warning
}
return;
})
Using worker: worker-linux-docker-e4fce81d.prod.travis-ci.org:travis-linux-10
travis_fold:start:system_info
Build system information
Build language: python
Build group: stable
Build dist: precise
Build image provisioning date and time
Thu Feb 5 15:09:33 UTC 2015
Operating System Details
@tofumatt
tofumatt / reconnect-to-servers.applescript
Created January 2, 2016 20:09
Applescript App to check connection status to NAS and reconnect every 30 seconds
tell application "Finder"
set serverName to "Bookshelf"
set mediaName to "Media"
set publicName to "Public"
set isConnectedToMedia to disk mediaName exists
set isConnectedToPublic to disk publicName exists
end tell
if isConnectedToMedia = false then
try
mount volume mediaName on server serverName
@tofumatt
tofumatt / a-new-validator.md
Last active November 22, 2015 20:10
Add-ons Draft Post

NOTE: I wrote this on WordPress.com and would've put it in the add-ons blog as a draft to review, but I am having some LDAP error and can't publish it there. So here it is for review, let me know!

A New Firefox Addons Validator

The state of add-ons has changed a lot over the past five years, with Jetpack add-ons rising in popularity and Web Extensions on the horizon. Our validation process hasn't changed as much as the ecosystem it validates, so today Mozilla is announcing its new Add-ons Validator, written in JS and available for testing today!

How the Add-ons Validator Fits in to Firefox

Add-ons are a huge part of the Firefox system and a fantastic reason to use Firefox. We already have [NUMBER OF ADDONS] available and with work underway to allow Web Extensions in Firefox, we'll see a lot more soon. For add-ons to be listed on the Firefox Add-ons site, they need to be reviewed and approved by Mozi

~/Projects/addons-validator[use-terminal-width❗ ]% bin/addons-validator tests/example.xpi --stack=true
RangeError: Maximum call stack size exceeded
at String.replace (native)
at RegExp.<anonymous> (/Users/matt/Projects/addons-validator/dist/webpack:/~/babel-core/~/core-js/modules/$.fix-re-wks.js:15:31)
at String.replace (/Users/matt/Projects/addons-validator/dist/webpack:/~/babel-core/~/core-js/modules/es6.regexp.replace.js:9:1)
at module.exports (/Users/matt/Projects/addons-validator/node_modules/columnify/node_modules/strip-ansi/index.js:5:39)
at module.exports (/Users/matt/Projects/addons-validator/node_modules/columnify/width.js:5:18)
at splitLongWords (/Users/matt/Projects/addons-validator/node_modules/columnify/utils.js:117:7)
at splitLongWords (/Users/matt/Projects/addons-validator/node_modules/columnify/utils.js:137:10)
at splitLongWords (/Users/matt/Projects/addons-validator/node_modules/columnify/utils.js:137:10)
module.exports = function(context) {
var variables = {};
return {
Identifier: function(node) {
// Start tracking a variable; it might be used to create an identifier
// we don't allow.
if (node.parent.type === 'VariableDeclarator') {
variables[node.name] = {
ops: 0,
reported: false,
@tofumatt
tofumatt / bad.js
Last active October 5, 2015 23:39
var m = "m";
var o = "o";
var z = "z";
var idb = "IndexedDB";
var tricksterVariable = m + o + z + idb;
var myDatabase = window[tricksterVariable];
var foo = "m";
foo += "o";
foo += "zIndexedDB";
// Not allowed!
var myDatabase = window[foo];
python manage.py compress_assets
/bin/sh: /code/node_modules/less/bin/lessc: Permission denied
/code/node_modules/less/bin/lessc /code/static/css/impala/tooltips.less /code/static/css/impala/tooltips.less.css exited with a non-zero status.
/bin/sh: /code/node_modules/less/bin/lessc: Permission denied
/code/node_modules/less/bin/lessc /code/static/css/zamboni/docs.less /code/static/css/zamboni/docs.less.css exited with a non-zero status.
/bin/sh: /code/node_modules/less/bin/lessc: Permission denied
/code/node_modules/less/bin/lessc /code/static/css/impala/developers.less /code/static/css/impala/developers.less.css exited with a non-zero status.
/bin/sh: /code/node_modules/less/bin/lessc: Permission denied
/code/node_modules/less/bin/lessc /code/static/css/impala/personas.less /code/static/css/impala/personas.less.css exited with a non-zero status.
/bin/sh: /code/node_modules/less/bin/lessc: Permission denied
Environment:
Request Method: GET
Request URL: http://192.168.99.101:8000/en-GB/firefox/
Django Version: 1.6.11
Python Version: 2.7.5
Installed Applications:
('olympia',