Posted on Leave a comment

Apple Just Said F*ck Privacy!

Apple Is On One!

A few days ago Apple decided they were going to start an initiative where they are going to scan your photos and messages for child pornography, and if detected will alert law enforcement. We should know by now whenever a company does something under the guise of humanitarianism, that it is a load of BULLSH!T!!!

Apple Is Poising Itself To Be The World’s Biggest Advertiser

Do you think it is coincedence that Apple screwed over advertisers with its decision to allow users to block cross app tracking, now they are mining all of your photos and texts? It would be naive to think that they are not going to be making profiles on all iOS users based off things such as EXIF data in their photos. Oh you like tacos? We know because we look at all your food photos, TAKE THIS AD! Idk what do you all think? Listen to the podcast and leave a comment below!

Posted on Leave a comment

Eviction Moratorium & Tech

The Eviction Moratorium Is Up!

With it over 10 million Americans are up for evictions this week and boy have they been coming! In this week’s podcast I discuss how although the COVID-19 pandemic was the main driving focus; this rent eviction moratorium is indicitive of the larger economic landscape shift. The tech economy is driving this shift and with it many people will be financially crushed, while others will rise.

How Is The Eviction Moratorium and Tech Connected?

The evictions are mostly happening in metropolis areas, which also (increasingly) are becoming major tech hubs. What you are witnessing is active gentrification in the works! Does who are unskilled laborers (I hate that term) could not hold a job during the pandemic, thus they struggled to keep up rent, thus they are getting evicted. Those of us in tech have overwhelminly been straight. Who is left to afford to live in the city? High income tech workers. It makes a concentric circle of class. The downtown areas start first, push the poor people back. High income earners start to get cramped downtown, so they move to the suburbs, push those people back, etc, etc until you get an URBANIZATION of rural areas. Mark my words there will be engineers living in those apartments within the next year. If you enjoyed this podcast episdoe be sure to subscribe to it on Apple Podcast, Spotify and everywhere else podcasts are distributed! If you REALLY enjoyed it, consider becoming a patron on Patreon!

Posted on Leave a comment

Creating A Twitter Follow Bot With Node and Twit.js

Automate Your Following With A Twitter Follow Bot

Anyone who follows me on Twitter (if you don’t @mastashake08) knows that I’m pretty active. Currently I’m on my way to 10K followers but sometimes my TL looks kinda dry. One of the best things about Twitter is that I learn alot of new information from the people I follow. Yet I don’t have the time to actively look for new people. Time for a #CodeLife trick.

Filtering Statuses With Twit

If you read my article on Creating a Discord Twitter Bot then alot of this code will look familiar to you. I’m going to stream a list of filtered statuses that use the hashtags #BlackTechTwitter and #CodeLife and whoever sends those tweets I will automatically follow them. So let’s begin by creating a new directory and adding our dependecies

mkdir follow-bot
cd follow-bot && npm install dotenv twit
touch search-follow.js

This will create a new directory, cd into it and install the dotenv and twit dependencies. Dotenv allows us to use a .env file to hold our secret values for our Twitter creditenials safely and twit is the Twitter javascript library. Lastly we created an empty js file where we will hold our code. Open it up and input the following.

require('dotenv').config()
const Twit = require('twit')


var T = new Twit({
  consumer_key:         process.env.TWITTER_CONSUMER_KEY,
  consumer_secret:      process.env.TWITTER_CONSUMER_SECRET,
  access_token:         process.env.TWITTER_ACCESS_TOKEN,
  access_token_secret:  process.env.TWITTER_ACCESS_TOKEN_SECRET,
  timeout_ms:           60*1000,  // optional HTTP request timeout to apply to all requests.
  strictSSL:            true,     // optional - requires SSL certificates to be valid.
})
var stream = T.stream('statuses/filter', { track: ['#blacktechtwitter', '#codelife'], language: 'en' })

stream.on('tweet', function (tweet) {
  //...
  var user = tweet.user;
  try {
    T.post('friendships/create', {screen_name: user.screen_name})
    console.log('Followed ' + user.screen_name)
  } catch (error) {
    console.log(error)
    }
  })

