Skip to content

Instantly share code, notes, and snippets.

@pdsarin
pdsarin / grunt_watch.js
Created July 21, 2012 16:08
A grunt watcher that monitors directories instead of files
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() {});
@pdsarin
pdsarin / profile_uuid.rb
Last active August 15, 2020 05:51
Ruby function to extract a provisioning profile UUID from a .mobileprovision file and to dynamically generate an xcconfig file
# 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 / plist_update.rb
Created April 13, 2013 10:21
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.
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 / gist:5377867
Created April 13, 2013 10:26
My favorite thing about Rake: You can extend a third-party rake task with pre-requisites and post-completion actions
task :build => [:install_provisioning_profiles, :update_plists] do |t|
package_app config
end
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