Skip to content

Instantly share code, notes, and snippets.

View gertig's full-sized avatar

Andrew Gertig gertig

View GitHub Profile
@stevenharman
stevenharman / 00_Heroku-Release-Phase-Review-Apps-Rails_README.md
Last active March 11, 2024 04:11
Heroku Release Phase script for managing Rails DB migrations, and playing nice with Review Apps and postdeploy scripts

Heroku Release Phase + Review Apps + Rails

This is a simplified, but fairly thorough, set of scripts and configuration to enable Heroku Release Phase for Rails apps. Further, this particular set up plays nicely with Heroku Review Apps in that the release phase script will:

  1. Fail, loudly, if the DB does not yet exist.
  2. Load the DB schema if the current schema version (as determined by bin/rails db:version) is 0.
  3. Run DB migrations otherwise.

For a "normal" app that usually means it will run the DB migrations.

@jcgertig
jcgertig / VisibleToUser.js
Created March 15, 2017 19:58
React Pundit
require('./styles.css');
import React, {Component, PropTypes} from 'react';
import { connect } from 'react-redux';
import { meetsPolicy } from 'policies';
class VisibleToUser extends Component {
render() {
let { children, hasUser, type, value, user, action } = this.props;
@maccman
maccman / show.erb
Created December 26, 2016 23:37
Clearbit Reveal/Drift integration
drift.on('ready',function(api, payload) {
api.showWelcomeOrAwayMessage(<%== @options.to_json %>);
});
@cassidoo
cassidoo / checkbox
Created May 7, 2015 18:02
Style HTML Checkbox
<style>
input[type=checkbox] {
display: none;
}
input[type=checkbox] + label {
display: inline-block;
position: relative;
padding: 6px;
background-color: white;
@Turbo87
Turbo87 / app.js
Created February 15, 2015 04:05
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';

react-arduino

React has revolutionized the way we write user interfaces. It brings an extremely simple mental model to the authoring of UIs. React-native, react-canvas, and other projects have shown us that this model extends beyond the browser DOM.

I believe that this functional, predictable approach can also revolutionize how we build real-world user interfaces.

.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@stonehippo
stonehippo / SimpleAudioFXTrigger.ino
Last active December 19, 2022 03:21
A simple Arduino trigger of the Adafruit Audio FX Sound Board
// A simple trigger for the Adafruit Audio FX Sound Board
// For complete info on the sound board, see https://learn.adafruit.com/adafruit-audio-fx-sound-board/overview
/*
This is a simple test of a direct trigger of the Audio FX Sounds Board from an Arduino.
For my test, I used an Arduino Pro Mini running at 3.3v & 8mHz. Digital pin #4 of the Arduino
was connected to trigger pin #0 of the Sound Board, and I tied them to a common ground. I powered
Sound Board via a USB external battery for the initial tests, and the Arduino via the FTDI cable.
For later tests, I powered the Sound Board via the Arduino's VCC (3v) pin directly.
@baxang
baxang / get_app_version.rake
Created November 9, 2014 07:50
Read Info.plist and get a version number from a packaged iOS app distribution file(.ipa).
desc "Check binary version."
task :get_ver do
require 'rubygems'
require 'zip'
require 'pathname'
require 'cfpropertylist'
Zip::File.open('build/iPhoneOS-8.0-Release/WH.ipa') do |file|
plist = file.get_entry('Payload/WH.app/Info.plist')
content = CFPropertyList::List.new(format: CFPropertyList::List::FORMAT_BINARY, data: plist.get_input_stream.read)