Code Monkey home page Code Monkey logo

live's Introduction

bdougie.live

This blog powered by GitHub issues

A location where individuals can come together and watch a few people stream their code. This repo is powered by oneblog.

Schedule for streams can be found at twitch.tv/bdougieYO.

Plan for the future.

  1. Invite others to live code with @bdougie
  2. Show off code and talk about projects.
  3. Answer code questions

Links

Details

This repo powers the OneGraph Product Updates blog at onegraph.com/changelog.

All of the posts on the changelog are stored as issues on the OneGraph changelog repo.

Build a blog powered by GitHub issues

Deploy with Vercel

This repo allows you to generate a blog from GitHub issues on a repo. It powers the OneGraph Product Updates blog, Stepan Parunashvili's blog, bdougie.live, and more.

All of the posts are stored as issues on the repo (e.g. OneGraph/onegraph-changelog).

When you visit the page at onegraph.com/changelog, a GraphQL query fetches the issues from GitHub via OneGraph's persisted queries and renders them as blog posts.

The persisted queries are stored with authentication credentials for GitHub that allows them to make authenticated requests. Persisting the queries locks them down so that they can't be made to send arbitrary requests to GitHub.

You can learn more about persisted queries in the docs.

Setup

Use an existing OneGraph app or sign up sign up at OneGraph to create a new app.

Copy /.env.example to /.env and set the following environment variables.

Environment variables

Environment Variable Description
OG_GITHUB_TOKEN A server-side access token created on OneGraph, used as the default auth for the persisted queries that will fetch the issues. To create a new one, go the "Server-side Auth" tab in the OneGraph dashboard for your app, click the "Create Token" button, and add GitHub to the services. Keep this token safe, because it has access to your GitHub data.
OG_DASHBOARD_ACCESS_TOKEN An API token that allows you to create persisted queries on OneGraph. Go to the "Persisted queries" tab on the OneGraph dashboard, scroll down, and click "Create token". This will create a scoped token for your app that can create persisted queries on your behalf.
NEXT_PUBLIC_ONEGRAPH_APP_ID The id of your OneGraph app. You can get this from the OneGraph dashboard
NEXT_PUBLIC_TITLE The title of your site
NEXT_PUBLIC_DESCRIPTION A short description of your site.
NEXT_PUBLIC_GITHUB_REPO_OWNER The owner of the repo that we should pull issues from (e.g. linus in linus/oneblog). If you're using the Vercel deploy button, you don't need to provide this.
NEXT_PUBLIC_GITHUB_REPO_NAME The name of the repo that we should pull issues from (e.g. oneblog in linus/oneblog). If you're using the Vercel deploy button, you don't need to provide this.

Setup relay

