teleren/devto huggingface dataset:
Converting Audible *.aax files
Tags: linux
Published: 2019-05-16 12:48:41

---
title: Converting Audible *.aax files
published: true
tags: 
canonical_url: https://thej6s.com/articles/2019-05-04__converting-audible-to-free-format/
---

Audible has a great selection of audiobooks that can be downloaded and listened to on the go. However, there is one big caviat: All audiobooks have DRM on them and can only be listened to using the official audible app.

Wan’t to listen to the audiobook using your car’s stereo? Good luck. Wan’t to preserve the audiobook because you want to listen to it in 10 years time? Nope. Wan’t to use an android device without google play services or (heaven forbid) are looking forward to the linux smartphones landing in 2019? Amazon is laughing at you.

Luckily, things are not as dire as my last paragraph would lead you to believe. If you have googled a bit you will most certainly have seen [this blogpost on code-bude.net](https://en.code-bude.net/2017/02/12/how-to-convert-audible-aax-files-to-mp3-in-linux/) which outlines how to convert aax file to mp3. Since 2017 however things have gotten easier:

- The selenium based [`audible-activator`](https://github.com/inAudible-NG/audible-activator) tool has been preceeded by an offline tool / rcrack preset called [`inAudible-NG/tables`](https://github.com/inAudible-NG/tables) which should be more reliable (I could not get audible-activator to work).
- No other tool is needed: `ffmpeg` supports audible conversion out of the box.

## What do we need?

To go forward we need to install 2 pieces of software: - [`inAudible-NG/tables`](https://github.com/inAudible-NG/tables) can be cloned for 1-time usage - `ffmpeg` is probably already installed on your system

`inAudible-NG/tables` will provide us with a activation hash that is needed to decrypt the files. This hash is unique per account - meaning you only need to generate it once for all of your audiobooks.

`ffmpeg` will convert the files from the propriatary .aax format to whatever you like. I recommend using opus (for best compression) or mp3 (for best support).

## Getting the activation bytes

To extract the ‘activation bytes’ we first need a file hash of an aax file:

```
$ ffprobe audiobook.aax
[...]
[aax] file checksum == 27ae5bf7df0bab8401776657d90dca85XXXXXXXX
[aax] activation_bytes option is missing!
[...]
```

This hash is then passed to rcrack (from `inAudible-NG/tables`):

```
$ ./rcrack . -h 27ae5b47df0bab6401776657d90dca85XXXXXXXX
[...]
result
----------------------------------------------------------------
27ae5b47df0bab6401776657d90dca85XXXXXXXX [...] hex:c345eXXX
```

## Converting the file

Converting the file can be done with all of the usual ffmpeg options with an additional `-activation_bytes` option containing the hex hash from above. Example:

`$ ffmpeg -i audiobook.aax -activation_bytes c345eXXX freedom.mp3`

## Notes

- All steps shown here are meant for file preservation. If you want to listen to quality audiobooks then buy, don’t pirate.
- The hashes and activation bytes in the examples above are obviously anonymized.
Which 2018 Mac is best for web development?
Tags: discuss, help, webdev
Published: 2019-05-03 22:28:01

This mid-2015 MacBook Pro has been a workhorse for me but it’s time may be up! The battery service indicator appeared which means it could be pretty bad I’m thinking. It’s a 70+ step process to replace the battery so I’m opting to go pay the Apple store to fix it for $129. Otherwise I’d just DIY the battery replacement, but that’s not very Apple anymore I guess. I’m kind of expecting at the Genius Bar diagnostics reveal something more heinous is afoot. Basically the battery holds charge but upon waking the MacBook Pro screen will just do dark. The computer works fine again after plugging it in. I’m bracing for the worst. This is a four year old MacBook Pro after all. The clock is ticking.

The Mac portfolio has drastically changed over time. I’m wondering if I should go ultralight and just run with a MacBook Air or maybe I should just grab that top of the line MacBook Pro 15”? Is the 32GB of RAM really worth it when all I’m doing is running node servers and maybe a database locally? I can run the same setup on a Raspberry PI but that doesn’t mean my development machine should lack any sort of power. Sometimes I do use Photoshop and Sketch, run a dozen apps at once in the course of a day. I’ve used the Touch Bar before and honestly don’t care if I have it or not. Eventually I may get back into video production and I could just buy an external video card for when I do. I mainly just need this Mac for web development, to use as a presentation device and will be writing extensively on it.

Which Mac do you use to rock out your web development tasks? Please help!
My Vue + TailwindCSS Configuration
Tags: vue, tailwindcss
Published: 2019-05-03 15:35:42

---
title: My Vue + TailwindCSS Configuration
published: true
description: 
tags: 
- Vue
- Tailwind
---

Tailwind is "A utility-first CSS framework for rapidly building custom user interfaces", and it's not UI kit. So you need to build your own ui based on Tailwind css class.

For example, in bootstrap if we need to style button, 

```html
<button class="btn btn-primary">
    Button
</button>
```
In Tailwind, 

```html
<button class="bg-blue hover:bg-blue-dark text-white font-bold py-2 px-4 rounded">
    Button
</button>
```

Hmm, it's looks bootstrap win in this case. But wait, if you need customize button theme tailwind will win. Or you can see the button example in [tailwind documentation site](https://tailwindcss.com/docs/examples/buttons) to see more case.

## Vue + Tailwind + PurgeCSS

1. `npm install tailwindcss @fullhuman/postcss-purgecss --save-dev`
2. `npx tailwind init tailwind.js`
3. `mkdir src/assets/css`
4. `touch src/assets/css/tailwind.css` fill with
```
@tailwind preflight;
@tailwind components;
@tailwind utilities;
```
5. Edit `src/main.js` and import your tailwindcss 
```
// Tailwind CSS
import '@/assets/css/tailwind.css'
```

By default, tailwind file size is bigger than bootstrap, you can see the explanation [here](https://tailwindcss.com/docs/controlling-file-size). So we need **PurgeCSS** to remove unused css class in our production compiled css. 

6. Edit postcss.config.js

```js
const tailwindcss = require('tailwindcss')

const autoprefixer = require('autoprefixer')

const purgecss = require('@fullhuman/postcss-purgecss')

class TailwindExtractor {
  static extract (content) {
    return content.match(/[A-Za-z0-9-_:\/]+/g) || []
  }
}

module.exports = {
  plugins: [
    tailwindcss('./tailwind.js'),

    autoprefixer({
      add: true,
      grid: true
    }),

    purgecss({
      content: [
        './src/**/*.html',
        './src/**/*.vue',
        './src/**/*.js',
        './public/**/*.html'
      ],
      extractors: [
        {
          extractor: TailwindExtractor,
          extensions: ['html', 'vue', 'js']
        }
      ]
    })
  ]
}
```

Originaly posted on: [My Blog Post](https://sucipto.id/2019/05/01/tailwind-vue-js-postcss-configuration/)
Get that Pull Request merged - today.
Tags: git, productivity, webdev, workflow
Published: 2019-05-03 20:39:11

---
title: Get that Pull Request merged - today.
published: true
description: You've did the hard yards, that new feature or bug fix now works just as you'd like - now all that is left is to submit your Pull Request, get it landed and everyone is in profit, right?
tags: git, productivity, webdev, workflow
canonical_url: https://www.barrymcgee.co.uk/notes/get-that-pull-request-merged
cover_image: https://www.barrymcgee.co.uk/images/pr-merge.jpg
---

You've done the hard yards, that new feature or bug fix now works just as you'd like - now all that is left is to submit your Pull Request, get it landed and everyone is in profit, right?

Not so fast. 

It's two, three, four days later and you're _still_ battling to land that Pull Request (PR) as you deal with suggestions to refactor your code, Quality Assurance (QA) bugs and merge conflicts. 😭

The feeling of accomplishment you had initially when proposing your change is now a feeling of resentment as you're forced to revisit your code again and again. 🤬

So, how can we avoid this scenario and ensure that your Pull Requests are landed quicker and with less hassle? 

1. ## Limit the scope of your change
   You should always try to keep your pull requests as small as possible. Focus on fixing or adding one thing at a time. The more changes you include in a PR, the higher the risk that you introduce bugs.

2. ## Avoid drive-bys
   A drive-by is a change or refactor you make while browsing through the code and you notice something obvious that should be changed. It might be as simple as a missing \`alt\` tag on an image or updating the indentation of a code block. By all means, make these changes, but propose them separately.

3. ## Rebase before proposing your changes
   [Rebasing your changes](https://git-scm.com/book/en/v2/Git-Branching-Rebasing) on top of the branch you're proposing your changes to will reduce the chance of merge conflicts and also mean you're proposing your changes against the codebase as it exists in that moment, not as it was when you created your feature branch.

4. ## Make sure you run the tests locally
   If the project has a test suite, which hopefully it has, be sure to run those tests locally before proposing your changes. This should help highlight errors or linting issues in your changes.

5. ## Siphon off non-blocking issues
   Often when a person is reviewing your code, they will offer suggestions that are very valid but not strictly show-stoppers for the change you're proposing. These might be UI improvements, code abstractions or refactors to existing features. In my opinion, so long as your change does not exacerbate an existing issue, these recommendations should be syphoned off as separate issues to be prioritised accordingly.

Incorporating the above steps into my own work has really increased the cadence at which I get my PRs merged. Hopefully, it might help you too. 🔥
CSS Face
Tags: css, html, illustration, codepen
Published: 2019-05-03 19:40:16


Animated customizable 3D HTML & CSS face illustration using grid, variables, blur, border radius, nth child, box shadows. No SVG, PNG, JPG. 

{% codepen https://codepen.io/vuild/pen/joNmRr %}

https://vuild.com/face Details

https://vuild.com/code-face Post

https://vuild.com/css-face/ Code

https://vuild.com/bloopers Bloopers



V1. Best viewed in Safari. Or IE (😭).
[Gushing] My First Positive Open Source Experience
Tags: opensource, goodnewsfriday
Published: 2019-05-03 19:05:53

---
title: [Gushing] My First Positive Open Source Experience
published: true
description: A maintainer said yes!
tags: #opensource #goodnewsfriday
---

Okay confession time: I'm afraid of contributing to open source projects.  Like most developers, I use open source all the time.  And, like most developers I'm sure, I find issues in and think of improvements for those projects pretty regularly.  I try to do my best to write up a thoughtful Github issue, sometimes I even write some code as an example.  However, time and time again my suggestions are shot down by maintainers for reasons that range from "I don't feel like it" to "I don't want my project to behave that way".  Both of those are valid, but the dismissive attitude that usually comes along with always leaves a bad taste in my mouth.  To top it off, when I have offered to put together a pull request with the changes myself (since I'd have to write the code anyway to get the functionality I want) I'm usually told to leave it to the people who know the project better.

Here's the good news as promised: I made a simple request of an open source project that I wanted to use but couldn't because of some limitations.  The maintainer responded (rather quickly) with "yes"🎉!  It's a tiny victory, I know, but I can't help but feel hopeful for my Open Source future.

Alright that's my good news this Friday, what's yours?
Responsive Design
Tags: reactnative, javascript, ios, frontend
Published: 2019-05-03 18:06:23

---
title: Responsive Design
published: true
description: 
tags: #reactnative #javascript #ios #frontend
---

We are working on the react native app which needs to be display on different devices like IPads or IPhones and different devices have different screen sizes. So this is the solution we used in our project to make our App responsive on different screens.

### Implementation

Initially app designs were created for IPad screen of width "768". So we wrote a simple function named "Dimension" which accepts size and divide it to the default width and then multiply it to the current screen's width.

```
import { Dimensions } from "react-native";

const Dimension = size => {
  const { width } = Dimensions.get("window");
  const designBenchmark = 768;
  return (size / designBenchmark) * width;
};
```

Here designBenchmark is describing the width of the designs given, you can always change it with your given designs width and Dimensions class is being imported from "react-native"

### Usage

And then export this function to access it from any other component. You can use it like this.

```
marginBottom: Dimension(20);
```

It magically worked for us and designs are quite responsive on different devices. You can check the below images of app screenshots on IPad and IPhone respectively.

![App images](https://thepracticaldev.s3.amazonaws.com/i/8zq7jgwe6veelaicpzdn.png)
Sorting an array into groups with reduce
Tags: javascript
Published: 2019-05-03 17:47:42

---
title: Sorting an array into groups with reduce
published: true
description: 
tags: javascript, 
---

I help run the discord server Devcord and spend much of my time helping novice programmers with technical difficulties. Starting now, I'll be formalizing any help I give there into short blog posts here so the information isn't buried under a sea of conversations. 

Here I had a user with a list of email addresses to be sorted by domain.

```js
const emails = [
  "alice@gmail.com"
  "bob@gmail.com"
  "carol@yahoo.ca"
  "doug@hotmail.com"
  "ellie@protonmail.com"
];
```

While there are many ways to tackle this problem, my preferred is the functional model using Array.prototype.reduce

```js
const sortedEmails = emails.reduce((groups, email) => {
  const splitString = email.split('@');
  const account = splitString[0];
  const domain = splitString[1];
  
  if(!groups[domain]) groups[domain] = [];

  groups[domain].push(account);
  return groups;
}, {});
```

The reduce function iterates each element of the array and passes the return object to the next iteration. The `accumulator` (named `groups` here) is set initially as a `{}` empty object.

For each email, we break it into variables for each the account and the domain. If our current domain isn't already one of our groups, initialize it as an empty array. 

Then add the new account name to the group and `return groups` to pass it into the next iteration.

```js
{
  "gmail.com": ["alice", "bob"],
  "yahoo.ca": ["carol"],
  "hotmail.com": ["doug"],
  "protonmail.com": ["ellie"]
}
```

It should be noted that this code isn't completely suitable for production environments. While almost every email address has only one `@` symbol and this will work for all of those, there are valid email addresses that have multiple. Parsing the entire specification of valid email addresses is outside the scope of this article.
2019 Goals — April Update
Tags: goals
Published: 2019-05-03 17:08:25

---
title: 2019 Goals — April Update
published: true
description: A progress update on my goals for 2019
tags: goals
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qbgcus5r8gw47f5hi407.jpg
---

Last year, I wrote a monthly progress update on my goals. I'm doing the same thing for 2019. Previously, I wrote these articles on Medium. Now I'm switching over to dev.to 😄

## Achievements

Here, I’ll share the goal followed by the related achievement of the month after the arrow.

### Emotional
- Focus on relationships that matter -> Spending time with friends/co-workers

I feel like this month I actually made progress towards this goal. I sometimes say yes or do things because I feel like I should rather than because I want to. This month, I spent more time with high school friends that are important to me and I also spend some time with my co-workers outside of work.

I hope to continue focusing on these important relationships rather than trying to please everyone. 

### Intellectual
- Read 12 Books -> Finished "The Clean Coder" and "Accelerate: The Science of Lean Software and DevOps: Building and Scaling High Performing Technology Organizations"

One of my co-workers recommended "The Clean Coder" by Robert Cecil Martin and so I started it last month. It was a fantastic book! It made me realize what it means to be a "professional" developer and gave tips on how to work towards that in my career.

I also read "Accelerate...". I wasn't a huge fan. The research was interesting, but it felt more like an academic paper published inside a book. It merely validated my previous beliefs of how important things like CI/CD are in shipping software quickly.

- Launch 2 Products on Product Hunt -> Lots of work on mentored.dev

April was a productive month for [mentored.dev](https://mentored.dev/)! I give some credit to the [Pioneer Tournament](https://pioneer.app/) I joined, which has forced some accountability on this project. 

I hope to continue making progress and eventually, ship the first version this year. 

### Professional:

- Speak at 5 conferences-> [Spoke at Magnoliajs](https://magnoliajs.com/) (2/5) 🚀

I had an absolute blast speaking at Magnoliajs in Jackson, Mississippi. It was my first in-person tech conference I was speaking at. 

The experience taught me a lot. I realized:

1) how down-to-earth tech speakers are
2) jokes/humor can spice up talks more than enthusiasm 

That being said, I hope to continue speaking at meetups/conferences and getting better at my delivery. 

- Write 6 articles -> Published ["The Practical Checklist for Getting a Job"](https://dev.to/jsjoeio/the-practical-checklist-for-getting-a-job-150n)

I had been holding onto this article for a while. I wrote it up for a friend maybe 6 months ago but never got around to publishing it. Instead, I was sharing it with people privately. 

Now, it's published and ready to be shared with the community! 😄

That's all folks! Until next month!

### 
[Photo by Stephen Walker on Unsplash]
Asynchronous, Temporal REST With Vert.x, Keycloak and Kotlin Coroutines
Tags: json, rest, asynchronous, coroutines
Published: 2019-05-03 16:53:27

---
title: Asynchronous, Temporal REST With Vert.x, Keycloak and Kotlin Coroutines
published: true
description: 
tags: JSON, REST, Asynchronous, Coroutines
cover_image: https://thepracticaldev.s3.amazonaws.com/i/gu5075ha30cmnmjcx812.png
---



https://hackernoon.com/asynchronous-temporal-rest-with-vert-x-keycloak-and-kotlin-coroutines-217b25756314?source=friends_link&sk=5eabb36b2984cf61a2dff3f9fe45addc
Are you a multi-passionate developer?
Tags: discuss
Published: 2019-05-03 16:34:08

---
title: Are you a multi-passionate developer? 
published: true
tags: discuss
cover_image: https://thepracticaldev.s3.amazonaws.com/i/96phr0zj9h0mknpim6k7.jpg
---

When I started on the path towards being a developer, I did not realize how many devs identified strongly with development being their singular passion. I met developers who would enjoy coding apps in their free time, who had few other hobbies outside (maybe) video games. I know I am not the only multi passionate developer out there, but I often feel like at work people shy away from talking about their other hobbies and interests. 

I am a bit of an extreme example because I've done everything from making games to writing short stories to meditating to blogging to drawing to photography but I wonder how my fellow multi-passionate people handle the stress of keeping up with the constantly evolving word of development while also being able to explore and invest in their hobbies. Do you find ways of narrowing down your interests and just practising 1 or 2 of these hobbies? Do you look for ways to combine your hobbies with development? Do you think identify as multi-passionate but later look deeply inward and discover that the root of the problem was really indecision (I often wonder this myself)? I look forward to your responses, because I REALLY struggle with this!
How to write tests for a library that requires being run on the browser (like Dexie.js or localforage)? 
Tags: help, javascript, webdev, testing
Published: 2019-05-03 15:53:40

---
title: How to write tests for a library that requires being run on the browser (like Dexie.js or localforage)? 
published: true
tags: help, javascript, webdev, testing
---

I've been trying to take a TDD approach to building up a side project using mocha and chai, but I've been hitting a wall lately. I want to use localforage, but I can't seem to write automated tests that run and interact with localforage since it requires being run on a browser. I want to wrap a library and write tests to cover the class that I created. Is there a way to do this?
Show me some bad web accessibility on major sites.
Tags: a11y, discuss, webdev, help
Published: 2019-05-03 15:14:26

---
title: Show me some bad web accessibility on major sites.
published: true
description: Looking for the worst of the worst to use as examples of what not to do. 
tags: #a11y, #discuss, #webdev, #help
---

I am working on a presentation for a dev conference and need to find a few more examples of what not to do when it comes to web accessibility. I have been scouring the web with my screen reader looking for bad experiences (I will add some of the screen recordings I've made here later.) 

I'm happy I haven't found as many examples as I thought I would, but I haven't had as much time as I'd like to look. I would be eternally grateful for some help and 
will share the final presentation at a later date.
:purple_heart: :purple_heart:  :purple_heart: