Skip to content

Instantly share code, notes, and snippets.

View bfricka's full-sized avatar

Brian Frichette bfricka

  • Eturi Corp
  • San Diego
View GitHub Profile
@bfricka
bfricka / Domains.md
Created January 15, 2026 22:12 — forked from leminlimez/Domains.md
A deep dive into the iOS backup/restore system

Domains.plist

Documentation of /System/Library/Backup/Domains.plist. File taken from iOS 16.4 iPhone SE 3. The file was removed in iOS 17.0

Values

Values in the plist. Other than SystemDomains, these are not really important and are just here for preservation sake.

A domain in domains.plist contains keys that determine what gets backed up for what types of devices and where (i.e. iCloud vs iTunes). Not all domains have each key. The only 2 keys that must be in every domain are RootPath and RelativePathsToBackupAndRestore. Some domains have the value ShouldDigest. I am not sure exactly what it means but I have included it for documentation purposes.

  • Version: "24.0"
  • SystemDomains: (Dictionary), see below
#!/bin/bash
#
# Enable TRIM support for 3rd Party SSDs. Works for Mountain Lion, should work on earlier OSes too.
# Tested on 10.8.2, 10.8.3, 10.8.5, 10.9.0, 10.9.1, 10.9.2, 10.9.3, and 10.9.4
#
# You may have to re-apply the fix after some system updates, including but not limited to those below:
# 10.9.X to 10.9.4
# 10.9.X to 10.9.3
# 10.9.X to 10.9.2
# 10.8.X to 10.8.3
@bfricka
bfricka / routes.js
Created March 29, 2014 22:46
Sails.js + AngularJS: Supporting HTML5 routing.
var STATIC_ASSET_REGEX = /\..*/;
var routingTable = {
'/foo': true,
'/bar': true
};
module.exports.routes = {
'get /*': function(req, res, next) {
// Fast check for static assets
if (STATIC_ASSET_REGEX.test(req.path)) return next();
{
"directory": "components"
}
@bfricka
bfricka / bind-polyfill.coffee
Created April 6, 2013 03:15
Bind Polyfill in Coffeescript
unless Function::bind
Function::bind = (oThis) ->
# closest thing possible to the ECMAScript 5 internal IsCallable function
if typeof this isnt "function"
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable")
aArgs = Array::slice.call(arguments, 1)
fToBind = this
fNOP = ->
if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) {
if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function () {},
@bfricka
bfricka / package.json
Created March 28, 2013 06:42
Package.json Boilerplate
{
"name": "",
"description": "",
"version": "0.0.0",
"private": true,
"author": "Brian Frichette",
"homepage": "",
"contributors": [ "Brian Frichette <brian.frichette@gmail.com> (https://github.com/brian-frichette)" ],
"bugs": { "url": "" },
"scripts": { "start": "nodemon app.js" },
###
Initialize a new `Emitter`.
@api public
###
module.exports = Emitter = (obj) ->
return mixin(obj) if obj
@_callbacks = {}
###
@bfricka
bfricka / storageClass.coffee
Last active December 10, 2015 17:08
Amplify.Store Storage Wrapper
# This is really just an interaction wrapper for amplify
# I prefer this syntax for interacting with storage.
class Stor
# Constructor sets defaults for amplify
# and optionally for expiration and key
constructor: (key, exp) ->
@key = if key? then key else undefined
@exp = if exp? then exp else null
@amp = amplify.store
@bfricka
bfricka / angular-slide-fade.coffee
Created January 1, 2013 07:01
AngularJS slideFade / fade directives
# Requires jQuery.slideFade.coffee gist
# https://gist.github.com/4425644
app.directive 'slideFadeShow', ->
(scope, elem, attrs) ->
$elem = $(elem)
exp = attrs.slideFadeShow
duration = 600
slideElem = (toShow, init = false) ->