Skip to content

Instantly share code, notes, and snippets.

@masselmello
masselmello / rsg_group_mcfit_high5_johnreed_capacity_widget.js
Last active March 26, 2024 11:41
iOS widget powered by the Scriptable app that shows the current capacity of your McFit gym (RSG group)
/**
* Script for scriptable to get the current capacity of McFit Gyms
*/
let gymId = 1731068920
let param = args.widgetParameter
if (param != null && param.length > 0) {
gymId = param
}
const currentGymCapacity = await fetchGymCapacity(gymId)
@dvf
dvf / change-codec.md
Last active May 13, 2024 13:24
Enable High Quality mode on your headphones (Updated for macOS Catalina)

If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.

Find out what codec you're using

  1. Play a song on your headphones
  2. Option (⌥) click the Bluetooth button at the top of your screen Inspect the Bluetooth Coded
  3. If you're using AAC or aptX, you can stop here—those are the highest quality codecs.

Change your codec to AAC or aptX

@steipete
steipete / ios-xcode-device-support.sh
Last active December 12, 2023 03:36
Using iOS 15 devices with Xcode 12.5 (instead of Xcode 13)
# The trick is to link the DeviceSupport folder from the beta to the stable version.
# sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
# Support iOS 15 devices (Xcode 13.0) with Xcode 12.5:
sudo ln -s /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/15.0 /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
# Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
# (A similar approach works for older versions too, just change the version number after DeviceSupport)
@DerAndereAndi
DerAndereAndi / Description.md
Last active December 15, 2015 09:19
Ground Control additions, see description.md file below

Ground Control by @mattt is a great iOS library to remotely configure your iOS app by sending plists from a server to your app and then updating the user defaults values.

I wanted to extend this a bit with the following ideas in mind:

  • Define the values in a JSON file, instead of uploading an updated plist file to the server
  • Define values independently for given bundle identifiers, bundle version and language combination, so I can modify e.g. beta and debug versions independently from released apps
  • Values can be defined in a default language for a bundle version and overwritte on language specific entries like en. You can also only use default or only use specific languages
  • Return an empty plist for all unknown bundle identifiers or bundle versions
  • Don't check for config updates on every startup or every time the app becomes active, but only once a day or a remotely configurable amount of days
  • Right now the server side ph
@steipete
steipete / AppDelegate.m
Last active December 13, 2015 17:29
Hook onto NSNotificationCenter to see all notifications.
[[NSNotificationCenter defaultCenter] addObserverForName:nil object:nil queue:nil usingBlock:^(NSNotification *note) {
NSLog(@"%@: %@", note.name, note.userInfo);
}];
@dtmilano
dtmilano / android-select-device
Last active November 29, 2023 09:29
Script to select one connected device or emulator when running adb
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2022 Diego Torres Milano. All rights reserved.
#
# The simplest way to invoke this script is creating a function like
# this one in your shell startup file:
#
# ```
# adb ()
@steipete
steipete / gist:1175357
Created August 27, 2011 12:54
Easy [fade] animation for UIImageView.image
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
selected_ = selected;
if (animated) {
CATransition *transition = [CATransition animation];
transition.duration = 0.25f;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionFade;
[self.selectionImageView.layer addAnimation:transition forKey:nil];
}