The first lines we are requiring our dependencies and after we initialize the Twit object with out Twitter API creds stored in .env

Next we set a stream variable that will hold our filtered statuses tracking the list of hashtags.

Since the stream is event-driven we listen for the ‘tweet’ event which holds our Tweet object. We grab the screen_name of the user who tweeted and make a request to the ‘friendships/create’ endpoint which is what creates the following!

See how simple that was! If you enjoyed this article consider becoming a patron to get exclusive content! Get the source code here.

Posted on Leave a comment

WebTransport Is A Game Changer For Gaming

If You Haven’t Heard Of WebTransport

It is a new standard that provides bidirectional data transport over HTTP/3. In many cases, it can replace WebSocket and WebRTC with less overhead. It has two APIs that come with it, one for sending data unreliably with Datagram API and one reliably with the Stream API. In this article I will explain what WebTransport is, and how it will affect web gaming! If you want access to my member’s only article where I build a HTTP/3 server in Go and WebTransport client become a patron today.

Why Is WebTransport Such A Big Deal?

WebTransport is built on top of HTTP/3 which means it runs over QUIC. Without going into too much technical detail this equates to lower overhead and faster more reliable connections. It is also bidirectional meaning you can read and write data to the server. The cool thing to me though is how you can send data reliably (with streams similar to websockets) AND unreliably via datagrams!

Imagine you are making a multiplayer shooting game with 64 players. In coding terms you need this data to come as fast as possible right? Well at first glance you might think that a reliable data stream would be the best right? After all if all the players are shooting one character you want the damage to come in order right? WRONG! You do that and you are at the behest of the slowest network in the game. By sending datagrams you get best effort delivery (let’s be honest only ~1-5% of traffic is lost in these types of connections) so you won’t block the other connections.

Since WebTransport is Client-Server this is a no brainer for real-time multiplayer web games! Low latency is a must!

What’s Next?

WebTransport is still in it’s early stages but I will be following up with a YouTube video and a follow up blog where I will build a WebTransport server and client application! If you aren’t following me on Twitter do so @mastashake08

Posted on Leave a comment

Side Hustles For Tech Workers In 2021

Side Hustles In Tech Are Abundant

If you have a skill, then there is always someone willing to pay for that skill. Most of the time for us tech workers we take our skills to a job and work for 40+ hours a week for one company at a time. While tech salaries can be ridiculously high, that is still only ONE stream of income. If 2020 showed us anything, it is that job security is a myth. The only job that is secured is one that you make for yourself! I’m not telling everyone to quit their jobs and become entrepreneurs who work solely for themselves. That wouldn’t be feasible. What is feasible however is for everyone to add multiple streams of income into their lives with some side hustles. Here are five side hustles in tech that can bring you extra money in 2021 right now!

Create & Host Websites

Did you know that less than 2/3 of U.S. small businesses have a website? A lot of business owners are not tech savvy and honestly the thought of creating a website scares them. This is where you can come in and make money two ways. First you can make money upfront by offering to create their website and then you make passive income by charging them for hosting their website. Let’s do some quick math. Let’s say you have a small business website package for $1000 and a hosting package of $30 per month. Let’s say you do 1 website a month:

  • 12 * $1000 = $12,000
  • 12 * $30 per month = $360 per month = $4320 per year

After your first year you made an extra $16320 on top of your regular job pay. If you provide reliable and quality service then your clients will stay with you for hosting. That extra monthly income is infinitely scalable and is worth more than than the $1000 in the long run.

Tutor CS Students

This is a pretty self explanatory side hustle. As more and more people go to university and boot camps to become software engineers and developers, there has opened up a niche for tech tutoring. Get paid to help others by signing up for websites like CodeMentor or advertise your services solo. Tutors easily can make $40-$60 per hour tutoring and while it’s not much when you only do a couple hours, that’s still extra money. Go to your local community college or university and find the CS department and offer your services or some flyers, trust me you will get calls soon.

Sell A Course/E-Book

