Skip to content

Instantly share code, notes, and snippets.

Avatar

Phil Sarin pdsarin

View GitHub Profile
View rearchitecture-scorecard.tsv
External Communication How your contexts communicate with the outside world. Do they use REST or an RPC protocol like gRPC?
Inter-Service Communication How do contexts communicate with each other? Synchronously or asynchronously? Is the message format text (e.g., JSON) or binary (e.g., avro, protocol buffers)? What messaging technologies do you use? (e.g., SNS, SQS, Kinesis, Kafka, RabbitMQ, some tables in your own database) How do you handle failures?
Authentication and Authorization How do people authenticate with your system? How do services (if you use them) authenticate with each other? How do you check that a user (whether person or machine) is authorized to perform an action?
Deployment and Operations How do you deploy to production? How do you monitor that the system is working correctly?
Upgrades and Patching How do you ensure that patches (especially security patches) are promptly applied?
Local Development How will developers develop against your system locally? Will they test against production, u
@pdsarin
pdsarin / gist:5377867
Created Apr 13, 2013
My favorite thing about Rake: You can extend a third-party rake task with pre-requisites and post-completion actions
View gist:5377867
task :build => [:install_provisioning_profiles, :update_plists] do |t|
package_app config
end
@pdsarin
pdsarin / plist_update.rb
Created Apr 13, 2013
Ruby/rake function to apply a set of updates to a plist. We use this to build the same codebase against several different App IDs (for alpha, beta, and release builds) without needing to manually install a bunch of config in xcode.
View plist_update.rb
def apply_plist_updates(updates, plist_file)
updates.each do |key, value|
sh "/usr/libexec/PlistBuddy -c 'Set :#{key} #{value}' #{plist_file}"
end
end
@pdsarin
pdsarin / profile_uuid.rb
Last active Aug 15, 2020
Ruby function to extract a provisioning profile UUID from a .mobileprovision file and to dynamically generate an xcconfig file
View profile_uuid.rb
# Extract a profile UUID from a mobileprovision file.
# Makes it easier to programatically build against a particular profile
# without having to install it manually.
require 'nokogiri'
def profile_uuid(provisioning_profile_path)
profile_contents = File.open(provisioning_profile_path).read
profile_contents = profile_contents.slice(profile_contents.index('<?'), profile_contents.length)
doc = Nokogiri.XML(profile_contents)
@pdsarin
pdsarin / grunt_watch.js
Created Jul 21, 2012
A grunt watcher that monitors directories instead of files
View grunt_watch.js
var watchr = require('watchr'),
grunt = require('grunt'),
_ = require('underscore'),
endsWith = function(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
};
grunt.tasks("clean default", null, function() {
var compile = _.debounce(function() {
grunt.tasks("default", null, function() {});
You can’t perform that action at this time.