Skip to content

Instantly share code, notes, and snippets.

View m8ttyB's full-sized avatar

Matt B m8ttyB

  • Nope
  • Earth
View GitHub Profile
import numpy as np
from data_prep import features, targets, features_test, targets_test
np.random.seed(21)
def sigmoid(x):
"""
Calculate sigmoid
"""
return 1 / (1 + np.exp(-x))
@m8ttyB
m8ttyB / taskcluster_win10_rdp.txt
Created October 24, 2019 14:16
Taskcluster: Win10 interactive session
Windows RDP
Install the `Microsoft Remote Desktop` client. If you are using a Mac, it is available through the App Store.
Start your test job via `./mach try fuzzy --full --disable-pgo --artifact`.\
From the generated treeherder link, inspect your test job and select `Inspect Task’
Once in the task inspector. Wait for the `iris-nightly-windows10-64-shippable/opt` task to be created
@m8ttyB
m8ttyB / composites.txt
Last active February 16, 2020 18:10
Exploring a question about primes
4
6
8
9
10
12
14
15
16
18
@m8ttyB
m8ttyB / gif.py
Last active April 10, 2017 20:40
Generate a gif from your jpgs
#!/usr/bin/env python
from lib import picture as p
import sys
if __name__ == '__main__':
jpg_filenames = p.list_images(sys.argv[1])
p.build_gif(jpg_filenames)
Some are our docs, some we might've used before:
https://developer.mozilla.org/en-US/docs/Learn/Accessibility
http://www.bbc.co.uk/gel/guidelines/how-to-design-for-accessibility
http://www.bbc.co.uk/guidelines/futuremedia/accessibility/html/
http://www.bbc.co.uk/guidelines/futuremedia/accessibility/mobile/user-experience
This one is currently a work in progress - https://developer.mozilla.org/en-US/docs/user:chrisdavidmills/Understanding_WCAG
# coding: utf-8
from selenium.webdriver import Firefox
from selenium.webdriver.common.by import By
f = Firefox()
f.get('https://crash-stats.mozilla.org')
l = f.find_element(By.CSS_SELECTOR, '#advanced-search .select2-container-active')
for i in range(2):
print 'displayed: {}, size: {}, location{}'.format(l.is_displayed(), l.size, l.location)

Keybase proof

I hereby claim:

  • I am m8ttyb on github.
  • I am m8ttyb (https://keybase.io/m8ttyb) on keybase.
  • I have a public key whose fingerprint is 5F61 FB76 48C1 F839 5F67 13D3 A395 B75E 8BB6 559E

To claim this, I am signing this object:

#!/bin/bash
set -o errexit
echo "Plug in your device"
adb wait-for-device
echo "Found device"
#dir=$(mktemp -d -t revision)
dir=$(mktemp -d -t revision.XXXXXX)
if [!dir]; then
mkdir dir
fi
@m8ttyB
m8ttyB / gist:3908174
Created October 17, 2012 21:04 — forked from davehunt/gist:2988477
Conditional xfails for pytest-mozwebqa tests.
import pytest
class TestConditionalXFails:
@pytest.mark.xfail("config.getvalue('platform') == 'MAC'")
def test_xfail_platform(self, mozwebqa):
assert False
@pytest.mark.xfail("config.getvalue('browser_name') == 'firefox'")
@m8ttyB
m8ttyB / locales.sh
Created October 5, 2012 21:10
for testing the stub installer (curling ftw)
#!/bin/bash
# locales=(en-US ach af ak ar as ast be bg bn-BD bn-IN br bs ca cs csb cy da de el en-GB en-ZA eo es-AR es-CL es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gu-IN he hi-IN hr hu hy-AM id is it ja kk km kn ko ku lg lij lt lv mai mk ml mn mr nb-NO nl nn-NO nso or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son sq sr sv-SE sw ta ta-LK te th tr uk vi zh-CN zh-TW zu)
products=(firefox-beta-stub firefox-aurora-latest firefox-beta-latest firefox-nightly-latest)
locales=(en-US fr de lg)
platforms=(win linux linux64 osx)
for product in "${products[@]}"
do
for locale in "${locales[@]}"