You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The last post on this blog was from the summer of '10. Since then, things got a little hectic and I was not able to dedicate much time to this blog. Things are little better now and after a lot of nagging from a lot of people, I've decided to revive this blog.
Copy file name to clipboardExpand all lines: _posts/2013-04-02-clean-code-SRP.md
+2-8Lines changed: 2 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,10 +43,6 @@ What advantage does this provide? Just like what happens with most software solu
43
43
44
44
With the old design, the interest calculation logic is embedded in the bank account class and changes to interest calculation could introduce bugs in your bank account logic as well. Moreover, since there is no clean separation of responsibilities, more and more functionality would get added into the bank account class and you end up with one big tangled mess that is difficult to understand and maintain.
45
45
46
-
![Spaghetti Code][spaghetti-code]
47
-
48
-
Photo: [Flickr][2]
49
-
50
46
If you have the interest calculation logic totally separated out, every time you change the code for interest calculation, your bank account class should mostly remain unaffected. Also, you could refactor your code in such a way that each interest scheme is a separate class and the interest calculator class could pick up the right scheme to use based on the account type and various other parameters. Having these small, focused classes makes your code easy to understand and maintain.
51
47
52
48
## I want more!
@@ -63,7 +59,5 @@ I have had good mileage applying the SRP to methods. It gives me small, focused
63
59
64
60
You may not end up with this type of a clean separation of concerns the first time you build a feature. Not to worry. Refactoring is your friend. Get in there, break it apart and revel in the glory of your readable, maintainable code! :)
Copy file name to clipboardExpand all lines: _posts/2016-10-15-output-audio-to-multiple-devices-simultaneously.md
+1-20Lines changed: 1 addition & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,39 +3,20 @@ layout: post
3
3
title: "Play audio through multiple headphones on your macOS"
4
4
category: Life Hacks
5
5
forreview: false
6
-
banner:
7
-
todo: |
8
-
- [x] review
9
-
- [x] image resizing
10
-
- [x] add reference links
11
-
- [x] add photo of audio splitter
12
-
- [ ] add banner image
13
6
---
14
7
15
8
Ever wanted to share a movie or song with a friend, but you did not have one of those audio splitters lying around? Here is an easy trick that you can do for free on your macOS to output audio to multiple devices at the same time.
*You **don't** need one of these - Photo: [Amazon](https://www.amazon.in/gp/product/B00904WS2K/ref=as_li_tl?ie=UTF8&camp=3638&creative=24630&creativeASIN=B00904WS2K&linkCode=as2&tag=macode-21&linkId=fc49ccc5c1f81bd23d29e5b7c812a444)*
20
-
21
10
*`⌘+space` to open up spotlight and type in **Audio MIDI Setup**.
22
11
23
12
* Hit the **+** menu on the bottom left of the window and click on **Create Multi-output device**.
* Select the audio devices to simultaneously send the output. In my case, these were the two headphones. That need not be the case though. You could, for example, have the audio play through your laptop speakers and your hi-fi headphones at the same time. If your audio devices have different sample rates, check drift correction.
Voila! You can now choose the new device as your speaker from the Audio icon in the menu bar. Bear in mind that you need one of the headphones to be a USB (or use a USB DAC) or bluetooth for this to work as there is only one 3.5mm jack in your Mac.
36
19
37
-
The **Audio MIDI Setup** app is a treasure trove of good stuff. You can combine multiple devices to create some pretty complicated setups for free. See this 4.0 setup for example.
0 commit comments