Ubuntu Mouse scroll mischief

I’ve been having the weirdest luck with using a mouse with my Ubuntu 16.04 development system. I switched mice, moved to different USB ports (nope, no wireless mouse here)  and depending where I’m working (Online OneNote in Firefox or VSCode) if I was scrolling and made the mistake of clicking the scroll ever so slightly, the clipboard would paste into the text I was in.  If I caught it,  I’d chalk it up to user error and keep going. This time, I didn’t notice it right away, until I went to run a program and I kept getting line errors like drone2 is already defined.

I would go to the line number, change it and re-run. Only to have the same error on another line. After the third time, I looked at the file and to my surprise, there were now over 65000 lines of code. I’d pasted the same code over and over and over and didn’t even notice it.

To fix the issue, there is a utility for modifying keys and pointer button mappings called, Xmodmap. I googled around to find the correct combination that worked for me and after a few tries, I found it.

In the root of your home directory, look for a file called .Xmodmap, if it’s there you edit it. If not, create the file and add the following (your mileage may vary)

Screen print of command line echo statement

echo the setting into the .Xmodmap file in your home directory

Logout and log back in and text it out. Eureka! I thought I was going mad for a minute, then I had to put on my sleuthing hat (as all Linux and dev folks do on a daily basis) and figured it out.

Advertisements

My First Node.js App

Screenprint of App

Here are the instructions for my 1st Node app.

My repo
# LIRI Bot

### Overview

In this assignment, you will make LIRI. LIRI is like iPhone’s SIRI. However, while SIRI is a Speech Interpretation and Recognition Interface, LIRI is a _Language_ Interpretation and Recognition Interface. LIRI will be a command line node app that takes in parameters and gives you back data.

### Before You Begin

1. LIRI will display your latest tweets. As we do not want to display your personal account, or its keys, please make an alias account and add a few tweets to it!

2. Make a new GitHub repository called liri-node-app and clone it to your computer.

3. To retrieve the data that will power this app, you’ll need to send requests to the Twitter, Spotify and OMDB APIs. You’ll find these Node packages crucial for your assignment.