This one is definitely more involved but can easily be one of your most lucrative passive income side hustles in tech. By creating a course or an e-book in your niche and selling them you are creating evergreen content that can last well beyond the time of creation. A good portion of my website sales come from my courses such as PWA To APK course and once the hard work of actually creating the content is done, it’s a relatively hands off process going forward.

You still need to do marketing if you want consistent growth but you should be reinvesting your sales into ads anyway! Courses can sell for years after they are created, however depending on the context of the course, it may want to be updated from time to time to stay relavent!

Flip Apps

Going on two years ago I wrote a Twitter thread on app flipping using websites such as Flippa. Essentially it works like flipping anything else. You find an app that is undervalued and being sold whether by auction or direct sale. Once you find the app, you can either keep it, enhance it and profit; or you can polish it up and resell it for a higher price. I personally prefer keeping the apps and riding the passive income train.

Create An App

This is the holy grail of passive income in my opinion. The majority of my side hustles are in the form of apps that make me money. This obviously will require the most time and if you are working a full time job you will have to juggle both which is easier said than done. However the reward has the highest potential of all the tech side hustles. Web apps, mobile apps, it doesn’t matter (I do both).

Conclusion

Nothing worth while will happen fast. If you decide to pursue a tech side hustle in 2021 then the first thing you must understand that living a #CodeLife takes time. Be patient, stay focused and HUSTLE. If you enjoyed this article then share it on social media and consider joining the Code Life Newsletter. Every week get fresh updates and inside looks in the world of tech and entrepreneurship with special content only for subscribers!

Posted on Leave a comment

Are You A Front End Web Developer? Congrats, You Are Also An Android Developer.

front end web developer to android developer

Mobile Development and Web Development Are Merging

Progressive web apps (PWAs) are pretty mainstream now and most web developers are aware of their existence. The Android platform and the Google Play store has been around for going on 13 years and developers are aware of its existence. What many are unaware of is how much the two platforms have been merging in the background. Last year I had the most wonderful epiphany. If you are a front end web developer, then by default you can publish Android applications, making you an Android developer as well.

Subscribe to my YouTube for more Tech Talks

What Are The Benefits?

You might be wondering what the benefits of turning your PWA into an installable Android application. Some of the main ones include:

  • Increased visibility
  • Increased revenue
  • Better brand reputation

Increased Visibility

When you turn your progressive web application into an Android application and upload it to the Google Play Store, you are opening yourself to a new realm of SEO called App Store Optimization. This is the search engine that powers the Google Play Store search. Your app will now be available to all Android users (unless otherwise specified). Your app store listing is the gateway to all of these new potential users.

Increased Revenue

When you upload an Android application you can set it to be paid or free. In addition to increased ad revenue (if that is your monetization model) that will grow proportionally with app download and usage; but what about apps that don’t make any money on the web? Those could be one-time paid downloads on the Google Play Store.

Better Brand Reputation

Just by turning your PWA into an Android app, you are increasing your brand reputation! Users trust brands that are on multiple platforms and see it as more established, whether or not this is true for that brand is debatable. Definitely worth the $25 to get a Google developer license.

PWAs and WebAPKs

When Google added PWA support to Chrome on Android they added this cool feature called WebAPK. When a user clicks the “Add To Homescreen” button on the mobile browser, the Android operating system actually creates a special APK on the fly, sign and install it. This feature is powerful and can lead to easy accessibility for web apps now and in the future. When I first heard of this, I immediately went to work converting all of my web applications into progressive web applications. Thinking this is the pinnacle I told myself I bought my Android developer license for nothing I will just push installs this way; but then I found something better.

Android Trusted Web Activities

Android now has this cool new way of working with your PWA inside of your app called Trusted Web Activities. TWAs have a lot of benefits but my top two are:

  1. Content in a Trusted Web activity is trusted — the app and the site it opens are expected to come from the same developer. (This is verified using Digital Asset Links.)
  2. The content rendered in a Trusted Web Activity comes from the web: they’re rendered by the user’s browser, in exactly the same way as a user would see it in their browser except they are run fullscreen. Web content should be accessible and useful in the browser first.

Let’s say you already built your PWA and you need an Android application but you need to do some extra things that are beyond the current scope of web apis but everything else is in the PWA. Using Trusted Web Activites you can interact with your application and the native APIs provided by Android. The PWA has to come from the same developer who is creating the Android application and is done using Digital Asset Links. This is a file proves you are the owner and once you upload this file to your server, Google will verify. This ensures security and that you aren’t ripping off someone eles’s PWA for your own profit. Also by uploading an Android app that is based on your PWA you don’t have to worry about updates (as much). Once you update the PWA, your application will reflect those updates, thus reducing code time.

But wait….doesn’t that require me to first write an Android app that calls the TWA?

Yes however AUTOMATION BABY! There are tools that I use that make generate the source code and the APK so all I have to do is upload it to the Google Play Console as a new app. I never touch any Java/Kotlin code. I created a course that shows you how to take ANY non PWA web application and turn it into a PWA and APK in under 30 minutes! Expand your visibility and earn more income by diversfying your platforms!

Posted on Leave a comment

Create An Online Radio & Podcast Streamer Using Vue and Media Session API

The Media Session API

I love listening to podcasts and online radio. I used to run an online station a fews ago called 90K Radio and I was hooked in the community ever since. Keeping on track with my PWA binge I thought it would be a cool to write a progressive web app that can take in any stream URL and play it. Not only that but I want to be able to control the audio using the native audio commands on Android, iOS and desktop. There is this awesome javascript API called the Media Session API. The Media Session API allows you to customize media notifications and how to handle them. It allows you to control your media without having to be on that specific webpage. This allows for things such as background playing ( a must need feature for online radio PWA). You can even do things like set album artwork and other metadata and have custom handlers for events such as skipping tracks and pausing/playing.

What Are The Benefits?

Primarily I built this because a PWA will load faster. Also no tracking, I don’t have to worry about Google or anyone else tracking my activity, I can just listen in peace. By using the media session API I can listen in the background whilst doing other things which most likely will be every time I use the app. Lastly it’s just an awesome feeling to use your own software 😅.

The Vue Application

I created the vue application using the standard Vue CLI and added Vuetify so that it has some basic responsive styling. The app has one component called Radio.vue which holds all of the logic. The application has some preset radio stations that I can click as well as a text field where I can put in any URL of their choosing for play. It also grabs an RSS feed for a few of my favorite podcasts so I can quickly listen. Everything is done client side including the RSS XML parsing! You can view the live version here and clone the repo here.

Let’s Get Coding

As I stated above, I created a new Vue application using the vue-cli and added vuetify using the vue add vuetify command. For brevity I will skip that part and only talk about the Radio.vue component which holds all of the logic. This component will grab the preset stations and turn those into buttons. The favorited podcast RSS feeds it will grab, parse the XML and play said podcast. There is a URL text input that the user can manually put an audio stream URL in. Finally I set the Media Session metadata to show the cover art and info of whatever is playing and if I don’t have it show a default image, artist and album.

<template>
  <v-container>
    <v-row class="text-center">
      <v-col cols="12">
        <v-img
          :src="require('../assets/logo.png')"
          class="my-3"
          contain
          height="200"
        />
      </v-col>

      <v-col class="mb-4">
        <h1 class="display-2 font-weight-bold mb-3">
          Welcome to PWA Radio
        </h1>

        <p class="subheading font-weight-regular text-center">
          <v-text-field type="url" placeholder="Enter stream URL" v-model="url" label="Stream URL" />
        </p>
        <v-row class="text-center">
          <v-btn v-on:click="playAudio" v-if="!isPlaying">Play</v-btn>
          <v-btn v-on:click="stopAudio" v-else color="red">Stop</v-btn>
        </v-row>
      </v-col>
    </v-row>
    <v-row class="text-center">
      <v-btn class="pa-md-4 mx-lg-auto" v-for="x in presets" v-on:click="setAudio(x)" :key="x.name" :color="x.color"> {{x.name}} </v-btn>
    </v-row>
    <v-row class="text-center">
      <v-select
          v-model="currentPodcast"
          :hint="`${currentPodcast.name}, ${currentPodcast.author}`"
          :items="favoritePodcasts"
          item-text="name"
          item-value="url"
          label="Favorite Podcasts"
          persistent-hint
          return-object
          single-line
          @change="playPodcast"
        ></v-select>
    </v-row>
  </v-container>
