Skip to content

Instantly share code, notes, and snippets.

View badeen's full-sized avatar

Jonathan Badeen badeen

View GitHub Profile
@koenbok
koenbok / qc-framer.js
Created May 14, 2014 15:04
QC Spring Value Converter
var QcValueConverter = {
tensionFromQcValue: function(qcValue) {
return (qcValue - 30.0) * 3.62 + 194.0;
},
qcValueFromTension: function(tension) {
return (tension - 194.0) / 3.62 + 30.0;
},
frictionFromQcValue: function(qcValue) {
[[FBSession activeSession] closeAndClearTokenInformation];
if (NSClassFromString(@"ACAccountStore")) {
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
if ([accountStore respondsToSelector:NSSelectorFromString(@"ACAccountStoreRemoveCompletionHandler")]) {
ACAccountType *fbType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];
NSArray *accounts = [accountStore accountsWithAccountType:fbType];
ACAccount *account = [accounts lastObject];
if (account) {
[accountStore renewCredentialsForAccount:account completion:^(ACAccountCredentialRenewResult renewResult, NSError *error) {