Skip to content

Instantly share code, notes, and snippets.

View fairchild's full-sized avatar

Michael Fairchild fairchild

  • Procore
  • California
View GitHub Profile
@fairchild
fairchild / upgrade_heroku_pg.sh
Created December 13, 2014 00:26
example script to upgrade a heroku postgresql database
#!/bin/bash
set -x
set -e
export APP_NAME=staging-webfarmforeman
export NEW_DB_NAME=HEROKU_POSTGRESQL_JADE
heroku addons:add pgbackups --app $APP_NAME
heroku addons:add heroku-postgresql:hobby-basic --app $APP_NAME
heroku pg:wait --app $APP_NAME
import numpy as np, matplotlib.pyplot as plt
# ----------------------------------------------------------------
# simply draws a thin-lens at the provided location
# parameters:
# - z: location along the optical axis (in mm)
# - f: focal length (in mm, can be negative if div. lens)
# - diam: lens diameter in mm
# - lbl: label to identify the lens on the drawing
# ----------------------------------------------------------------
@fairchild
fairchild / designer.html
Created August 10, 2014 07:07
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
<polymer-element name="my-element">
@fairchild
fairchild / fix_nokogiri_libxml_mismatch_on_mavericks.sh
Last active November 4, 2015 02:28 — forked from devpuppy/nokogiri libxml homebrew lion
eliminate the annoying nokogiri LibXML version mismatch on OSX
#!/bin/bash
# FIXME:
# WARNING: Nokogiri was built against LibXML version 2.9.0, but has dynamically loaded 2.8.0
NOKOGIRIR_VERSION=${1:-1.6.1}
LIBXML_VERSION=${2:-2.9.1}
LIBXSLT_VERSION=${3:-1.1.28}
gem uninstall nokogiri libxml-ruby
@fairchild
fairchild / m2x-simple-example.js
Last active August 29, 2015 13:58
super simple m2x api example
<!doctype html>
<html>
<head>
</head>
<body>
<form id='m2xform' action="#">
<input name='m2xApiKey' placeholder='m2x api key' value='3fef5d69c3a7eab559b733ba854baef1' >
</form>
<pre id='m2xexample'>m2x</pre>
@fairchild
fairchild / fogtest.rb
Created February 28, 2014 02:16
simple check if fog is working wtih cloud endpoint
require 'fog'
auth_url = ENV['OS_AUTH_URL']
username = ENV['OS_USERNAME']
password = ENV['OS_PASSWORD']
tenant = ENV['OS_TENANT_NAME'] # String
compute_client ||= ::Fog::Compute.new(:provider => :openstack,
:openstack_api_key => password ,
:openstack_username => username ,
@fairchild
fairchild / breezy-sample.breeze.json
Created January 27, 2014 19:27
sample breeze project
[]
@fairchild
fairchild / Vagrantfile
Last active January 2, 2016 11:09
sample Vagrantfile
Vagrant.configure(2) do |config|
config.ssh.forward_agent = true
config.vm.define "www", :primary=>true do |www|
end
# ================================================
@fairchild
fairchild / commonrc
Last active December 28, 2015 15:39
a localrc for the controller node
# Enable Logging
LOGFILE=/opt/stack/logs/stack.sh.log
LOG_COLOR=True
SCREEN_LOGDIR=/opt/stack/logs
@fairchild
fairchild / Dockerfile
Last active December 27, 2015 10:09
dockerfile defining a basic apt-cacher-ng service
# Apt-Proxy hosting image
#
# VERSION 0.1.0
# Use a modified version of the Ubuntu base image provided by dotCloud
FROM fairchild/ubuntu
MAINTAINER Michael Fairchild fairchild@stimble.net
ENV APT_PROXY apt.dockerdev.att.io
RUN apt-get update && apt-get install -y apt-cacher-ng