</template>

<script>
  export default {
    name: 'Radio',

    data: () => ({
      isPlaying: false,
      audio: {},
      url : '',
      currentPodcast: {},
      selectedEpisode: {},
      presets : [
        {
          name: 'WEKU-NPR',
          url : 'https://playerservices.streamtheworld.com/api/livestream-redirect/WEKUFM.mp3',
          color: "green",
          author: 'NPR'
        },
        {
          name: 'WEKU-Classical',
          url: 'https://playerservices.streamtheworld.com/api/livestream-redirect/WEKUHD2.mp3',
          color: 'orange',
          author: 'NPR'
        },
        {
          name: 'Vocalo Radio',
          url: 'https://stream.wbez.org/vocalo128',
          color: 'blue',
          author: 'NPR'
        },
        {
          name: 'WFPK',
          url: 'https://lpm.streamguys1.com/wfpk-popup',
          color: 'yellow',
          author: 'NPR'
        },
        {
          name: 'KEXP',
          url: 'https://kexp-mp3-128.streamguys1.com/kexp128.mp3?listenerid=8044407b7410ad01f8210fd508279708&awparams=companionAds%3Atrue',
          color: '#cb349a',
          author: 'NPR'
        }
      ],
      favoritePodcasts: [],

      podcastURLS: [
        { url: 'https://anchor.fm/s/fdc3ac0/podcast/rss', name: 'Code Life' },
        { url: 'https://anchor.fm/s/42d5fca4/podcast/rss' , name: 'Intimate Spaces' },
        { url: 'https://feeds.npr.org/510289/podcast.xml', name: 'Project Money'}

      ]
    }),
    methods: {
      setMediaControls: function () {
        if ('mediaSession' in navigator) {
          navigator.mediaSession.metadata = new window.MediaMetadata({
            title: 'Pocket Radio',
            artist: 'J Computer Solutions LLC',
            album: 'Pocket Radio',
            artwork: [
              { src: 'https://radio.jcompsolu.com/images/logo-96.png',   sizes: '96x96',   type: 'image/png' },
              { src: 'https://radio.jcompsolu.com/images/logo-128.png', sizes: '128x128', type: 'image/png' },
              { src: 'https://radio.jcompsolu.com/images/logo-192.png', sizes: '192x192', type: 'image/png' },
              { src: 'https://radio.jcompsolu.com/images/logo-256.png', sizes: '256x256', type: 'image/png' },
              { src: 'https://radio.jcompsolu.com/images/logo-384.png', sizes: '384x384', type: 'image/png' },
              { src: 'https://radio.jcompsolu.com/images/logo-512.png', sizes: '512x512', type: 'image/png' },
            ]
          });

          navigator.mediaSession.setActionHandler('play', this.playAudio());
          navigator.mediaSession.setActionHandler('pause', this.pauseAudio());
          navigator.mediaSession.setActionHandler('stop', this.stopAudio());
          navigator.mediaSession.setActionHandler('seekbackward', function() { /* Code excerpted. */ });
          navigator.mediaSession.setActionHandler('seekforward', function() { /* Code excerpted. */ });
          navigator.mediaSession.setActionHandler('seekto', function() { /* Code excerpted. */ });
          navigator.mediaSession.setActionHandler('previoustrack', function() { /* Code excerpted. */ });
          navigator.mediaSession.setActionHandler('nexttrack', function() { /* Code excerpted. */ });
        }
      },
      playPodcast: function () {
        this.setAudio(this.currentPodcast)
        this.playAudio()
      },
      playAudio: function () {
        if(this.isPlaying){
          this.isPlaying = false
          this.audio.pause()
          this.audio = {}
        }
        this.audio = new Audio(this.url)
        this.isPlaying = true
        this.audio.play()
          .then(()=> {
        }).catch(error => { console.log(error) });
      },
      pauseAudio: function () {
        this.audio.pause()
        this.isPlaying = false
      },
      stopAudio: function () {
        this.audio.pause()
        this.audio = {}
        this.isPlaying = false
      },
      setAudio: function(preset) {
        this.url = preset.url
        navigator.mediaSession.metadata.title = preset.name
        navigator.mediaSession.metadata.artist = preset.author
        if(preset.image) {
          navigator.mediaSession.metadata.artwork = [
            { src: preset.image }
          ]
        }
        this.playAudio()
      }
    },
    mounted () {
      this.setMediaControls()
    },
    created () {
      this.podcastURLS.forEach(pod => {
        fetch(pod.url)
        .then(response => response.text())
        .then(str => new window.DOMParser().parseFromString(str, "text/xml"))
        .then(data => {
          const items = data.querySelectorAll("item");
          for (let i = 0; i < items.length; i++) {
            let item = items[i];
            console.log(item)
            let image = item.getElementsByTagName("itunes:image")[0].getAttribute("href")
            let title = item.querySelector("title").innerHTML.replace("<![CDATA[", "").replace("]]>", "")
            let author = item.getElementsByTagName("dc:creator")[0].innerHTML.replace("<![CDATA[", "").replace("]]>", "")
            let url = item.querySelector("enclosure").getAttribute("url")
            let podcast = { name: title, url: url, image: image, author: author }
            this.favoritePodcasts.push(podcast)
          }
        })
      })
    }
  }
