Guides, Hackintosh, Technology, Tip

Enable macOS Volume Controls for HDMI and DisplayPort Audio Devices

Another Hackintosh post…it’s been bothering me that I couldn’t control the volume of my Hackintosh through the use of the volume buttons on my keyboard (by default macOS won’t let you control the volume of an HDMI device and my sound is output through HDMI on my video card). After googling around a bit I managed to find a solution using Soundflower that I thought I’d share:

  1. Download this zip file (it contains two .dmgs we’ll need for the next steps)
  2. Unzip the file and open the Soundflower.dmg double click the Soundflower.pkg and follow the installation steps
  3. Repeat step 2 but with the Soundflowerbed.dmg
  4. Click the Soundflowerbed in the menu bar and set the 2ch option to point towards your HDMI/DisplayPort input:
  5. Open up Sound in System Preferences and set the Output/Input to Soundflower (2ch)

You should be able to control the audio coming through your device via your keyboard now! I’ve been using it for the better part of a day listening to music pretty much without issue. It glitched once for a few seconds, but clicking the Soundflowerbed icon in the menu bar, changing the source away from Soundflower and then immediately back fixed it instantly.

Guides, Hackintosh, Technology, Tip

Fixing iMessage on Your macOS Sierra Hackintosh

iMessage icon

I wrote a lengthy post the other day about how to build a Hackintosh, and while everything worked pretty smoothly, the one thing I was missing was iMessage. I’d tried to follow a couple of guides, and while they worked at getting iMessage running, all of them without fail stopped my GPU from responding correctly. After a bit of tinkering, though, I finally managed to get everything up and running. Here’s what I did below (MASSIVE thanks to /u/cobo10201 for getting me 99% of the way there I wouldn’t have even known where to begin without that post).

  1. Mount your EFI using EFI Mounter v3
  2. Make a copy of your config.plist and name it config-bak.plist in case something goes wrong.
  3. Open terminal and enter the following command: uuidgen
  4. Open your config.plist in Clover Configurator.
  5. Go to the SMBIOS and paste the UUID you generated in step 2 into the smUUID field.
  6. In the Board Serial Number field, copy and paste your system serial number and then add 5 random numbers and letters.
  7. In Finder go to Go > Go to Folder… and enter the following path: /Users/[Username]/Library/Caches delete all files and folders that begin with the following:
Guides, Hackintosh, Side Project, Technology

Building a Hackintosh with macOS Sierra (10.12.3)

macOS Sierra Hackintosh Desktop

Over the last year or so, I’ve been finding my 13-inc MacBook Pro severely lacking in the power department. While I was able to deal with it for a while, while I was doing strict development work, recently a series of requests to edit some videos rolled in and I found myself struggling to keep Final Cut Pro from crashing every fifteen minutes as I clipped and subtitled the pieces. Finally fed up, I decided to build a Hackintosh after realizing—quite frankly—that I couldn’t afford a genuine Mac (and that I could make a machine way more powerful than what I’d be buying for 1/3 of the price).

That being said, I know that the process can be arduous—it took me about 4 hours to get everything working right—so I figured I’d share what I did to get my build up and running (since I hadn’t seen anyone with the exact same configuration). Two quick things before we get started, though. First and foremost, a quick disclaimer:

Side Project, Tip

How to Remove All Slack Files Older than 30 Days (With Ruby!)

Over the past year or so I’ve been hosting (moderating?) a private slack channel for some of my friends from high school and previous jobs. What started as a small channel of about five people as since grown into a small community of around forty. While this isn’t an enormous number, it’s large enough that we’ve been eating through our storage space rather quickly. My first thought was to go to the Slack management console, erase a bunch of old files, and be about my day. Unfortunately, unless you’re on a paid tier you can’t manage files very well (you’d have to remove each one individually…and seeing as around 98% of our files were tiny memes that would take forever).

Enter Ruby!

After some Googling around I found this awesome gist that did the bulk of the work for me. I just replaced the throwaway token with my own and saved the script. That should have been the end of it, but I kept getting a series of SSL errors on my Windows 10 machine that wouldn’t let me run the code.


How to Use the UINavigationController Swipe Back Gesture with a UIPageViewController

I’ve been working on an app at work that’s “Snapchat-eqsue” (uses a UIPageViewController to page between a full-screen camera and a UINavigationController) when I came across this conundrum. Basically, the app is setup as follows:

Please excuse the poor lighting and shoddy sketch. It's early and I didn't feel like opening Sketch.
Please excuse the poor lighting and shoddy sketch. It’s early and I didn’t feel like opening Sketch.

So the Camera is the leftmost view in the PageViewController and the UINavigationController, along with all the views it will add to its stack, is on the right. Things got a bit tricky though when our designer wanted to avoid using physical back buttons on the navigation stack and have the traditional swipe back take you to the previous page. My first instinct was to intercept the PageController gestures, but when it’s set to scrolling, those don’t actually exist–the gesture array comes up empty. That’s when I came up with this fun little hack that’s incredibly easy to do.

The tl;dr is you disable the UIPageViewController’s UIScrollView when the NavigationController displays any view that’s not the root view controller and add a swipe gesture recognizer to each of the subviews. While this sounds like a lot of tedious work, it’s actually really easy if you just subclass UIViewController and use that app-wide (which is actually nice for a variety of reasons like themeing–but that’s for another post).


How to Find the Index of a Checked Row in a Table Using jQuery

I’ve been working on a web app for work recently (not my forte), so I’ve been learning a lot of jQuery recently and thought I’d share a little snippet that took me far too long to write:

Basically, what the snippet does, is scan through the table I have on my page and return an array of every row thats had a checkbox checked in. Super simple, but with my limited knowledge incredibly frustrating. Anyway, I hope this helps anyone else that’s had the same issue.


AFNetworking: Downloading Files with Progress

I was looking for this the other day, and while there are a ton of solutions out there, I felt that all of them were just a tad more complicated than they needed to be to achieve the desired result. Basically, I’m working on an app that needs to download videos and show what percentage of the files have been downloaded in a UITableView. Standard stuff, but for some reason it’s not already built in to AFNetworking. After tinkering around with a few different solutions online, I ended up coming up with my own (shown below). I ended up creating a class called MFVideoDownloader and adding the the following class method to the .m:

While the snippet contains more detailed comments, I’ll just go through what I did really quickly.

    1. First I created the session manager to handle the actual download task that comes about later in the method.
    2. Then I converted the given NSString into an NSURL so it can be used later (I’m working with a REST API that gives me back the URLs I need as strings so it made more sense to convert it here rather than have to convert every place I call the method in app).

Push Notifications, UIUserNotificationSettings, iOS 7, and UIKit

Earlier today, while trying to set my app up to register for notifications in iOS 7 and iOS 8, I came across this exceptionally annoying bug that took me the better part of my work day to iron out. What should have been a simple process ended up keeping me bogged down pouring over the same 11 lines of code for the better part of 6 hours and so in the interest of helping out anyone else that runs across the issue I figured I’d post my solution here.

First the code snippet:

It’s a super common chunk of code that’s all over the internet from personal blogs to stackoverflow that simple allows an app to register for notifications in both iOS 7 and iOS 8. In an ideal world, the process should have been simple, just insert the code snippet, hit run, and then watch everything fall into place: but for some reason as long as the following line was present my app would crash in iOS 7 repeatedly: [UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeAlert | UIUserNotificationTypeBadge | UIUserNotificationTypeSound) categories:nil];  with the following error: dyld: Symbol not found: _OBJC_CLASS_$_UIUserNotificationSettings .


Inverting a UIColor

More safekeeping than anything else (and because I didn’t see it online anywhere):

Super simple method that’s surprisingly useful if you have something like different themes in an app.


Triangular Imageviews

Certainly not the most climactic way to break my year long posting drought, but I’ve been working on an in house app for my devshop that requires a bunch of triangular UIImageviews and I thought I’d share a quick snippet:

The code itself is pretty simple but just a couple of quick notes on the values used:

  • The 44 value in step 1 is the height of the original view, while 60 is the width (and 30 is half that). I tried using more dynamic values (setting 44 to imageview.frame.size.height etc.) but for some reason when using dynamic values in UITableViewCells I’d get some sizing issues and so I opted to hard code the values in. (I’m assuming because it’s still doing some layout calls.)
  • This code actually isn’t limited to just triangles. By modifying the path in step 1 you can make the ImageView any shape at all, it’s just a matter of playing around with the coordinates until you get something you like.