Skip to content

Instantly share code, notes, and snippets.

Michael Bleigh mbleigh

Block or report user

Report or block mbleigh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mbleigh
mbleigh / README.md
Last active Feb 24, 2019
Automate the deletion of old Firebase Hosting versions.
View README.md

Firebase Hosting Version Cleanup

This is a simple utility script for cleaning up Firebase Hosting versions, leaving a specified number of versions remaining. This is primarily done to conserve storage usage, but may have other uses.

USE AT YOUR OWN RISK. NO WARRANTY IS PROVIDED. THIS SCRIPT DOES DELETE STUFF PERMANENTLY

Usage

node cleanupVersions.js <site_name> <versions_to_keep> [commit]
View index.html
<script src="/__/firebase/3.7.4/firebase-app.js"></script>
<script src="/__/firebase/init.js"></script>
<script>
function funcURL(fnName) {
let projectIdIsh = firebase.app().options.authDomain.split('.')[0];
return `https://us-central1-${projectIdIsh}.cloudfunctions.net/${fnName}`;
}
</script>
View env.js
var ENVS = {
prod: {firebase: {firebaseURL: 'https://my-app-prod.firebaseio.com'}},
staging: {firebase: {firebaseURL: 'https://my-app-staging.firebaseio.com'}},
dev: {firebase: {firebaseURL: 'https://my-app-dev.firebaseio.com'}},
}
window.__env = (function() {
switch(window.location.hostname) {
case 'localhost':
return ENVS.dev;
@mbleigh
mbleigh / firebase.json
Created Aug 2, 2016
Firebase Hosting for apple-app-site-association
View firebase.json
{
"hosting": {
"headers": [
{
"source": "/.well-known/apple-app-site-association",
"headers": [{"key": "Content-Type", "value": "application/json"}]
}
]
}
}
@mbleigh
mbleigh / divshot-migration-guide.md
Last active Nov 2, 2016
Divshot to Firebase Hosting migration guide
View divshot-migration-guide.md

Firebase Migration Guide

Divshot has joined Google's Firebase! You can read more about the announcement on the Firebase blog. This guide is here to help you migrate and export your existing Divshot apps to Firebase Hosting.

If you don't already have a Firebase account, you'll need to create one. To do so, just visit firebase.com and sign up with your Google account.

@mbleigh
mbleigh / .travis.yml
Created Oct 30, 2014
Octopress + Travis CI + Divshot
View .travis.yml
language: ruby
rvm:
- 2.1.0
script: bundle exec rake generate
deploy:
provider: divshot
environment:
master: development
staging: staging
production: production
@mbleigh
mbleigh / comparison.md
Last active Nov 4, 2015
Comparing the features of Divshot and Firebase static web hosting.
View comparison.md

Divshot/Firebase Hosting Feature Comparison

Feature Divshot Firebase
Global CDN
Custom Domains
SSL Supported
Command-Line Tools
Simple Rollback
Free w/ Firebase
@mbleigh
mbleigh / gist:6260675
Created Aug 18, 2013
Example Heroku post-commit payload
View gist:6260675
app=dumb-hook-example&user=michael%40intridea.com&url=http%3A%2F%2Fdumb-hook-example.herokuapp.com&head=dd615b2&head_long=dd615b2dff8c35abfcbd49b45fb4e9d2cb965874&prev_head=8a0e2c7&git_log=%20%20*%20Michael%20Bleigh%3A%20Add%20another.
@mbleigh
mbleigh / gist:5703986
Created Jun 4, 2013
How to use Font Awesome in Divshot
View gist:5703986

How to Use Font Awesome in Divshot

  1. On the page, under Page Options select a Custom theme and use this URL: https://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css
  2. In the source editor, switch to CSS and add this line: @import url(https://netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.min.css)
  3. Now you should be able to add Font Awesome icons using the source editor.

Note: We aim to have more robust icon support in the future, but this is a workaround that should work for now!

@mbleigh
mbleigh / config.ru
Created Apr 8, 2013
Quick "Hello World" for running Grape and Sinatra together using Rack::Cascade.
View config.ru
# Put this in a new directory, then run `rackup`
require 'sinatra'
require 'grape'
class Web < Sinatra::Base
get '/' do
"Hello world."
end
end
You can’t perform that action at this time.