Skip to content

Instantly share code, notes, and snippets.

View justinribeiro's full-sized avatar
🌩️
Darkness falls.

Dr. Justin Ribeiro, Ph.D. justinribeiro

🌩️
Darkness falls.
View GitHub Profile
@justinribeiro
justinribeiro / aws-positivessl-cert-chain-instructions.md
Created December 2, 2015 20:26
What the "Certificate Chain" field needs for AWS, PositiveSSL edition.

Because the "Certificate Chain" field for AWS always throws me when someone asks what the order of the certs are. Every. Single. Time.

(openssl x509 -inform PEM -in COMODORSADomainValidationSecureServerCA.crt; openssl x509 -inform PEM -in COMODORSAAddTrustCA.crt)

Where's the trust root? Don't need it; you'll get an contains anchor issue when testing.

@justinribeiro
justinribeiro / index.html
Created July 30, 2015 00:16
Access a specific record in a firebase-collection based on array bind in Polymer
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Firebase + Polymer + Array Access</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
@justinribeiro
justinribeiro / program.cs
Created June 22, 2015 16:47
setCors - simple command line program to set CORS header properties on Azure BLOB store.
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Shared.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace setCors
@justinribeiro
justinribeiro / edit-name.html
Last active March 15, 2016 12:38
Basic updating with custom Polymer element, firebase-collection, and firebase-document
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/firebase-element/firebase-document.html">
<dom-element id="edit-name">
<template>
<style>
:host {
display: block;
padding: 1em;
}

Keybase proof

I hereby claim:

  • I am justinribeiro on github.
  • I am justinribeiro (https://keybase.io/justinribeiro) on keybase.
  • I have a public key whose fingerprint is 1CD2 20B8 5C1B 137E 3ADA 3E20 D749 67A6 9AC0 E195

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am justinribeiro on github.
* I am justinribeiro (https://keybase.io/justinribeiro) on keybase.
* I have a public key whose fingerprint is 6D2D 7831 934B 7FCF 97F8 EF1E 8852 BB43 E48B 9932
To claim this, I am signing this object:
@justinribeiro
justinribeiro / sub-to-glass.ru
Last active August 29, 2015 14:01
Really fast testing subscription for Glass w/Ruby
require 'omniauth'
require 'google/omniauth'
require 'google/api_client/client_secrets'
CLIENT_SECRETS = Google::APIClient::ClientSecrets.load
client = Google::APIClient.new(:application_name => 'Ruby Mirror test',
:application_version => '1.0.0')
mirror = Google::APIClient.new.discovered_api('mirror', 'v1')
@justinribeiro
justinribeiro / glass_wsh.py
Created March 20, 2014 17:21
Simple pywebsocket setup for listening to MQTT broker.
_OPEN_ = 1
_CLOSING_ = 2
_CLOSE_ = 3
_status_ = _CONNECTING_
# broker information for mqtt
_BROKER_URL = "localhost"
_BROKER_PORT = 1883
_TOPIC_BASE = "justin/glass"
@justinribeiro
justinribeiro / wp2redirect.sql
Last active August 29, 2015 13:56
Creates a column full of 301 redirects from published Wordpress post based on permalink.
--
-- Wordpress perma to 301 redirect
--
-- This script will output a column called rewrite_rule with a set of 301 redirect rules for an .htaccess file.
--
SET @table_prefix = "wp_";
SET @url_base_target = "http://www.soemthing.new/blog";
SET @generateSql = CONCAT("
@justinribeiro
justinribeiro / gist:9262457
Last active August 29, 2015 13:56
Get a list of permalinks from Wordpress 3.8 via MySQL
SELECT
wpp.post_title,
wpp.guid,
wpp.post_date,
CONCAT(wpo_su.option_value, REPLACE(REPLACE(REPLACE(REPLACE(wpo.option_value, '%year%', DATE_FORMAT(wpp.post_date, '%Y')), '%monthnum%', DATE_FORMAT(wpp.post_date, '%m')), '%day%', DATE_FORMAT(wpp.post_date, '%d')), '%postname%', wpp.post_name)) AS permalink
FROM wp_posts wpp
INNER JOIN wp_options wpo
ON wpo.option_name = 'permalink_structure'
INNER JOIN wp_options wpo_su
ON wpo_su.option_name = 'siteurl'