Remove the generated files (they're tied to the OneGraph app they were generated with):

yarn relay:clean
# which runs rm -r src/__generated__

(Note: any time you change the variables in .env, it's a good idea to stop the relay compiler, remove the files in src/__generated__, and restart the compiler)

Install dependencies

yarn install

Run the Relay compiler

This project uses Relay as its GraphQL client because of its high-quality compiler and great support for persisted queries.

In another terminal window, start the relay compiler

yarn relay --watch

You may need to install watchman, a file watching service. On mac, do brew install watchman. On Windows or Linux, follow the instructions at https://facebook.github.io/watchman/docs/install.html.

Start the server

Now that we've generated the relay files, we can start the server.

yarn start

The project will load at http://localhost:3000.

Deploying

The project comes with setups for deploying to Google's Firebase, Zeit's Now, Netlify, and Fly.io.

For each of these, you'll have to add the site that you're deploying to on the CORS origins on the OneGraph dashboard.

Deploy with Vercel

Use the deploy button to set up a new repo:

Deploy with Vercel

If you've already set up the repo, just run the vercel command.

# If not installed
# npm i -g vercel

vercel

If you see an error when you visit the site, make sure the site's origin is listed in the CORS origins for your app on the OneGraph dashboard.

Deploying with Firebase

Please open an issue if you'd like help deploying with Firebase.

Deploying with Netlify

Please open an issue if you'd like help deploying with Netlify.

Deploying with Fly.io

Please open an issue if you'd like help deploying with Fly.io

Project setup

Client

The client is an ordinary React app. The best to place to start is /src/App.js.

It uses Grommet as the UI library. Visit https://v2.grommet.io/components to view the documentation for Grommet.

It uses Relay as the GraphQL client. https://relay.dev/docs/en/graphql-in-relay has a good introduction to Relay.

To refresh the GraphQL schema, run yarn fetch-schema. That will fetch the schema from OneGraph and add some client-only directives that we use when we persist the queries to OneGraph.

How persisting works

The persistFunction for the relay compiler is set to /scripts/persistQuery.js. Every time a GraphQL query in the project changes, the relay compiler will call that function with the new query.

That function will parse the query and pull out the @persistedQueryConfiguration directive to determine if any auth should be stored alongside the query. In the changelog, the queries for fetching posts use persisted auth, but the mutations for adding reactions require the user to log in with OneGraph and use their auth.

The @persistedQueryConfiguration directive is stripped from the query and it is uploaded to OneGraph via a GraphQL mutation. Then the id for the persisted query is returned from the function. Relay stores the id in its generated file and it's used the next time the query is sent to the server.

Server

The server uses Next.js to allow us to render the content on the server. This helps with SEO and allows people to view the blog with Javascript turned off.

When a request comes in to the server, the server creates a mock Relay environment and prefetches the query for the route using fetchQuery from relay-runtime. This populates the record source that Relay uses to render.

React renders the app to a string, which is sent to the client.

On the client, React rehydates the app. To prevent Relay from showing a loading state, we inject the serialized record source with getStaticProps. That data is stored in the environment before Relay makes its first query. The fetchPolicy opt is set to "store-and-network" so that it uses the data from the store instead of showing a loading state.

live's People

Contributors

bdougie avatar brandonroberts avatar dependabot[bot] avatar dwwoelfel avatar froi avatar jackhowa avatar timothee avatar yuval-hazaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

live's Issues

The Miami Effect and Developer Recruiting

The Miami Effect and Developer Recruiting

The Miami Effect: Developer Recruiting

In the 1980's Howard Schnellenberger knocked door to door in neighborhood homes in Miami-Dade county. Recruiting football players that nobody wanted. He took a chance on the local community and built a dynasty that dominated football in the NCAA.

Not only was the University of Miami unknown as a private college, their primary focus was trying to be part of the Ivy League of the south. Coach Schnellenberger knew he had no chance getting the top talent to not sign with Oklahoma, Texas, or even Florida and Florida State.

His thought was to grab the unwanted talent from the neighborhoods you would drive your Miami Porsche Convertible through. Most prospects had troubles that the top schools did not want to deal with and despite that Miami was able to build and grow a team from their very own community. The result was this simple change in recruitment turn the community into die Miami fans, because the boys from the neighborhood all played for the school, which increased ticket sales.

In addition to the increase in increasing fans, The team began to win. A new form of untapped talent was accessed and developed into a NCAA powerhouse. Another pro to this recruiting style, was the talent became virtually endless because the younger brothers and fans eventually grew up to play for Miami because of their loyalty to the neighborhood.

Miami went on to win 4 National NCAA Championships in only 8 years after being relatively unknown prior.


Why so much talk about Miami?

I read an amazing blog post from Ashley Nelson-Horenstein that gave a simple answer to the metaphor that you should check out. Everywhere you look you see post for Senior Developers, recruiters are bending over backwards to catch the big fish out there while completely ignoring the junior-mid level talent.

Their efforts are very understandable, Tech companies want to win championships and build products quickly. The opportunity to make money in tech is huge and there is a huge sense of urgency for companies to iterate and hire quickly, but what happens when a company drops everything to obtain these talented individuals?

Look at the Miami Heat; no longer a powerhouse they once were.

What if tech companies put more effort in recruiting and developing the potential talent eager to learn and hungry for growth in their career? I am sure in return they would receive the same loyalty from that same home grown talent, the way Miami received.

There is an overwhelming thought that there is just not enough developers out there to do the work that needs to get done, but there is a whole opportunity to teach new people. The framework I work in, Rails has reached the stage of maturity where people can now be taught how to build a blog in 15mins or with enough experience, craft a MVP in a weekend.

I believe that there could be potential in the local community for more growth. If a focus is put in helping the self awareness of the under represented groups in tech to lead the charge in encouraging their communities to take the opportunity to learn such a coveted skill.

Rails has actual done a great job in leading the charge in closing the Gender gap with organizations like RailsBridge and RailsGirls. Making sure that the overall community is one that is inviting and accepting of people of all walks of life.

I began learning how to program in 2013 and decided as a way to keep myself accountable, I kept this blog of my efforts. I also re-emerged myself on twitter. Previously I was a twitter lurker, but I found it was a great tool to engage actual established developers.

As time went by and while I continued down my journey towards proficient programming, I started noticing people reaching out to me and asking me questions, like what do you think about this or how do you do this… sort of thing. I of course answered them and moved on. I eventually started noticing something similar between the majority of the people that reach out to me and it was they were a majority black males.

My hope is to reach other minorities in Rails and encourage them to share their story to encourage others, but also reach out to the community as a whole to let them know to encourage minorities who might not necessarily speak up due to impostor syndrome or other false limitations.


The Pitch There is a great deal of work closing the gender gap, and it has been accepted into the community with open arms. I believe the community ready to talk about closing the cultural gap in tech now. As Black male I am encouraged to share my experiences to others, and hold myself to have the personal responsibility of being my own spokesperson.

I hope to also encourages to reach out to their community just as DeVaris Brown in theTenderloin.

https://www.youtube.com/watch?v=NCjlhOYD_bY

What happened to all of the Black and Hispanic computer scientists out there? Are our struggles, voices, and efforts now irrelevant, because we don’t have the notoriety of a Steve Jobs, Zuck, or Larry and Sergey? Aren’t each of us the best representations of how to not only survive, but thrive in a field where the odds are against us from the start?

{"source":"medium","postId":"390834f56589","publishedDate":1440514664460,"url":"https://medium.com/@bdougie/the-miami-effect-dev-recruiting-390834f56589"}

How I discovered my desire to learn to code

In the fall of 2013 I found myself in the hospital for 10 weeks straight due to the premature birth of my son (he came 11 weeks early). It was tough for my wife and I, we essentially lived in the small NICU room for 12 weeks, only going home to switch out clothes.

Prior to that I had a great sales job selling IT equipment as a consultant in a large distributor. I very much enjoyed the job and always had an interest in Technology and learning it to become an expert, but after my son was born I realized that I wanted to be a father and wanted my son to be proud of me.

I always had the desire to build websites or mobile applications, but always felt unequipped to learn how. I even built an Android app using a tutorial on youtube, and even bought a book in Java, but got busy getting promoted in my sales job and gave up.

So at this point I was determined to succeed and despite how busy I was or I am going to learn how to program. Once my son got home out of the hospital and our lives returned to semi-normal, I began spending my mornings and nights learning.

I discovered Rails from many recommendations on Reddit and youtube, but specifically found this video which convinced me Rails was the way to go. I even flew through the OneMonthRails (OMR) tutorial, which I highly recommend for anyone just as determined as myself.

I also read the book of Joshua Kemp, who went from an actual Blacksmith to Coder with no degree. My thought process, was if he could accomplish the very same goal that I sought out to achieve.

I then found out about Dev Bootcamp while researching Ruby and instantly became excited. I could quit my job , move to Chicago or San Francisco and become a programmer, all in less than 6months, but when I explained my dream out loud to wife, reality hit.

My son was barely 4months at the time and I had no way of paying the remainder of the hospital bills for a newborn plus a wife, all while not working. With great disappointment, I gave up that story and moved on with learning exclusively from tools like, Udemy and Codecademy. My progress was getting there but all I had to show for it was my OMR site(no longer live).

I eventually discovered a new bootcamp, which turn out to be an apprenticeship, Bloc.io. I signed up for Bloc within a week of finding it and after researching every article and even interviewing a student who completed it. I signed up in a week but chose a start date that was a month in advanced to give myself time to back out if something else came up or was better.

Luckily I found nothing else that compared to having an actual mentor to Skype with 3 or more times a week. I learned the basics of Ruby that I struggled with weeks before and even built a working web app in less than 2 weeks.

My code was not amazing but I knew how it worked and could reproduce another app just like it, which I did 3 more times. I even began to work on an app that I thought of called Chuych, which is worked on for a bout 6 months before realizing it wasn’t a sustainable app.

But even after completing Bloc I was completely ready to be employed, I wasn’t even sure if I wanted to be employed, because during this entire time I was promoted in my sales job twice and earning as much as an entry level developer. I even considered putting my journey toward development on a hold to focus on my growing sales career.

Thinking back to my original reason to program, I decided despite how much money I made in corporate sales, it wasn’t worth more than obtaining the dream of being able to be truly happy at my work and building actual applications.

I always admired my grandpa who spent time serving in the Navy during the Cuban Missile Crisis and later served as a D.C. cop, but despite his years of service he decided to pick up a trade in masonry to lay bricks in California.

He chose to follow a dream in California and work on projects that would outlive himself. I have the same desire and want the same opportunity to have my look back on my work and say, “My dad built this.”

I now work as programmer and enjoy every minute of it. Not only to get more time to spend with my family, I also get to work on interesting projects with interesting people.

I share my experiences on a regular basis, on my blog and podcast. Feel free to reach anytime if you have any questions about learning how to code and my journey.

{"source":"medium","postId":"270716a90f9a","publishedDate":1450651510158,"url":"https://medium.com/@bdougie/how-i-discovered-my-desire-to-learn-to-code-270716a90f9a"}

git action traction

📹 Home video recordings of GitHub Action tips for better traction.

What are GitHub Actions?
Automate, customize, and execute your software development workflows right in your repository with GitHub Actions. You can discover, create, and share actions to perform any job you'd like, including CI/CD, and combine actions in a completely customized workflow.

When do Action Traction videos ship?
Every Tuesday.

To find out future tips, check out the repo: repo: https://github.com/bdougie/gitActionTraction

Where can I watch them?
This YouTube playlist

first post yo

Details

Welcome to JAMstack Radio, a new podcast that discusses the JAMstack, a new way to build fast and secure apps or websites. JAMstack Radio is hosted by Brian Douglas, Developer & Advocate at Netlify. In this first episode, Brian is joined by Aaron Autrand, and Christian Schlensker to discuss the JAMstack and some of it’s best applications.

Air Date: 9/1/2016
Listen

Christian

  1. Jittery John's
  2. Nena
  3. Hamilton soundtrack

Aaron

  1. San Franciscon non-profit season tickets
  2. Earl Grey tea
  3. Augustines

Brian

  1. LaCroix
  2. Cocktails w/LaCroix
  3. The Book of Ye

Creating Modals in AngularJs

Modals have been a contention with me since I first started developing for the web. For the most part most my attempts to write a custom modal have been swallowed up with a magical bootstrap implementation that includes a little jQuery sprinkled in.

My most recent task was to convert a quick survey pop-up to our students into a modal and required me to hand build that reusable magic on my own.

Our tech stack here at Bloc includes a Rails for Api and Angular 1.2.x to do a lot of driving for the Frontend. It is very apparent that Angular 2 is a rethink and refactoring of Angular, which is causing a lot of companies to rethink the way they are implementing Angular.

Knowing this, all new Angular code for Bloc has been section off into a folder called `components`, separate pieces of code that could work on its own if needed.

The path to doing this is using an Angular Directive to display a reusable modal. The file structure for this directive includes the following files:

index.js

The index.js is the platform to create your Angular module and to be added your in ng-app-init.js file for easy access in your file structure.

var angular = require('angular');  
var NpsFormOverlay = angular.module('NpsFormOverlay', []);

require('./directive');

module.exports = NpsFormOverlay;  

This file includes a call to the directive and exports the entire component as it’s own NpsFormOverlay with the module.exports declaration.

directive.js

Similar to the index.js, the directive collects the work from the controller, stylesheet, and template as it’s own and gets required as you recall in the

The implementation:

index.js

var angular = require('angular');
require('./controller');
angular
  .module('NpsFormOverlay')
  .directive('npsFormOverlay', function() {
    require('./style.css.sass');

    return {
      controller: 'NpsFormOverlayCtrl',
      controllerAs: 'nps',
      restrict:   'E',
      replace:    true,
      template:   require('./template.html'),
      link:       function(scope) {
        scope.npsGif = require('./achievement_nps.gif');
      }
    };
  });

Some things to note is that we are using the slightly different [as syntax](http://toddmotto.com/digging-into-angulars-controller-as-syntax/), using this in favor of $scope.

controller.js

var _ = require('lodash');
var angular = require('angular');
var Path = require('utilities/path');

angular
  .module('NpsFormOverlay')
  .controller('NpsFormOverlayCtrl', function(
    $http
  ) {

    var _open = function() {
      this.shouldShow = true;
    }.bind(this);

    var _close = function() {
      this.shouldShow = false;
    }.bind(this);

    this.closeNpsOverlay = _close;
    this.showFeedbackComments = false;

 this.submitFeedback = function() {
      var feedbackParams;
      this.canDismiss = false;
      feedbackParams = {
        rating: this.feedback.rating,
        submitted_at: new Date()
      };

      this.showFeedbackComments = true;

      return $http.put(Path.api_feedback_path(this.feedback), {
        feedback: feedbackParams,
        create_event: true
      }).success(function() {
        console.log('Rating submitted successfully');
      }).error(function() {
        this.canDismiss = true;
        return Flash.error(
          'There was an error submitting your feedback! Please contact [email protected].'
        );
      });
    }.bind(this);

    this.submitFeedbackComments = function() {
      var feedbackParams;
      feedbackParams = {
        comment: this.feedback.comment
      };

      _close();

      return $http.put(Path.api_feedback_path(this.feedback), {
        feedback: feedbackParams
      }).success(function() {
        console.log('Comments submitted successfully');
      }).error(function() {
        return Flash.error(
          'There was an error submitting your feedback! Please contact [email protected].'
        );
      });
    }.bind(this);

   _open();
});

assets and template.html

Stylesheets and Templates can live inside your directive like a beautiful component. Nothing really different here other than the placement of these files, but just know they live in the directive component and not the normal template and asset folders.

Rendering this wherever

Finally the way to implement this modal directive only requires using the Angular directive syntax of a custom tag.

My thoughts:

What I like about this modal implementation is that it mirrors the popularity of Web Components and this enables us to upgrade portions of our Angular code component by component if need be.

With this also being a component, I could easily rewrite/test this component using React or any other popular javascript or css library without affecting the rest of our Frontend Angular codebase(Perhaps an idea for another blog post).

This post was originally written on code.bloc.io

{"source":"medium","postId":"3bf3ea692d84","publishedDate":1449166513616,"url":"https://medium.com/newsonthebloc/creating-modals-in-angularjs-3bf3ea692d84"}

Why your next site should be built with JAM in mind

There’s no reason to have a massive, unwieldy CMS with a database or a fancy isomorphic monolith when you could have a fast, secure and beautiful static site. But how can you decide if a new site is right for you?

No matter what tools you prefer to develop in, whether it be Node, Ruby, Python or something else, there’s a site generator for you(staticgen.com), the best source for information on static website generators on the internet.

Nowadays the tooling around JavaScript evolved a lot — Grunt, Gulp, and Webpack, just to name a few. You can build functional sites and web-apps that bundle into deployable static files. Couple this with Continuous Deployment through Git and you have the JAMstack.

You Value Security

With a static site, you don’t have to worry about malicious code being injected into your site when users visit it. Static sites are built on a production machine (probably the machine you are reading this on) by static site generators, which take your code and spit out flat HTML files with CSS and JavaScript. When a user requests a page from your site, the server just sends them the file for that page, instead of building that page from various assets each time. No build process means standard hacking attacks like scripting or database security exploits just don’t work.

You Value Speed

What does a browser do? It renders HTML, CSS and JavaScript into a human-viewable format. No matter what type of site you use, a legacy dynamic site or a modern static one, what gets sent from the server to your browser is HTML, CSS and JavaScript. So why take the time and resources to render your site every single time someone visits when you can have a pre-built version ready to go? There’s a reason that a normal static site hosted on a CDN is often 10 times faster time-to-first-byte than a site built with a legacy CMS.

Additionally, by hosting your static site on a CDN, you can serve it from whichever node is closest to your users. Someone viewing your site in a coffee shop in Vienna pulls from a European server, not a server farm in the Silicon Valley. The same goes for your Japanese visitors, or a user just down the street.

Flexibility

With a static site, you can get lean and mean, with a tool that does exactly what you need it to. Like to blog? Try out Jekyll or Hugo. Want a high performance marketing site? Make like the pros and use Middleman or Roots. Trying to showcase your visual portfolio? Maybe Cactus is right for you. And if you want something so finely tuned and streamlined to your complete specifications, Metalsmith is definitely the way to go.

Smaller Footprint

A static site, when generated, is capable of being hosted on any web server that can return HTML files (which gives you a whole bunch of options). Of course, you’ll want to take advantage of the possibilities afforded to you with a static site by finding a host that allows for things like continuous deployment, instant cache invalidation, automated deploys and more. But you can leave that to somebody else, and instead of installing, managing and updating your CMS, you can focus on developing your site.

Reliability

Does that look familiar (and painful)? If you’ve managed to avoid it with your own site thus far…congratulations, you are in rare company. Obviously, working without a database you won’t see that, but static site reliability goes beyond database errors. The beauty of serving up flat HTML files is that they can be hosted anywhere and everywhere, like on a CDN. Let’s say there’s a DDoS attack on the server where your legacy site is hosted. Sorry, but you might just be screwed for a few hours (or days). That same attack hits a node where your static site is hosted? Your site just gets served up from the next closest node. Your visitors never even notice that there’s a problem.

Developer Experience

The beauty of using a static website generator is in the developer experience. Build tools will output your HTML to a particular directory on your build machine, and nearly all tools include a local web server, which allows you to check and double check your progress as you go. You have the security of knowing that your site will look exactly the same to your visitors as it does to you as a developer.

Scalability

You’ve hit it big! Your site has gone viral, and you are seeing absolutely massive response and increased visits thanks to getting name checked across the social media spectrum. Did you anticipate that this might happen? Did you over provision massively, just in case this happened? Are you paying for huge chunks of bandwidth monthly, hoping for (and fearing) an explosion of traffic.

Or are you making frantic calls to your service provider to get back up online after you made it to Reddit’s front page? Your plan couldn’t handle that kind of attention, and now you are down (and got dragged out of bed or away from the dinner table to try and resurrect things).

And when your traffic means that you have to scale, it means that you are paying for all that complex code to run on your server at every page request. And that’s going to hit you right where it hurts: the wallet.

With static, scalability is barely an issue. Of course it scales! Increased requests mean increased pages served, but no extra work in building those pages. With some providers, scale is built in, while with others like Amazon’s S3, all you have to pay for is the increased bandwidth.

8. Hosting & Price

If all the heavy lifting of building a static site is done on your production machine, then what exactly is it that you are paying for with hosting? Asset storage, basically. Your static HTML files take up next to no space, and so your service is usually priced accordingly. Instead, you can spend your money where it really matters, on the features that make your site faster and your life easier, features like atomic deploys and asset fingerprinting to make sure your site is always globally consistent, or git integration and automated builds, so your site is always up to date with your latest changes, and snapshot versioning and instant rollbacks (in case your latest changes break something).

There’s never been a better time to take advantage of the speed, security and reliability of static web generators and the development environment around them. So what are you waiting for?

I am the host of JAMstack Radio, a podcast where we topics like this as well as discussing JavaScript, APIs, and Markup. Let me know what you think and please spread the JAM.

{"source":"medium","postId":"34b9234a272f","publishedDate":1487963266471,"url":"https://medium.com/jamstack/why-your-next-site-should-be-built-with-jam-in-mind-34b9234a272f"}

How to defuse a Toxic SF Tech Experience

Traveling across country for a developer job was never on my radar when I first began learning to code almost 2 years ago. Today I find myself in one of the most desired places to live in the country and contributing to the growth of community that is despised by it’s locals.

Prior to moving to SF I spent a short amount of time working with a group called Steamrole, which had the original mission was to connect underrepresented groups to companies looking inject a little bit of diversity in their teams. I had reservations in joining a startup but eventually to get their community up and running via slack, during a time when Slack Communities were barely a thing.

During this time we gained a lot of feedback prior to even writing more than a page of code. One response in particular, struck a chord with me.

Justin Searls is someone I have been following for while prior to this tweet. My first response was pure excitement that an individual I respected from conference talks and thought provoking blog posts notice something I happen to be a part of, but once I that passed, I felt worried that the very project I was going to be apart of would be pointless.

We never really got that project off the ground, but what really got me thinking was his response to his original tweet, clarifying his reason for tweeting about the app.

During this time I worked and lived in Florida my whole life and had no desire to leave, and sort of fell into the tech world via learning to program.

California was never in the picture for my career and thanks to this Tweet, it was even more out the question. I spent a good amount of time researching the SF Rent problems, and even incidents employees at tech companies were singled out for being a parasites to the city of San Francisco.

In an effort to get to the point of this story, I ended up getting an email from a company I respected and now work for today, which I actually go into more detail on my podcast episode here. The offer was too good for my career to pass up and despite my original reservations, I chose to accept the job move to the Bay Area.


I have now lived here in the Bay Area now for 6 months now and have had many experiences that have made me cringed and wish I wasn’t part of the tech scene swallowing up the city of San Francisco.

Unfortunately the experiences that made me cringe didn’t involve protestors or random citizens yelling at me for working at a startup sucking the out the life of local businesses.

The situations where I cringed all involve other tech employees like myself acting out right pretentious. My first hand experience of this “toxic place” actually seems self inflicted on the tech community.

My thought to event write this post streamed from one incident in particular, last Friday.

I commute daily on BART to work and many times catch a crowded train on my commute home. On most occasions I can be found wearing a plain shirt with no symbols on my clothing stating my place in the world or my job at a startup. I prefer not to flaunt my status in the city in effort to not experience the backlash of SF tech hate (which I have only witnessed once in person).

I do this out of respect to the situation, despite the fact my appearance and skin color being the exact opposite of the tech employee profile. I only assume no one thinks I work on code for tech company.

But I digress, on this occasion I chose not to wear my headphones due to my limited cell phone battery, and instead eavesdropped on a conversation of two apparent tech employees.

A one sided of conversation (out of context) was riddle with the announcements that he was a lead engineer and that he loved what he did. He also stated he never been out of a job and could switch jobs whenever he pleased, in addition to mentioning how well he was being paid.

His demeanor and pretentiousness made me angry to the point I had drain the life of my remaining cell phone battery in effort to drown out the rest of his conversation. I am an engineer, I love what I do and get paid very well, but no one on BART needs to know that.

Prior to that I took a brief census of the individuals surrounding me on the train and most looked like they put in a hard day of work and probably had no opportunity indulge in the benefits myself and the pretentious engineer could.

The hate towards tech is nothing different than the hate I experienced growing up in a white neighborhood, being the only Black family. A lot of assumptions are placed on me without ever getting to know me, so I had to learn how to diffuse a situation with a smile and respectfully introducing myself and status only when appropriate.

I grew up being aware of how I am perceived by others and pride myself on being able to walk myself safely out of hostile situations — even when the N* word was used as if it was my first name.

Being a Software Engineer amongst the SF tech hate is nothing new for me, but I go out of my way to not bring attention to myself. I am here to work and provide for my family. When asked what I do, I respond I work for an small business in education(not a startup), because where I work does not define who I am.

I honestly believe that SF needs more diverse people in tech, just so we can teach the majority how to act appropriately. If you happen to find yourself in the tech majority but being discriminated against, keep in mind, no one cares what startup you work for or how much you make. Be respectful and buy your own t-shirts.

And for the Lead Engineer traveling to Walnut Creek, I hope to post finds you well, best of luck with your apparently growing career.

{"source":"medium","postId":"d4fbe79e60f2","publishedDate":1442204806299,"url":"https://medium.com/@bdougie/how-to-defuse-a-toxic-sf-tech-experience-d4fbe79e60f2"}

Are programming bootcamps worth the price?

Are programming bootcamps worth the price?

The past week has been very busy and included two trips to move my stuff from Orlando to Tampa to prepare to eventually move to San Francisco. While picking up my uhaul the Uhaul employee noticed a shirt I was wearing which happened to have the logo for Extreme Networks, a vendor I worked with at Tech Data (in sales). I explained it was a networking company and he mentioned that he was looking into going back to school for networking engineering and asked me if it would be worth it.

The individual was probably around my age and I asked him why he wanted to do network engineering? He explain that it probably paid well and he was always interested in computers, and with my keen ear for hearing the customer and closing a sale I just had mention my story and how I got into software in less than 7 months.

He was definitely intrigued and I told him about my new employer and how we teach interested individuals how to become a web/mobile developer.

This got me thinking while I drove across the state of Florida, this uhaul employee was going to go back to school for probably 15–30k in tuition for the hope in making more than what he was getting paid at Uhaul. I paid 5k for the opportunity to learn via Bloc(where I now work as an engineer) and in person bootcamps for less the tuition and dedicated 4 years.

While working at my previous employer, I watched countless interviewees walk in for interviews out of college with Computer Science degrees but no real experience and no real portfolio to prove their ability develop code.

In the United States it is preached that once you have a degree you will have a great job, but I worked at a job out of college for 24k a year because I couldn’t get a job in finance.

So my question before I answer original question is, Is getting a college degree even worth it? I have Finance Degree from an accredited state school and have yet to use that piece of paper or even provided a copy of it to any of my employers. To be honest I haven’t even removed it from the cardboard envelope it came 7 years ago (What a waste of $48, the cost to send it to me).

I now work at a job making more than twice as much as I my base pay in sales and a significant amount higher than my salary even with a highest received bonus’d month. When I share the amount I paid to learn via Bloc’s mentorship program and discuss the cost of bootcamps with others, it is very common to hear that rebuttals to how expensive the cost is, but when you talk with the same population of people about going back to school, there is not even a second thought about that cost.

For some perspective: I previously roomed with someone who made the decision to drop out of a very well known and expensive College in Nashville to pursue his dream with DevBootcampSF, which really sparked me to write this blog post. Instead of paying for 150k+ in tuition after graduation, he is now only paying what it would cost for one semester in his previous College.

So are bootcamps worth it?

My response is obvious, it yes, but I truly believe if you are looking for an experience that you get when going back to school where you can just breeze by and get a job when its over, you might as well just go back to school. Bootcamps are definitely worth it, but you need to be driven and be willing to experiment with different tools, build a portfolio outside the curriculum, and be willing to attend meetups get involved in the community to eventual get that offer that truly makes it worth, but more on those details in a future post.

Bootcamps, including the one I attended**,** all have payment plans to help cover the cost up front. Some bootcamps even offer financial assistance and payment deferment for the most exceptionally driven individuals.

Best of luck on your journey and your decision to learn to code.

{"source":"medium","postId":"1bb20cb39f15","publishedDate":1440946153999,"url":"https://medium.com/@bdougie/are-programming-bootcamps-worth-the-price-1bb20cb39f15"}

Organizing streaming schedule and notifications with GitHub Actions

I am working on a way to have notifications sent to the discord. This will give folks a heads up on special events and regular streams.

How does this work?

All issues are meant to identify content for future and current streams. I have built a project board to manage the stream schedule, so any chatter can catch up on what we are working on. I am leveraging GitHub Actions to manage to add and remove labels from issues. If an issue has the `live label it will get sent to the discord to notify folks there is a stream happening on Tuesday or Friday.

Screen Shot 2021-04-01 at 1 34 02 PM

Action workflow for labeling:
https://github.com/bdougie/live/blob/main/.github/workflows/project-labels.yml

Action workflow for discord notification:
https://github.com/bdougie/live/blob/main/.github/workflows/discord-notification.yml

Example of the notification:

Screen Shot 2021-04-01 at 1 41 02 PM

Join the Discord for notifications!

What's next?

I need to add a vacation notification for when there is not a stream. Every now and then things get scheduled over the stream. A notification that the stream time change would also be a great idea.

Error handling

When there are no issues labeled an error is presented. It would be nice to have a fallback message for the case.

https://github.com/bdougie/live/runs/2254189829?check_suite_focus=true

Screen Shot 2021-04-02 at 10 08 48 AM

Touch targets on mobile are off in the mobile nav

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to bdougie.live on mobile
  2. Click on click on the hamburger menu
  3. Scroll down to click the GitHub link
  4. See the menu closes and impossible to click

Expected behavior
A clear and concise description of what you expected to happen.

I should be able to click links

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6] iOS iPhone regular
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Build a GitHub Action to resize images

Building GitHub Actions is a process that has many paths. This stream will focus on showing different ways to approach building and debugging to custom GitHub Actions to be used in any project.

calibreapp/react-live-chat-loader - Open Source Friday

A conversation with the maintainer of the calibreapp/react-live-chat-loader, an open-source project that mirrors the features of Intercom without any blocking JavaScript.

Show notes:

30th April 2020 12:00 UTC-7

Agenda:

  1. Intro @benschwarz
  2. Walkthrough calibreapp/react-live-chat-loader

Link to the video

Reminder:

Relevant links

Rebuild Netlify with GitHub Actions

This is something I have wanted to do for a while. Thanks to some recent features, I think I can rebuild Netlify features using GitHub Actions. This is not meant to be a replacement for Netlify, that would be dumb and you should sign up for Netlify. This is a technical challenge for me and would be really cool if I could do it.

Update copyright date

Describe the bug

Copyright shows 2020 not 2022 (could be dynamic)

Sorry, been noticing this a lot at the start of the year

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://bdougie.live/
  2. Scroll down to footer
  3. See 2020

Expected behavior
I would expect copyright to be 2022

Screenshots
Screen Shot 2022-01-10 at 11 32 48

Desktop (please complete the following information):

  • OS: Mac
  • Browser brave
  • Version Version 1.34.80 Chromium: 97.0.4692.71 (Official Build) (x86_64)

Additional context
Happy to add © {new Date().getFullYear()} All Rights Reserved. bdougie.live to © 2020 All Rights Reserved. bdougie.live if needed

Markdown rendering is not GitHub flavoring

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://bdougie.live/post/49/git-action-traction
  2. See error
  3. Weep

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2021-01-11 at 3 52 15 PM

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

How I built a Pokémon Go Server Status Checker

I have always been a fan of Pokémon — So like so many others, I joined the Pokémon hunt on PokémonGo. Team Valor FTW!!

https://twitter.com/bdougieYO/status/754027205945020416

Unfortunately as with everyone else, I had trouble staying logged in. I continually saw outages during critical times, like when a Paras showed up in the laundromat or when I found a Cubone by the Bay Bridge.

Despite the server problems, me and other trainers continue to use the app.

To make things easier for those who want to stay informed, I built a site using a JavaScript open source library — is-pokemon-go-up

The site ispokemon.live is live and built using the JAM stack philosophy. Which identifies a useful way to build modern websites.

https://twitter.com/bdougieYO/status/753634053362888704

JAM stack

The JAM stack is the stack for this new reality. Instead of FTPing server-side code to a shared server, we push to git and our code is instantly built and distributed onto CDN nodes across the world. Instead of depending on a database for every request we serve, we use build tools to ship full sites and apps ready to run directly in the browser. Instead of mixing persistence, HTML generation, credit-card transactions, authentication, etc, all together, we separate these concerns and consume well defined APIs from our front-end.

The JAM stack uses markup languages like HTML, CSS and Markdown to format and style our content, client-side Javascript to make it interactive and engaging and APIs to add persistence, real-time sync, real-world interactions, comments, shopping carts, and so on.

Browsers are the new operating system. Servers are abstracted away by CDNs and APIs. Sites are either database free and generated up front, or consume hosted database services directly from the browser. JavaScript is in charge of any dynamic programming during the request/response cycle and runs entirely on the client (JAMstack.org).

Using the JAM stack

Using the JAM stack for this project enabled me to quickly iterate on an idea and ship to production with a low amount of effort.

The API created from the open source library populates my API from a node server in this case but could have delivered using any language or service. The API then gets consumed using React, which is also serving my Markup from a small amount of JSX. You can think of JavaScript as the glue that makes everything work.

Thanks to some more pre-packaged code I put together a quick site using React Static Boilerplate and generated a static build using Webpack.

The JAM stack has provided a seamless workflow for getting projects live. If you have interest in learning more on how I got a project like ispokemon.live up and running, read more on the Netlify getting started guide or checkout the project on GitHub.

It is also fare to mention that the JAM stack is not a new idea, just a new name.

*I should also note, developers have been building API’s and Markups to consume then for years. The JAM is not new concept, but a new name.

https://github.com/netlify/another-pokemon-go-client

💚 is appreciated 😊

{"source":"medium","postId":"c7997a23aa40","publishedDate":1468816965592,"url":"https://medium.com/jamstack/how-i-built-a-pok%C3%A9mongo-server-status-checker-c7997a23aa40"}

The heart should be red and not black (reactions on post)

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.
Screen Shot 2020-11-17 at 2 28 09 PM

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Creating a Slack command with hook.io

I am always looking for ways to do new things with code. Today I work at a startup called Bloc. Being a startup we work in an agile environment, which means there are always a few bugs in the system.

We use a tool called Phabricator to track bugs. It’s very nice

Yesterday during a routine bug announcement in slack, an idea was provided, “i wish there was a /phab command in slack.” The idea was to have this command to easily generate bug task for engineers to eventually squash.

Currently the process takes 4 for extremely long steps:

  1. Open Browser Tab
  2. Log into Phabricator
  3. Click add task button
  4. Fill in info

I wanted to see if there was a way for me cut out some of those steps.

The beauty of slack is it is very customizable and gives it’s users the ability to add Slack Commands. Knowing this I started researching how to do this.

I knew I could use Hubot or Lita to accomplish this but it almost seemed like overkill to have a separate server/bot to do essentially what a webhook could do.

So I began researching web hooks in Go. I have been learning Go for awhile and have yet to have opportunity to implement it at work or in a side project yet. I found this webhook library, but it was taking me too long to stumble through the syntax and relearn how to work Go, so I bailed on this.

I then though the fastest way would be to use Ruby to create a webhook server locally from scratch, but while starting that I had another thought to check if there were any services out there to create this simple task.

I finally stumbled upon hook.io from this changelog article. It seemed legit so I started wiring it up.

First I had to create the slack command, which only required me to fill out the form at the https://slack.com/services/new/slash-commands.

I then had to created the hook using the basic template for a helloWorld hook; I just replaced some of the code to return a clickable link in slack, that will open the phabricator ticket creator.

I just needed to edit some node code, click “deploy service” and a link is provided for me to add to my slack command’s GET url.

Now that it is all wired up, I just have to type my new slack command with a title for my bug ticket and boom, I have the slack integration faster than a Kanye acceptance speech at the VMA’s.

I still would like to play around with creating my own webhook that will open the page for the user, but for now my current implementation takes the previous 4 steps and makes them 2.

  1. slack /phab [title]
  2. Fill in info

If you have experience in making custom slack commands with a different implementation, please drop me a line here or on twitter. I would love to make this implementation better, maybe next time with Go.

{"source":"medium","postId":"fe4d2bb7ffd2","publishedDate":1441983925367,"url":"https://medium.com/newsonthebloc/creating-slack-command-with-a-hook-io-fe4d2bb7ffd2"}

I am teaching Alexa its first Kanye Skill

I am teaching Alexa its first Kanye Skill

The company I work for announced a partnership with Amazon to start teaching or students how to create skills for Alexa.

https://blog.bloc.io/amazon-alexa-developer-training/

I am forever a learner when it comes with programming and I am pretty intrigued to see how hard it was to submit my first skill through the Amazon Developer portal (Spoiler it wasn’t that hard).

The Alexa is the interface for the Amazon Echo, a hands-free speaker you control with your voice. The Alexa Voice Service can play music, provide information, news, sports scores, weather, and more — instantly. I currently do not have or have not used an Alexa in person, but to help support this new partnership I went through the step by step instructions on the alexa-skills-kit-js repo.

The Fact Templates are great guides to get acquainted with the Alexa Skill node script. I simply cloned the repo and started with the Space Geek template.

As I do, I came up with some replacement facts for the space facts provided and they were facts about Kanye.

Did you know one of Kanye is a big fan of Fionna Apple?

Kanye has made a name for himself and as an entertainer/entrepreneur and what better place than the Echo to learn about his accomplishments.

From a quick google search I found 45 facts about Kanye and wrapped them up in a JavaScript Array. I also did some quick find and replacing to name my Kanye skill, “Kanye Knowledge.” Most of my time in developing this skill was spent finding facts about Kanye, working with the JavaScript template was about 10mins of work.

You can view my code here:

https://github.com/bdougie/KanyeSkill/tree/master

The majority of my time was spent trying to traverse the documentation on getting my skill hosted on Amazon Lambda. I missed step 13 of the README, which is the main reason why it took me 40mins to get my code working and tested on Lambda.

#13 Set the Event Source type as Alexa Skills kit and Enable it now. Click Submit.

Once I got my Lambda endpoint url, the Amazon Developer was pretty straight forward. I am told that it can take up to 7 days for my skill to be reviewed, but hopefully my 157 lined index.js isn’t too much trouble.

Now I wait to hear positive news about my skill next week; I have plans to eventually get an Echo in the near future, but until then I hope someone can benefit from my potential skill.

{"source":"medium","postId":"32f45e8e454c","publishedDate":1459139130133,"url":"https://medium.com/@bdougie/i-am-teaching-alexa-it-s-first-kanye-skill-32f45e8e454c"}

Build a Twitch Bot

The goal is to build a twitch bot that responds to commands and presents gifs. This bot was inspired by ComfyJS. My experience building this bought can be read in blog post on dev.to/bdougie.

Link to source code: open-sauced/beybot

https://www.youtube.com/watch?v=bWxU6acUUok

Examples in the wild
These chat interactions are basic, but if you want to see more examples of chat interactions, check out the following channels.

Adding Swipe to Delete in React Native

I am currently working on a mobile note app from the Bloc iOS curriculum and discovered certain things in iOS transfer over to React Native well.

A lot of iOS apps are built using the UIKit UITableView structure (a list of items presented in rows):

In React Native the UITableView equivalent is called a ListView. In terms of presenting the items, the UITableViews and ListViews pretty similar aside from the attribute names used to interact with them (so not that similar).

Unlike iOS, React Native takes on the challenge of being flexible enough to build mobile apps in Android and iOS, so some of the built functions like “Swipe to Delete” and TouchableHighlight(Tap) are not included out of the box for ListViews to provide that flexibility.

import React from 'react-native';

let {
  View,
  Text,
  ListView,
  StyleSheet,
} = React;

let styles = StyleSheet.create({
  ...
});

class Notes extends React.Component{
  ...

  renderRow(rowData) {
    return (
    <TouchableHighlight
      underlayColor='rgba(192,192,192,1,0.6)'
      onPress={this.viewNote.bind(this, rowData)} >
      <View>
        <View style={styles.rowContainer}>
          <Text style={styles.note}> {rowData} </Text>
        </View>
          <Separator />
        </View>
      </View>
    </TouchableHighlight>
    )
  }
  viewNote(rowData) {
    this.props.navigator.push({
      title: 'The Note',
      component: ViewNote,
      passProps: {
        noteText: rowData,
        noteId: this.noteId(rowData),
      }
    });
  }
  
  render() {
    return (
      <View style={styles.container}>
        <ListView
          dataSource={this.state.dataSource}
          renderRow={this.renderRow.bind(this)} />
      </View>
    )
  }
};

export default Notes;

Having this limitation, I had to rely on a 3rd-party library to enable the deletion of a ListView. I spend some time searching for a solution and came across the react-native-swipeout library.

The use of this library is pretty straight forward and only requires the import of the Swipeout component to wrap whichever component you would like to be swipeable.

You also need to add a variable (swipeBtns) containing the props for the swipe buttons.

import React from 'react-native';
import Swipeout from 'react-native-swipeout';

...

  renderRow(rowData) {
    let swipeBtns = [{
      text: 'Delete',
      backgroundColor: 'red',
      underlayColor: 'rgba(0, 0, 0, 1, 0.6)',
      onPress: () => { this.deleteNote(rowData) }
    }];

    return (
      <Swipeout right={swipeBtns}
        autoClose='true'
        backgroundColor= 'transparent'>
        <TouchableHighlight
          underlayColor='rgba(192,192,192,1,0.6)'
          onPress={this.viewNote.bind(this, rowData)} >
          <View>
            <View style={styles.rowContainer}>
              <Text style={styles.note}> {rowData} </Text>
            </View>
            <Separator />
          </View>
        </TouchableHighlight>
      </Swipeout>
    )
  }

Note that the swipeBtns holds objects within an array, allowing you to add multiple buttons to your Swipeout view.

let swipeBtns = [
  {
    text: 'Delete',
    backgroundColor: 'red',
    underlayColor: 'rgba(0, 0, 0, 1, 0.6)',
    onPress: () => { this.deleteNote(rowData) }
 },
  {
    text: 'Duplicate',
    backgroundColor: 'blue',
    underlayColor: 'rgba(0, 0, 0, 1, 0.6)',
    onPress: () => { this.duplicateNote(rowData) }
 }
];

This Swipeout library and React Native are still fairly new and still a work in progress, but for the functionality to delete rows in my ListView, it works great.

If you are interested, you can view the my note app example source code on my github. To checkout how “Swipe To Delete” works in native iOS apps, check out this Objective example here.

If you are interested in hearing about more details comparing React Native to Native iOS, come watch my talk at Forward Conference in February 2016.

This post was originally written on blog.briandouglas.me. All code examples have been written using ES6.

{"source":"medium","postId":"cfa85a5f5a31","publishedDate":1449499420383,"url":"https://medium.com/@bdougie/adding-swipe-to-delete-in-react-native-cfa85a5f5a31"}

Twitter link is broken in the lower moosehead

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Screen Shot 2020-11-17 at 2 25 30 PM

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

How do you balance learning more than one programming language at once?

Schedule Time

I did not start programming when I was young and did not have to the forethought to study Computer Science when I was in college; I instead began learning after starting a career in IT Sales and shortly after the birth of my first son.

Time was one luxury I did not have, and I was determined to have this current attempt for learning to stick. One of the first things I did, thanks to this book, was schedule learning time on my google calendar. I had 21 hours set aside each week for actually learning how to code.

To this day I still keep up with a slightly scaled back learning schedule.

Diversify your learning

Today I work as Full Stack Web Developer working with Ruby and Javascript primarily. My work app rarely requires languages outside of those two and I spend a good amount of time researching just those two languages and the frameworks associated with them.

While I am at home researching technologies on my own, I very rarely working on those two languages to avoid being burned out on programming at home. I do not work from home and rarely spend much time researching for work while at home.

I actually prefer to work with entirely different languages and frameworks and currently working with Go and Swift. Learning something entirely new provides enough excitement and interest to make my outside of work programming feel not like work.

If I find myself becoming uninterested in my extracurricular work, I imagine I would just pick a new language to work with, but for now working with Swift and iOS seems to be a pretty good opposite to the web work I normally do.

Start a project

Hands down the easy way to learn and stay interested in learning is starting a project. A lot of people I encountered hinder themselves by waiting until they have a million dollar idea for a project, but my recommendation is to just pick a project no matter how dumb it is.

I am currently working on a messaging app in iOS that sends you Kanye West quotes. The only purpose for this app is to help me learn how to program in iOS.

Pay for a course or a book

Finally I recommend to pay for something. Get structured learning from a video tutorial, book, or even course. Sometimes learning extra languages can be a bit uninspired and need a lot of encouragement.

This is the part where I try to sell you a book or course on programming, but I won’t. There are countless amounts of resources out there that can easily searched by Google.

I will however recommend the CodeNewbie community for learning new languages, because every time we learn something new, we get to be a newbie.

{"source":"medium","postId":"10b5c19e3c88","publishedDate":1447684302176,"url":"https://medium.com/@bdougie/how-do-you-balance-learning-more-than-one-programming-language-at-once-10b5c19e3c88"}

Comparing modern build tools

Build tools have become a necessary component in the workflow for modern web applications. I have previously covered the basics of what build tools can do for you to show how builds help with scripting, automation, and eliminating complexity. Taking those into consideration, I’m going to provide a closer look at some of the more popular build tools and how they might make sense for your projects.

This post isn’t meant to be an exhaustive list. Rather, it’s meant to provide suggestions to help you get started in researching how different build tools improve the development workflow. While reading through this comparison on build tools you will gain some knowledge to better equip yourself for comparing how these tools line up with your specific needs.

What are we comparing again?

This guide will only look at build tools that have the ability to perform project module bundling, which is the process of stitching dynamic content into modules and bundles into static assets files. This process can be enhanced using scripting, automation, and minification. Not all build tools are created equal and not all build tools can do all of the above. Some tools require more configuration and some are drop-in solutions that do most of what you need out of the box.

It’s likely you’ll have (or develop) a preference for how much you’d like a build tool to do. So rather than choosing one build tool to rule them, this post will cover the advantages, gotchas, and an ideal project profile for each tool.

Browserify

Advantage: Drop dead simple
The catch: Development on the project has slowed down a lot
Ideal project: Projects that are looking to move away heavy usage of script tags and move CommonJS requires instead.

Browserify focuses on the simplicity of getting started and it is a great introduction to module bundling in JavaScript development. Browserify originally came into existence as a way to allow front-end developers to use CommonJS (require statements) in the browser the same way you would in the server render node application. Previously web development used multiple script tags on the page to build modern web apps. This tool browserifies all your JavaScript files into a concatenated (combined and merged) file that can easily be included on the page as a single script tag.

Using Browserify starts with the installation of the CLI. I recommend using npm from the command line.

 npm install browserify

Once installed, you can point your JavaScript entry point of your application (most likely your index.js) to a location to start the Browserifying process.

 browserify index.js > bundle.js

The result is a bundled version of your JavaScript that can be included in your index.html.


 <script src=”bundle.js”></script>

Browserify implementation is feature complete and focuses on JavaScript improvements out of the box. To support the bundling of non-JavaScript assets, like CSS or images, there is a healthy list community-created transforms (all named with ify endings, how clever) to source for those solutions. I’m a huge fan of enlisting the open source community to take a project further, but if you’re giving Browserify a try take heed: some transforms haven’t received new updates in more than six months. That being said there is plenty of areas to contribute back to the community by providing plugins to your project’s solutions.

Unlike some other build tools, Browserify doesn’t have a standard config file to maintain. however you can leverage the node package.json to handle more advance configurations. The work of Browserify is inferred through the plugins and what is inside your JavaScript files. For projects that do not constantly need to be updated, this can be a beautiful thing. For projects in need of a lot of tools and optimizations, the missing config file can become a burden because there is no source of truth or place to expose the witchcraft of the build tool.

Consult the Browserify documentation as well as the list of transforms to see it includes everything you need to make your development workflow happy. You can also use this tutorial on how to build a React app with Browserify to see it in action. If simple is what you need then Browserify is something I would consider for your next project.

Webpack

Advantage: Actively-supported project with tons of features out of the box
The catch: Takes a bit of custom configuration to get right
Ideal project: Projects that are looking to stay up to date with latest and greatest changes. Projects also looking to do code splitting should consider webpack as well.

Webpack is a build tool that is built on 4 main concepts: Entry, Output, Plugins, and Loaders. Once you understand the ideas around these concepts, you can get Webpack up and running on a project. Webpack took can feel similar to Browserify in some ways with enhanced features through a community of plugins. Webpack however, comes with more features out of the box with plans to continue to add more and continually rethinking the design of the project.

I wrote previously wrote a guide for getting started with [Webpack from scratch](https://www.netlify.com/blog/2017/11/30/starting-with-webpack-from-scratch/) and it focusing on the leveraging the Webpack CLI to build a React application. Webpack requires you create a separate config file to support your Webpack build efforts. This file is nothing more than a JavaScript object that Webpack uses to enable and disable features during the build process based on keys and values within the config object.


 // example of a webpack.config.js
 
 module.exports = {
   entry:’./index.js’,
   output: {
   filename: ‘bundle.js’
 }

Within the config you can identify the entry point of your project as well as the location of where you would like to place your bundle. This makes running the Webpack build simpler since do not need remember specific commands, you just `webpack` to create you build.


 npm install webpack
 webpack

The Webpack config can be a sweet way to approach adding new features and tools to enhance your build process, but like most sweets things, a few additions here and there can cause your config to bloat into to a form that unmanageable. A config that looks unmanageable can be a form where the development team on a project avoids changing or updating the Webpack config for fear of breaking the build due to one too many added to the Webpack config file.

The React team has solved this Webpack problem by abstracting the config away into a hidden script beneath the create-react-app CLI tool. If you take a look at the hidden config, the file has some of the best laid out comments you may ever have seen in a config, but the fact that it needs so many comments makes you question if there is a better way to have such fine tuned configuration without the needed walls of comments to support each decision.

// excerpt from the creat-react-app's webpack config

    module.exports = {
      // You may want 'eval' instead if you prefer to see the compiled output in DevTools.
      // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.
      devtool: 'cheap-module-source-map',
      // These are the "entry points" to our application.
      // This means they will be the "root" imports that are included in JS bundle.
      // The first two entry points enable "hot" CSS and auto-refreshes for JS.
      entry: [
        // We ship a few polyfills by default:
        require.resolve('./polyfills'),
        // Include an alternative client for WebpackDevServer. A client's job is to
        // connect to WebpackDevServer by a socket and get notified about changes.
        // When you save a file, the client will either apply hot updates (in case
        // of CSS changes), or refresh the page (in case of JS changes). When you
        // make a syntax error, this client will display a syntax error overlay.
        // Note: instead of the default WebpackDevServer client, we use a custom one
        // to bring better experience for Create React App users. You can replace
        // the line below with these two lines if you prefer the stock client:
        // require.resolve('webpack-dev-server/client') + '?/',
        // require.resolve('webpack/hot/dev-server'),
        require.resolve('react-dev-utils/webpackHotDevClient'),
        // Finally, this is your app's code:
        paths.appIndexJs,
        // We include the app code last so that if there is a runtime error during
        // initialization, it doesn't blow up the WebpackDevServer client, and
        // changing JS code would still trigger a refresh.
      ],
      output: {
        // Add /* filename */ comments to generated require()s in the output.
        pathinfo: true,
        // This does not produce a real file. It's just the virtual path that is
        // served by WebpackDevServer in development. This is the JS bundle
        // containing code from all our entry points, and the Webpack runtime.
        filename: 'static/js/bundle.js',
        // There are also additional JS chunk files if you use code splitting.
        chunkFilename: 'static/js/[name].chunk.js',
        // This is the URL that app is served from. We use "/" in development.
        publicPath: publicPath,
        // Point sourcemap entries to original disk location (format as URL on Windows)
        devtoolModuleFilenameTemplate: info =>
          path.resolve(info.absoluteResourcePath).replace(/\\/g, '/'),
      },

      // ... there is so much more to this

The Webpack team is actively developing this project and doing their part to clear up the confusion around the config. A lot of the missing features that once needed a Webpack plugin are now included in the library itself, including tree-shaking, uglifying, and even web assembly (WASM) support. The well-written through documentation also helps to make this Webpack as a build tool more approachable and has been consistently maintained since the launch of Webpack 2 (Fall of 2016).

Webpack not only has a focus on module bundling, it includes code splitting as a built-in feature Code splitting is the practice of loading only the content that’s needed, when it is needed by leveraging separate page split bundles base usually on routing. This has the potentially to improve page load speed and the overall browsing experience. Code splitting does however come with a learning curver, one that I have personally not fully learned, but the Webpack team members are trying their best to flatten that curve with webpack.academy.

There are lots of community-built Webpack config boilerplates, including a pretty neat tool called Webpackbin. Webpackbin is a sandbox to build and configure Webpack examples. You can generate links from here which is nice when researching Webpack configurations, as authors tend to post their configs in the sandbox and provide the URL to share.

Webpack is working towards being the batteries included, but some parts sold separately build tool. Webpack can handle almost every concern you have when b web applications these days, but you will also likely need to read the manual (documentation) a lot to get it your build up and running to your liking.

Rollup

Advantage: Built-in features for package management
The catch: You’ll need to make sure your project has implemented the ES6 syntax
Ideal project: Projects looking to use slightly less configuration for the build process and already using the latest ESNext features like ES modules

Rollup is a module bundler for JavaScript which compiles small pieces of code into something larger and more complex. It uses the new the new version of JavaScript’s ES6 module system, instead of previous idiosyncratic solutions such as CommonJS and AMD, to perform the rollup (bundling) of your project. ES6 modules let you freely and seamlessly combine the most useful individual functions from your favorite libraries.

Getting started with Rollup can be done via the command line. Just point your index.js and provide a name for your bundled ouput.

npm install -D rollup
rollup index.js — o bundle.js — f iife

To save us from needing to constantly repeat the same commands, you have the option to add a rollup.config.js file, similar to what we saw in webpack. The same risks about config are just as valid in ght ejs

 // rollup.config.js
 export default {
   input: 'src/index.js',
   output: {
   file: 'bundle.js',
   format: ‘cjs’
 };

Rollup has gained more popularity with package and open source maintainers, because of built in features for package management as oppose web applications. Some of the features mirror what you could do with Universal Module Definition’s(UMD) and make Rollup a great bridge between the JavaScript’s UMD need and ES6 modules. Because ES6 is the hotness Rollup does not work with CommonJS required files without a plugin. This is only a limitation for older projects that have not yet implemented the ES6 syntax into their workflow. However if you are starting a new project, there is not much in the way of limitation for you.

As of the the Spring of 2017 all major browser support ES6 modules natively, which has Rollup now looking to claim a new competitive advantage as well. Rollup does come with native support native support for tree-shaking, with is the ability to remove unused code out of your project bundle, which you can see in this example from the rollup repl. This is valuable for projects looking for assistance where they can get it with page optimizations.

Though tree-shaking seems like a small feature, consider projects like Momentjs or lodash which are massive projects to begin with. Tree-shaking provides the ability to exclude all the parts of the library out of your bundle and only include the portion of the library you are using.

There is a lot more you can rollup besides trees, so I encourage you consult the Rollup guides for more information how you can leverage tree-shaking and other features in your next project.

Parcel

Advantage: Zero config needed
The catch: Newer project with less documentation to reference
Ideal project: Small projects and prototypes looking to get started quickly

Parcel came out at the end 2017 and gets the privilege of wrapping all the JavaScript points of configuration fatigue in a tiny little package. Parcel removes the complication of build tools and works out of the box with the most popular plugins in the JavaScript space, including babel transforms.

Similar to Browserify there’s also no config file, but there are also no Parcel-specific plugins. Parcel relies on existing JavaScript ecosystem projects like Babel to do the work. Parcel is only the orchestrator. You can also include Babel transforms and plugins in your package.json or .babelrc and Parcel will know to include it in the build process. There is no extra configuration needed which is a very intriguing feature. There is also no need to learn one more library to maintain your project (a.k.a the dreaded JavaScript fatigue).

Getting started with Parcel is similar to the others, but instead of providing an input and and output for the bundle, you just provide the entry in the script.

 npm install parcel-bundler
 parcel build index.js

Any other feature can be found in the documentation, but spoiler they require you to write modern JavaScript to do so. There is really no magic under the hood of this project. Take a look at this example for getting a React application running using Parcel. As mentioned this project is still fairly new but seems promising. There is already some great documentation available and a

Microbundle

Advantage: Zero config needed with an extremely small footprint
The catch: Newer project with less documentation to reference
Ideal project: Size conscious project looking to be shared as a plugin or addon for other projects

If you have not heard of Parcel, there is a chance you have not heard of Microbundle, the zero-configuration bundler for tiny modules. Microbundle is powered by the before-mentioned Rollup project and aims to take their module bundling to next level by removing the configuration step. Similar to Parcel, it will bundle your project using nothing but the package.json. So be sure to include all the necessary dependencies needed to run your JavaScript and bundle your assets.

 npm install microbundle
 microbundle

Microbundle will assume you have an index.js if no entry point is provided as an option. It will also create a bundle and minify that same file if no output is provided as well. Not only is bundled version created, a UMD version is also provided as part of the bundling process.

// index.js
function () {
  console.log(“Hello World”)
}
 
// microbundled into index.m.js
function O(){console.log(“FOOOOOOOOOO”)}O();
 
// microbundled into index.umd.js
!function(e,n){“object”==typeof exports&&”undefined”!=typeof module?     n():”function”==typeof define&&define.amd?define(n):n()}(0,function(){console.log(“FOOOOOOOOOO”)});

This could is useful for small shareable projects to be embedded into others. Thanks to this post I only now discovering this Microbundle but could see this being useful for the Netlify Identity Widget, which is a project meant to be embedded into larger projects and already being bundled manually into a UMD.

Now go build something

No matter your programming style there is a solution for you and choosing a build tool comes down to what kind of control you want. My attempt was to provide a progression from no configuration to a lot configuration. Despite the amount of choices, all build tools work with Netlify and can be a useful part of maintaining your application, so try a few and see which one works for you.

If you’re a big fan of a tool that was not listed here, please leave a comment and let me know.

{"source":"medium","postId":"8eca722b69b6","publishedDate":1521022259322,"url":"https://medium.com/netlify/comparing-modern-build-tools-8eca722b69b6"}

Things to fix

  1. Make the subheadings, extrabold text (like jason.af)
  2. Copy jason.af (connect with jason section)
  3. subscribe to email.

I have been using netlify and as of 2 weeks ago ago now work for them.

I have been using netlify and as of 2 weeks ago ago now work for them. I highly recommend trying them out and it’s a lot less steps.

$ npm install netlify-cli -g
$ cd my-site-folder
$ netlify deploy

The site will be deployed in minutes and it’s free. There are also options to enable SSL and custom DNS hosting as well.

Also if the command line is not your thing you can login via GitHub here, where you can deploy directly from a GitHub branch.

{"source":"medium","postId":"c12a8548e193","publishedDate":1465346071156,"url":"https://medium.com/@bdougie/i-have-been-using-netlify-and-as-of-2-weeks-ago-ago-now-work-for-them-c12a8548e193"}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.