Skip to content

Instantly share code, notes, and snippets.

@blakewest
blakewest / inline-manual-helpjuice-docs.md
Last active September 11, 2015 23:46
Quick docs on how you could use the inline manual-helpjuice angular integration that I wrote. (find that integration here: https://gist.github.com/bwest87/8fac4913a000ff36aa6a)

Inline Manual is our in-app help tool.

I've written an "integration" for it with help-juice that allows you to bring in links to HelpJuice articles right into the app. It ends up looking like this: Inline manual help juice "integration" You can do this using the Inline Manual topic authoring tool, and there's no need to touch our actual code. Here's how it works.

1.) In the inline manual authoring tool, you'll put fields in that tell our app to look up articles in help-juice. It might look like this: Inline manual topic creation screen

2.) That's it. You're done.

@blakewest
blakewest / inline-manual-help-juice-integration.js
Last active September 11, 2015 23:38
A quick example of how we got inline manual and help juice "integrated" from our angular app. It may need some tweaking to fit your needs, but the flow would be the same, regardless of your framework. See "docs" on using this in the inlineManual editor here: https://gist.github.com/bwest87/2767e27e586190b4f97f
angular.module('app.services')
.factory('inlineManualService', inlineManualService);
function inlineManualService($templateCache, $http, $q, $compile, $rootScope, $timeout, helpJuiceService){
return {
onTopicStart: onTopicStart,
};
function onTopicStart(player, topic_id) {
var description = player.topics[topic_id].description;
@blakewest
blakewest / gist:ed22e52731f33f53f1f3
Last active September 22, 2015 21:02 — forked from khempenius/gist:55c6c1ca82163edb4bb2
Import Customers from Stripe
# Used when a practice's patients have been transferred to Stripe from
# another payment processing platform and we need to associate their Stripe
# customers with their Hint patients. This is done by matching credit card name
# to patient name or to email, or to address, or hint hid.
def get_customers(practice, params = nil)
response = Stripe::Customer.all(params, practice.stripe_token)
response.data.each do |customer|
stripe_customer_id = customer.id
source_with_name = customer.sources.data.find { |source| source.try(:name) }
@blakewest
blakewest / BreakingAPIChangeChecklist.md
Last active February 20, 2016 00:18
Breaking API Change Checklist

Important

  • Have all the soon-to-not-work attr names been globally searched for on the front end?
  • Have all the soon-to-not-work attr names been globally searched for on the back end?
  • Have any now unused files been cleaned up/deleted?
  • Are any data migrations necessary? (If so, consult the Data Migration Checklist)
  • Have we notified customers of any potential issues?
@blakewest
blakewest / Big discussion checklist
Created May 13, 2014 21:36
Things to bear in mind when having design related discussions.
**Things to consider when having a 'large' discussion, or design discussion**
Ask each question at the start of a discussion:
1.) How much data do we have or what is our evidence around the propsed need/problem?
2.) If there are outstanding questions to be answered, how can we answer them, and should we do that first before continuing?
3.) Do all of us need to be discussing this right now?
4.) What question really needs to be answered now?
** Now discuss **
describe('Coupons', function(){
// Set up vars that we'll want to use in multiple tests
var $httpBackend, $scope, $view, $location;
var merchantData, visit, couponNameField, couponAmountField, createButton;
// Load your app
beforeEach(module('my-app'));
beforeEach(inject(function(_$httpBackend_, _$rootScope_, _$timeout_, _$controller_, _$compile_, _$location_){
@blakewest
blakewest / data_migration_checklist.md
Last active August 29, 2015 13:58
Data Migration Checklist
  • There is good code coverage in tests
  • Edge case inputs have been thought of in the tests
  • Background jobs related to this migration have also been migrated
  • No polymorphic associations (they don't work because they use the migration's model class name)
@blakewest
blakewest / angular_code_review.md
Last active February 26, 2024 13:33
Angular Code Review Checklist

General

  • Are all vars used somewhere?
  • Do the vars have properly cased, and meaningful names?
  • Style looks appropriate
  • No unnecessarily duplicated logic
  • Code intent is clear upon initial reading
  • Any code that isn't clear, but is needed, has an effective comment
  • Are method calls or attribute lookups every called on entities that could be undefined/null?
  • The functions can appropriately handle unexpected inputs.
  • Commented code has been removed (comments themselves are fine).