</script>

Conclusion

This was a fun and easy PWA to make and I will turn it into an Android application to put on the Google Play Store (learn how with my PWA to APK course). Some features I will add will include:

  • save favorites locally using indexDB
  • create queue that can be skipped
  • download podcast episodes
  • Have everything play via the WebAudio API and add visualizations.
Posted on Leave a comment

Jeff Bezos Steps Down As Amazon CEO

Jeff Bezos Will Step Down As CEO This Year

In Q3 of this year Jeff Bezos will step down as CEO of Amazon, a role he has held since the company’s inception and Andy Jassy the top cloud executive will take over as the new CEO. Bezos will still retain his role as chairman of the board for the company. Starting as an online book retailer, Jeff Bezos grew Amazon to a $1.6 trillion company in a span of little over 20 years. 

Andy Jassy currently leads the AWS department, which accounts for the majority of Amazon’s income. Last year alone AWS grew 28% in the fourth quarter alone.

Why Is Jeff Bezos Stepping Down?

In a statement today Bezos said that he is stepping down so that he can focus on his philanthropic endeavors as well as his other projects such as Blue Origin, Amazon Day 1 Fund and more. Honestly it makes sense given that Amazon wasn’t the only endeavor Jeff Bezos had, and the amount of time and energy Amazon requires. Money is obviously not a motivator he is worth almost 1/5th of a trillion, time is more valuable to him. 

My Personal Thoughts

In my personal opinion I think Jeff Bezos is tired. Amazon is a multi-billion dollar per year corporation that has had lots of social scrutiny the last few years. He has made history with Amazon he did what he sought out to do and more! I also think a part of it is true philanthropy. I know he is billionaire and a lot of people have a mindset that billionaires should not exist, however I belive in The Gospel Of Wealth.

The Gospel Of Wealth is a philosophy that teaches that the more wealth you have, the more of a morale obligation you have to humanity. Jeff Bezos is the prime person who should live by this philosophy.

Jeff Bezos stepping down to fulfill philanthropic endeavors is going to give him the chance to show us if he is a believer in The Gospel Of Wealth or not. Only time will tell but I like to be an optimist more times than not.

Possible Political Ambitions

Another reason I could see him stepping down as CEO of Amazon is that he is eyeing political office. This gives him time to focus on heavy political networking and not be distracted by running a successful company. We are definitely in the big money political era and Bezos could self fund any campaign he wished. 

Bezos is a household name and name recognition is the number one metric for political campaigning. The majority of Americans use and rely on his company and would probably have an emotional attachment to his candidacy. Once again these are purely my thoughts and only time will tell what he will actually do once he steps down.

Sign Up For The Code Life Newsletter

Stay up to date on the blog, latest products and subscriber only content! The newsletter is completely free and goes out weekly!

Showing 1–1 of 14 results