Skip to content

Instantly share code, notes, and snippets.

View justinribeiro's full-sized avatar
🌞
Web Performance Tracing: because we can have nice things if you work for it.

Justin Ribeiro justinribeiro

🌞
Web Performance Tracing: because we can have nice things if you work for it.
View GitHub Profile
@justinribeiro
justinribeiro / ubuntu-diff.patch
Created November 5, 2016 03:10
Way to make Chrome-headless build on Ubuntu.
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh
index 832d116..4594934 100755
--- a/build/install-build-deps.sh
+++ b/build/install-build-deps.sh
@@ -244,9 +244,9 @@ if package_exists apache2-bin; then
else
dev_list="${dev_list} apache2.2-bin"
fi
-if package_exists xfonts-mathml; then
- dev_list="${dev_list} xfonts-mathml"
@justinribeiro
justinribeiro / vidcap1080.sh
Created September 21, 2016 16:03
Capture top left 1080 @ 60fps.
ffmpeg -video_size 1920x1080 -framerate 60 -f x11grab -i :0.0 -c:v libx264 -qp 0 -preset ultrafast my-file.mkv
@justinribeiro
justinribeiro / ae-handler.py
Last active November 2, 2016 18:55
Let's talk about AMP!
class MainHandler(http2.PushHandler):
def get(self):
name = os.path.join(os.path.dirname(__file__), 'dist/static/data/', self.request.path.lstrip("/amphtml/"), 'index.json')
f = open(name, 'r');
c = f.read()
f.close()
data = json.loads(c)
data['article'] = unescape(data['article'])
data['permalinkamp'] = data['permalink'].replace(".com", ".com/amphtml")
bot_template = os.path.join(os.path.dirname(__file__), 'dist/static/amphtml/index.html')
@justinribeiro
justinribeiro / check-wc.js
Created March 14, 2016 22:12
Check for need for WebComponents polyfill, use Shadow DOM.
var webComponentsSupported = ('registerElement' in document
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template'));
if (!webComponentsSupported) {
var script = document.createElement('script');
script.async = true;
script.src = '/bower_components/webcomponentsjs/webcomponents-lite.min.js';
document.head.appendChild(script);
@justinribeiro
justinribeiro / instructions.md
Last active February 8, 2016 19:58
Setting up your ENV

Installing all the things

  1. Install iTerm2

  2. Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  1. Install ZSH.
@justinribeiro
justinribeiro / instructions.md
Last active October 8, 2018 01:57
The Web Platform Podcast: Pipelines for publishing

Justin's Guide to faster episodes

The follwing is my working document as I create a pipeline for faster YouTube > LibSyn / iTunes distribution. This is not complete, but really cuts down on some time.

Prerequisites

I'm a commandline guy, I like UNIX tooling philosophy. Hence, my prereqs.

  1. youtube-dl
  2. ffmpeg
  3. mutagen
@justinribeiro
justinribeiro / ssl.md
Created February 2, 2016 20:01
StartSSL and Google SSL certs, the basics
  1. Go get the intermediate cert from StartSSL. All are available at https://startssl.com/root, but you probably just need the Class 1 DV PEM: https://startssl.com/certs/sca.server1.crt
  2. Put that file with your issued cert.
  3. Concat them. $ cat yourdomain.crt sca.server1.crt > concat.crt
  4. Upload that to the PEM encoded X.509 public key certificate field on https://console.developers.google.com/appengine/settings/certificates?project=yourproject
  5. Add your private key as normal.
  6. Assign to domain.
  7. Test chain with https://www.ssllabs.com/ssltest/
  8. Open in Firefox desktop or on mobile device to verify error gone away.
@justinribeiro
justinribeiro / gulp-gae-deploy-task.js
Created January 29, 2016 19:08
Because sometimes you just want to deploy to GAE and pester co-workers in Slack.
var git = require('git-rev-sync');
var slackconfig = require('./slackbot.json');
var slack = require('gulp-slack')({
url: slackconfig.webhook_url,
channel: slackconfig.channel,
user: slackconfig.user,
icon_emoji: slackconfig.icon_emoji
});
<?php
session_start ();
if (isset ( $_SESSION ['sess_user_id'] ) && isset ( $_SESSION ['sess_username'] )) {
header ( "Location: /home" );
exit ();
}
?>
... Begin HTML ...