* [Twitter](https://www.npmjs.com/package/twitter)

* [Node-Spotify-API](https://www.npmjs.com/package/node-spotify-api)

* [Request](https://www.npmjs.com/package/request)

* You’ll use Request to grab data from the [OMDB API](http://www.omdbapi.com).

* [DotEnv](https://www.npmjs.com/package/dotenv)

### Submission on BCS

* Please submit the link to the Github Repository!

### Instructions

1. Navigate to the root of your project and run `npm init -y` — this will initialize a `package.json` file for your project. The `package.json` file is required for installing third party npm packages and saving their version numbers. If you fail to initialize a `package.json` file, it will be troublesome, and at times almost impossible for anyone else to run your code after cloning your project.

2. Make a .gitignore file and add the following lines to it. This will tell git not to track these files, and thus they won’t be committed to Github.

“`
node_modules
.DS_Store
.env
“`

3. Make a JavaScript file named `keys.js`.

* Inside keys.js your file will look like this:

“`js
console.log(‘this is loaded’);

exports.twitter = {
consumer_key: process.env.TWITTER_CONSUMER_KEY,
consumer_secret: process.env.TWITTER_CONSUMER_SECRET,
access_token_key: process.env.TWITTER_ACCESS_TOKEN_KEY,
access_token_secret: process.env.TWITTER_ACCESS_TOKEN_SECRET
};

exports.spotify = {
id: process.env.SPOTIFY_ID,
secret: process.env.SPOTIFY_SECRET
};
“`

4. Next, create a file named `.env`, add the following to it, replacing the values with your API keys (no quotes) once you have them:

“`js
# Spotify API keys

SPOTIFY_ID=your-spotify-id
SPOTIFY_SECRET=your-spotify-secret

# Twitter API keys

TWITTER_CONSUMER_KEY=your-twitter-consumer-key
TWITTER_CONSUMER_SECRET=your-twitter-consumer-secret
TWITTER_ACCESS_TOKEN_KEY=your-access-token-key
TWITTER_ACCESS_TOKEN_SECRET=your-twitter-access-token-secret

“`

* This file will be used by the `dotenv` package to set what are known as environment variables to the global `process.env` object in node. These are values that are meant to be specific to the computer that node is running on, and since we are gitignoring this file, they won’t be pushed to github — keeping our API key information private.

* If someone wanted to clone your app from github and run it themselves, they would need to supply their own `.env` file for it to work.

5. Get your Twitter API keys by following these steps:

* Step One: Visit

* Step Two: Fill out the form with dummy data. Type `http://google.com` in the Website input. Don’t fill out the Callback URL input. Then submit the form.

* Step Three: On the next screen, click the Keys and Access Tokens tab to get your consume key and secret.

* Copy and paste them into your .env file, replacing the `your-twitter-consumer-key` and `your-twitter-consumer-secret` placeholders.

* Step Four: At the bottom of the page, click the `Create my access token` button to get your access token key and secret.

* Copy the access token key and secret displayed at the bottom of the next screen. Paste them into your .env file, replacing the placeholders for `your-twitter-access-token-key` and `your-twitter-access-token-secret`.

6. Make a file called `random.txt`.

* Inside of `random.txt` put the following in with no extra characters or white space:

* spotify-this-song,”This is America”

7. Make a JavaScript file named `liri.js`.

8. At the top of the `liri.js` file, add code to read and set any environment variables with the dotenv package:

“`js
require(“dotenv”).config();
“`

9. Add the code required to import the `keys.js` file and store it in a variable.

* You should then be able to access your keys information like so

“`js
var spotify = new Spotify(keys.spotify);
var client = new Twitter(keys.twitter);
“`

10. Make it so liri.js can take in one of the following commands:

* `my-tweets`

* `spotify-this-song`

* `movie-this`

* `do-what-it-says`

### What Each Command Should Do

1. `node liri.js my-tweets`

* This will show your last 20 tweets and when they were created at in your terminal/bash window.

2. `node liri.js spotify-this-song ”`

* This will show the following information about the song in your terminal/bash window

* Artist(s)

* The song’s name

* A preview link of the song from Spotify

* The album that the song is from

* If no song is provided then your program will default to “Apeshit” by The Carters.

* You will utilize the [node-spotify-api](https://www.npmjs.com/package/node-spotify-api) package in order to retrieve song information from the Spotify API.

* Like the Twitter API, the Spotify API requires you sign up as a developer to generate the necessary credentials. You can follow these steps in order to generate a **client id** and **client secret**:

* Step One: Visit

* Step Two: Either login to your existing Spotify account or create a new one (a free account is fine) and log in.

* Step Three: Once logged in, navigate to to register a new application to be used with the Spotify API. You can fill in whatever you’d like for these fields. When finished, click the “complete” button.

* Step Four: On the next screen, scroll down to where you see your client id and client secret. Copy these values down somewhere, you’ll need them to use the Spotify API and the [node-spotify-api package](https://www.npmjs.com/package/node-spotify-api).

3. `node liri.js movie-this ”`

* This will output the following information to your terminal/bash window:

“`
* Title of the movie.
* Year the movie came out.
* IMDB Rating of the movie.
* Rotten Tomatoes Rating of the movie.
* Country where the movie was produced.
* Language of the movie.
* Plot of the movie.
* Actors in the movie.
“`

* If the user doesn’t type a movie in, the program will output data for the movie ‘Mr. Nobody.’

* You’ll use the request package to retrieve data from the OMDB API. Like all of the in-class activities, the OMDB API requires an API key.

4. `node liri.js do-what-it-says`

* Using the `fs` Node package, LIRI will take the text inside of random.txt and then use it to call one of LIRI’s commands.

* It should run `spotify-this-song` for “This is American,” as follows the text in `random.txt`.

* Feel free to change the text in that document to test out the feature for other commands.

### BONUS

* In addition to logging the data to your terminal/bash window, output the data to a .txt file called `log.txt`.

* Make sure you append each command you run to the `log.txt` file.

* Do not overwrite your file each time you run a command.

Me and my big mouth: I’m doing #100daysofCode again

The Sunday CodeNewbie chat are filled with inspiring tweets of progress, reflection, accomplishment and jokes from Cliff. I always look forward to it and I regret missing it. Today, Marshall said he’d like to connect to other codenewbies and work through the challenge together.

I love a good community-driven challenge, so I said, WHY NOT! Then Cliff and Nabheet said they’d join in as well and there you have, the fantastic 4 jumping into the #100daysofCode Challenge again, but this time, together!

I’m going to be the Human Torch, because Michael Bae Jordan, DUH!

WordPress on AWS MeetUp

I was invited to Philly ‘burbs WordPress meetup to give a talk about how to install WP on AWS. I’d given this talk before in an impromptu setting, my dining room table, to my monthly coding group. It was more of a workshop, really hands on and at the end, everyone was a command-line hero in my book. Most, never having logged into a Linux server before, let alone deploying a server in the cloud.

Speaker gesturing towards monitor

Photo Cred: @accessamy

Liam, the group leader, saw a tweet about it and invited me to present it to his group. Here are the videos and the slide deck from the MeetUp.

WordPress on AWS Part 1:
https://youtu.be/e3GaqR0r7Os
WordPress on AWS Part 2
https://youtu.be/CCZPKvHvYlU
WordPress on AWS Part 3
https://youtu.be/ksVu2YbMLeg
Slides:
https://bit.ly/2qkuvEN

 

 

 

So long to Colorstock

I just got an email that Colorstock is shutting down on March 31st. If you didn’t know, Colorstock was a site that curated stock photos featuring woman of color in tech. Since 2015, they’ve offered royalty-free stock photography under the Creative Commons License. These photos filled a void for writers and content makers to offer diversity in the images they published.  As the sun sets on this much needed service, we bid them adieu and wish them well. We can still access their photo album on Flikr.

 

All photos are by Women Of Color in Tech licensed under the CC 2.0

Lorem Ipsum 2.0

As as you’re building your website, you’re going to need some filler images and content to make the site look like a ‘real’ site. Seeing how image sizing and the text wraps on a page helps you make better styling decisions.  Gone are the days of boring Latin text that your eyes can’t glide across without making grammatical correction in your head. I bring you my favorite lorem ipsum text generators.

Bob Ross

giphy1

Barack Obama

obama

Jules from Pulp Fiction

giphy2

Beyonce’

The Wire

 

giphy

 

DJ Khaled

DJ Khaled

The Best Placeholder site on the Internet: Beyonce’

Scott Hansleman did a blog post on “The Internet’s Best Placeholder Image Sites for Web Development“, years ago, but I guess the best placeholder image site hadn’t been created yet. Well, here you are ladies and gentlemen, I give you, Beyonce!

http://placebeyonce.com/

Beyonce
BeyonceBeyonceBeyonce

Thanks, Chris!

Now, go forth and put Bey wherever you need her!

Oh, and here are a few more.

https://picsum.photos/

https://fakeimg.pl/