Skip to content

Instantly share code, notes, and snippets.

View potch's full-sized avatar

Potch potch

View GitHub Profile
@potch
potch / center.css
Created August 6, 2014 05:06
CSS Centering Yay!
.thing-to-center {
position: absolute;
left: 50%; /* or wherever you want the horizontal center */
top: 50%; /* or wherever you want the vertical center */
transform: translate(-50%,-50%); /* The Magic™ */
}
@potch
potch / projectmeeting.md
Created May 21, 2014 17:04
Evolving the Project Meeting

Hello!

I've been mulling over ways we can improve upon and evolve the venerable Monday Mozilla Project Meeting for about a year now, and recently been in discussions with Chris Beard, Mitchell Baker, and Mardi Douglass about how we can adapt the current format of the meeting to the changing needs of Mozilla. The following is a proposal for some changes we'd like to make.

Audience

The Project Meeting will switch from a 100% public call to available for all Mozillians. The goal is to have as lightweight a barrier to viewing and participating in the meeting as possible. The official definition of the intended audience is "individuals who are active in the project and/or have a good faith interest in the mission".

Timing

document.webComponentsReady = new Promise(function (resolve, reject) {
document.addEventListener('WebComponentsReady', function (){
resolve();
});
});
function delegate(selector, handler) {
return function(e) {
var context = this;
var target = e.target;
var delegateEl = e.currentTarget;
var matches = delegateEl.querySelectorAll(selector);
for (var el = target; el.parentNode && el !== delegateEl; el = el.parentNode) {
for (var i = 0; i < matches.length; i++) {
if (matches[i] === el) {
handler.call(context, e);
@potch
potch / dealwithitdino.txt
Created April 24, 2014 18:05
Deal With It Dino
__
/..)
/ VV
/ /
/ /
,.--=^^^^^^^^^^^^=--/ /
__/ DEAL WITH IT /
<__.-|_|--------------|_|
@potch
potch / lonnen.js
Created April 8, 2014 23:47
fix corsica defaults
sendMessage('settings.set', {'plugin': 'reset', 'settings': {'defaultUrl': [
"https://assets.mozillalabs.com/Graphics/Wallpapers/Mozilla-is-my-Dinosaur/mozilla-dinosaur_wallpaper_1920x1200.jpg",
"http://i.imgur.com/HuyRINU.png bg=#e2e2e2",
"http://blog.seanmartell.com/wp-content/uploads/2013/09/dinosaur.png bg=#e4e4e4",
"https://farm4.staticflickr.com/3693/12294574244_088c606d68_o_d.png bg=#0076ba",
"https://assets.mozillalabs.com/Brands-Logos/Thunderbird/logo-only/thunderbird_logo-only_RGB-300dpi.jpg bg=#fff",
"https://assets.mozillalabs.com/Brands-Logos/Webmaker/mozilla-webmaker_logo-wordmark_RGB.jpg bg=#fff",
"https://assets.mozillalabs.com/Brands-Logos/Firefox%20Marketplace/logo-wordmark/firefox-marketplace_logo-wordmark_RGB-300dpi.jpg bg=#fff",
"http://airmozilla-ops1.corpdmz.scl3.mozilla.com/calendar/slide.html",
"https://assets.mozillalabs.com/Brands-Logos/Firefox/logo-only/firefox_logo-only_RGB-300dpi.jpg bg=#fff",
@potch
potch / app.js
Last active August 29, 2015 13:58
I don't know what to call this.
import { KeyValueStore } from './storage';
import { d } from './dom';
window.addEventListener('load', function () {
var dom = d(
d.h1(settings.get('name').then(greet)),
d.div(
'This app has been run ',
d.b(
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<style>
body {
background: #ccc;
}
</style>
@potch
potch / nodetest.js
Created January 9, 2014 19:52
node hello world
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(8080, '127.0.0.1');
console.log('Server running at http://127.0.0.1:8080/');
@potch
potch / capture.sh
Created December 17, 2013 01:45
screenshot capture script
SLIMERJSLAUNCHER=/Applications/Firefox.app/Contents/MacOS/firefox casperjs test --engine=slimerjs screenshottest.js