I spent some time on this coding problem using hashes and for in (new to me) loops this morning. The solution works but do you have something cleaner / more efficient?
#100DaysOfCode
I'm using #vagrant for the first time. It was a bit difficult to wrap my head around it at first but now it makes sense!
#100DaysOfCode
I wrote a couple solutions for merging two sorted arrays in #javascript.
What do you think?
#100DaysOfCode
I learned how to cherry-pick commits today!
#100DaysOfCode
I watched this great @Dropbox talk about scaling. https://youtube.com/watch?v=PE4gwstWhmc
Any other coding talks I should check out?
#100DaysOfCode
Today I learned more about Git Flow and merging branches correctly. Heres a great article: https://medium.com/@muneebsajjad/git-flow-explained-quick-and-simple-7a753313572f
Do you use a tool like Fork for managing commits and branches?
#100DaysOfCode
Edited my first engineering podcast today! Hope to post it this week...
#100DaysOfCode
I kept getting the same type of comparing two array questions in technicals so I spent some time today figuring out a good hash solution. What do you think? https://github.com/TaylorOD/algo_practice/blob/master/javascript/containscommonitem/containscommonitem.js
#100DaysOfCode #javascript
https://dipo.org is live! I learned a lot about #css building this page.
#100DaysOfCode
Prepping for my #reactjs final tomorrow.
#100DaysOfCode
It's a code kicked my ass day. Two lessons learned: 1. Test your coding projects to make sure they work if you follow your readme before you turn them in. 2. I need to get better at deconstructing a problem I'm not immediately able to solve. Learning.
#100DaysOfCode
Deliberate Daily Practice in #JavaScript keeps my coding abilities sharp so I can perform well in technical interviews. I built a repo with practice questions: https://github.com/TaylorOD/Deliberate_Practice-JavaScript
I want to add .indexOf(), .includes(), .sort(), and .join() next.
#100DaysOfCode
Do you follow a system when asked a question in Technical Interviews? I've heard of things from DICE to a 15 point plan. I always try to make sure I understand the problem, have an example input, and then add Pseudocode while talking out loud.
#100DaysOfCode
I spent all day yesterday and a good chunk of the morning on a take-home coding challenge. There were plenty of frustrating moments but it feels great to overcome something difficult.
#100DaysOfCode
I learned how to use and work with the @media rule in #CSS! It's very helpful in building a responsive single-page app. Any other CSS tricks I should know?
#100DaysOfCode
I discovered the Syntax Podcast with @wesbos and @stolinski! Love the client vs server validation episode.
Any other #webdevelopment or #javascript podcasts I should be listening to?
#100DaysOfCode
Used Live Share in #VScode last night for the first time. It was pretty easy to get running. Anyone use another tool for paring/screen sharing while coding?
#100DaysOfCode
I discovered #canvas today and played around with it in #CSS and #javascript. Has any one used it for a project/product they can show me?
#100DaysOfCode
I spent 15-30 minutes every day last week drilling #javascript methods so I didn't get rusty during the holiday. It helped a lot when I got back to work this morning!
#100DaysOfCode
Some days it's the little things... I have finally memorized that Shift + Option + Down will duplicate a line of code in #vscode below the current line. So helpful.
#100DaysOfCode
What methods/functions do you use the most in JavaScript? I find myself using .forEach often but there are lots of options I'm unaware of.
#100DaysOfCode
Today I learned about console.table(). I started with Ruby so console.log() just seemed like a convoluted way to write p or puts. What other console.'s should I know?
#100DaysOfCode
I've been working with #CSS again to sure up some of the knowledge I learned when I first started coding again. I just used :root for the first time.
#100DaysOfCode
Big O. I'm working on wrapping my head around data structures and algorithms better and I'm just getting started. Any tips on how to keep O(n), O(n log n), O(log n), O(1), etc straight in your head?
#100DaysOfCode
Wow! I finally finished this fantastic #javascript course on #udemy. https://www.udemy.com/certificate/UC-7f638638-3af2-4b70-80e8-05837873e575/
It was incredibly helpful in helping me become comfortable with vanilla JavaScript. You can pick it up for $10 right now! https://www.udemy.com/course/modern-javascript/
#100DaysOfCode
Today I learned about Destructuring in #JavaScript. I feel like this will become more and more useful as applications become more complicated.
#100DaysOfCode
Rest Parameters!?! So useful. It makes it much easier to take large sets of arguments into my functions in #JavaScript.
#100DaysOfCode
I've been working with #CSS today and pulling out the pieces I need from a theme rather than linking to the entire thing. Who are the CSS wizards who make these things???
#100DaysOfCode
Background Dev music is very important when taking on a multi-hour coding assessment.
https://open.spotify.com/album/3oVKqk9TahxvHpFIUlAEuJ?si=ZC_WnDbfSluwEm5e-O3UmA
#100DaysOfCode
Refactoring another #javascript app today to use webpack. Modern JavaScript is so complex! I wonder what it will look like in 5 years. Until then import...
#100DaysOfCode
It's a windy one here in Chicago! I'm working on integrating a weather #api in my app that helps people stay in touch. On a day like today, it would not recommend taking a walk with a friend.
#100DaysOfCode
Today I learned the difference between dependencies and devDependencies in a package.json file. It's one of those things I never thought about until I said, "Huh... Why does ESLint go down here?"
#100DaysOfCode
Code has been kicking my butt the last few days. I struggled to get a working C# setup in #vscode, battled with #vuenative and #cordova, and have been wrapping my head around #Webpack. Pushing through!
#100DaysOfCode
Today I learned about using Babel and Webpack. I have a large #JavaScript project I want to work correctly on browsers other than Chrome.
#100DaysOfCode
Today I learned about Scripts in package.json file. I wish I knew this a few weeks ago. Saves a lot of time haha
#100DaysOfCode
Last week I deployed a few static apps using @netlify. Today I'm deploying a larger #rails and #vue app using @heroku to my own domain... Fingers Crossed.
#100DaysOfCode
I've been getting in the habit of using branches in @github and #Git. It's a little slower when I'm coding alone but it makes it easier to track my code on longer projects.
#100DaysOfCode
Working on integrating @twilio into a #rails and #vue app. So cool to see SMS working correctly after a couple hours of work!
#100DaysOfCode
#100DaysOfCode
I worked on pushing two #javascript sites out today using Netlify and Surge. They are both great options to get simple projects online. I like Surge a bit better because it can all be done in the command line.
#100DaysOfCode
I missed yesterday because I was working the polls in #Chicago. Today it is easy to refresh the news over and over but I WILL FINISH MY #JAVASCRIPT PROJECT! Just a little more #CSS before it's ready to push to #heroku
#100DaysOfCode
I was styling two #javascript apps I built recently when I discovered to use .classList.add("") to add a class to a generated item. Makes it much easier to style everything!
#100DaysOfCode #HTML5 #CSS
A few days ago I mentioned my first open-source pull request accepted. I had 3 others accepted and qualified for a prize with Hacktoberfest 2020. (On the last day!)
Thanks @digitalocean!
#100DaysOfCode #Hacktoberfest2020
I've officially made it. A recruiter from Amazon reached out to me about a SWD role! Time to get started on the algo practice... Jokes aside I finally cemented Bubblesort in my brain after several attempts over the last few weeks!
#100daysofcode
My first pull request merged on an open-source project today. I've worked on other projects but not one where I didn't know the creator. It was a bit scary but exciting to see that my code had been accepted and to be added to the contributor's list!
#100DaysOfCode
I finished a coding assessment in C# this morning! I haven't touched the language before so it was interesting to say the least. Reminds me of my start in recruiting when I was only working on C#, http://ASP.NET MVC roles.
#100DaysOfCode
I found about the Fetch API in #JavaScript and I have been replacing .open and .send requests with Fetch to try it out. It works much better with Promises!
#100DaysOfCode
Today I've been working with Promises in #JavaScript. I haven't needed to use them until recently so I decided to dig in and explore them more.
#100DaysOfCode
I've been working on a #javascript project from a month ago that used traditional functions. I've been replacing them with arrow functions and using the arrow function return shortcut where I can.
#100DaysOfCode
Working with the #Mapbox api today on a #vue app. They have incredible #vue documentation. It's better than a lot of the documentation I see for most #javascript projects.
#100DaysOfCode
I've been implementing an #API into a #javascript application I built and just discovered the Network tab in the #Chrome Dev Tools. I can't believe I didn't know about this before. Really helpful when tracking what #http requests are being made.
#100DaysOfCode
I was messing around with a new #rubyonrails app and was struggling with my seeds file. I remembered that I need to add ! after create to make sure it crashes and gives errors so I could debug it.
#100DaysOfCode
Today I worked on refactoring an app I'd previously written in #javascript with Class syntax. It's much cleaner and all my functions are easier to read.
#100DaysOfCode
Building a #VueJS front end for a blog #Rails app I wrote a while back. I've never tried to throw #Bootstrap and a theme into Vue before! Crossed fingers
#100DaysOfCode
I've been working on building a simple hangman game in #javascript. I did something similar in #ruby a few months ago so it's interesting to see how each language treats classes/objects.
#100DaysOfCode
Today I'm learning about prototypal inheritance in JavaScript. It's a bit different than in Ruby on Rails so it's been fun to tackle. I like using JavaScript for something outside of the browser.
#100DaysOfCode #javaScript #react
I'm publicly committing to the 100DaysOfCode Challenge starting today! Learn More and Join me! https://100DaysOfCode.com #100DaysOfCode
#100DaysOfCode
Today I learned that when building a Vue app your .vue files will almost always consist of:
<template>
<script>
<style>
Today I learned about CSS styleing. The * selector in a CSS file will be applied to everything in the document.
* {
color: red;
}
Today I learned about closure in JavaScript. I've been using it with async code recently.
const createTipper = (tip) => {
return (total) => {
return tip * total
}
}
const tip25 = createTipper(.25)
console.log(tip25(10))
Today I learned I can code and watch UFC at the same time! Built two crud functions for a new project while watching UFC 254!
Today I learned about the Subclass syntax in JavaScript. Similar to Rails inheritance it allows you to create a class that shares some of the properties of an existing class but you can also give it new properties that only that subclass will have.
class Person {
constructor (firstName, lastName) {
this.firstName = firstName
this.lastName = lastName
}
}
class Employee extends Person {
constructor (firstName, lastName, title) {
super(firstName, lastName)
this.title = title
}
}
Today I learned Class syntax in JavaScript. It is consitered to be clearner than other using the prototype object syntax.
class Hangman {
constructor(word, allowedGuesses) {
this.word = word.toLowerCase().split("");
this.allowedGuesses = allowedGuesses;
this.guessedLetters = [];
this.status = "playing";
}
getPuzzle() {
let puzzle = "";
this.word.forEach((letter) => {
if (this.guessedLetters.includes(letter) || letter === " ") {
puzzle += letter;
} else {
puzzle += "*";
}
});
return puzzle;
}
Rather than:
const Hangman = function (word, allowedGuesses) {
this.word = word.toLowerCase().split("");
this.allowedGuesses = allowedGuesses;
this.guessedLetters = [];
this.status = "playing";
};
Hangman.prototype.getPuzzle = function () {
let puzzle = "";
this.word.forEach((letter) => {
if (this.guessedLetters.includes(letter) || letter === " ") {
puzzle += letter;
} else {
puzzle += "*";
}
return puzzle;
};
Today I learned about OOP and prototypal inheritance in JavaScript.
const Person = function (firstName, lastName, age) {
this.firstName = firstName
this.lastName = lastName
this.age = age
}
Person.prototype.getBio = function () {
return `${this.firstName} is ${this.age}.`
}
const me = new Person("Taylor", "Dorsett", 28)
console.log(me.getBio())
Today I learned about the .split function in JavaScript
let word = "hello"
let splitWord = word.split("")
Today I learned about type coercion in JavaScript.
const value = false + 12
console.log(value)
is 12.
const value = true + 12
console.log(value)
is 13 because true becomes 1 and false becomes zero.
Today I learned about truthy and falsy.
if (todo !== undefined) {
todo.completed = !todo.completed
}
becomes
if (todo) {
todo.completed = !todo.completed
}
Today I learned about arrow functions in JavaScript. Best used with one line functions that return something. You do not need to use curly brackets.
const square = (num) => num * num
Today I learned about catching and throwing errors in JavaScript.
const gradeCalc = function (studentScore, maxScore) {
if (typeof studentScore !== "number" || typeof maxScore !== "number") {
throw Error("Inputs must both be numbers!")
}
const studentGrade = (studentScore / maxScore) * 100
let letterGrade = ""
if (studentGrade >= 90) {
letterGrade = "A"
} else if (studentGrade >= 80) {
letterGrade = "B"
} else if (studentGrade >= 70) {
letterGrade = "C"
} else if (studentGrade >= 60) {
letterGrade = "D"
} else {
letterGrade = "F"
}
return (`You got an ${letterGrade}. (${studentGrade}%)`)
}
try {
const result = gradeCalc("purple", 100)
console.log(result)
} catch (e) {
console.log(e.message)
}
Today I learned about JavaScripts strict mode. It prevents some issues like leaked vars.
"use strict"
let data = ""
const processData = () => {
data = "13123123"
}
processData()
console.log(data)
runs while
"use strict"
const processData = () => {
data = "13123123"
}
processData()
console.log(data)
does not.
Today I learned how to display dates in JavaScript.
const now = new Date("January 21 2001 6:25:01")
const timestamp = now.getTime()
console.log(`Year: ${now.getFullYear()}`)
console.log(`Month: ${now.getMonth()}`)
console.log(`Day of month: ${now.getDate()}`)
console.log(`Hour: ${now.getHours()}`)
console.log(`Minutes: ${now.getMinutes()}`)
console.log(`Seconds: ${now.getSeconds()}`)
Today I learned about the !! shortcut in the terminal. I use it when I have a permission issue and need to run sudo.
sudo !!
Today I learned the window function in JavaScript. This can allow you to sync data across multiple pages.
window.addEventListener("storage", function (e) {
if (e.key === "notes") {
notes = JSON.parse(e.newValue)
renderNotes(notes, filters)
}
})
Today I learned how to use UUID to generate unique ID's using JavaScript.
In your html file:
<script src="https://unpkg.com/uuid@latest/dist/umd/uuidv4.min.js"></script>
In your JavaScript file:
todos.push({
id: uuidv4(),
text: e.target.elements.text.value,
completed: false,
})
Today I learned about displaying in Vue.js. If you create a div with a ID that Vue.js calls, anything you include in {{ }} will run.
<div id="vue">
<h1> {{name}} </h1>
</div>
Name is definded in your JavaScript/Vue file.
Today I learned about the defer attribute in JavaScript/HTML. If you write defer along with your script tag it will not run until the rest of the document is loaded.
<script src="index.js" defer></script>
Today I learned about /* global blank */ which will tell your ESLint to calm down.
/* global Vue */
var app = new Vue({
})
Today I learned about debugger. You can use debugger in your JavaScript code to see more details about your app and use the console in your browser. This also pauses the code so you can find out where the issue is in your code.
Today I learned refactoring code means changing the code so it is cleaner, more efficient, is organized in another way, but functionally runs the same.
Today I was able to finish my first problem on algoexpert.io which has been a goal since I started programming. I finished the Two Number Sum question and had to learn how to check if my result array was empty to do so.
Today I learned how to make a checkbox in JavaScript.
<label>
Show compleated todos: <input id="completed-checkbox" type="checkbox">
</label>
Today I learned how to set up a dropdown menu in JavaScript.
<select id="filter-by">
<option value="byEdited">Sort By Last Edited</option>
<option value="byCreated">Sort By Recently Created</option>
<option value="alphabetical">Sort Alphabetically</option>
</select>
Today I learned that if your email in git or github is incorrect your profile will not show any of the commits you make from your terminal.
Today I learned how to use the input tag in JavaScript.
<input type="text">
Gives you a box that users can input text into while,
<input type="password">
gives you a password box.
Today I learned editing text using .target in JavaScript.
document.querySelector("button").addEventListener("click", function(e) {
e.target.textContent = "Added Todo"
})
This allows one to change the text of a button after it has been pressed by the user.
Today I learned about using .addEventListener in JavaScript. This allows you to interact with the user in the broswer.
document.querySelector("button").addEventListener("click", function() {
console.log("the user clicked")
})
Today I learned how to load JavaScript into an HTML file using a <script> tag.
<script src="notes_app.js"></script>
This is will call the notes_app.js file.
Today I learned create actions in HTML require building a #new route to build a form and then a #create action to actually create the photo.
Today I learned how to use Live Server. It allows you to host html and other docutments and will auto update when you save your file. It is a simple and easy way to get JavaScript in your local browser.
Today I learned about the Bypass Paywalls Chrome Extention on Github. You can check it out here: https://github.com/iamadamdev/bypass-paywalls-chrome
After downloading and unzipping the folder all you have to do to install is go to your Chrome Extentions and enable Developer Mode. Then drag the folder to your Chrome Extentions page and it will load and work right away!
Of course please support journalism whenever you can.
Today I learned how to set up my blog quickly and easily using Jekyll. There is a great tutorial here: https://www.smashingmagazine.com/2014/08/build-blog-jekyll-github-pages/
You can find my blog at taylordorsett.com
Today I learned how to search an array in JavaScript for the index of an item using indexOf().
const notes = ["Note 1", "Note 2", "Note 3"]
console.log(notes.indexOf("Note 2"))
This will return 1 in the console.
Today I learned that the human brain takes up only 2% of human body weight but uses 20% of its energy. Thanks Snapple facts!
Today I learned about join tables. You can build a join table when the has_many and belongs_to relationship involves multiple ID's. This allows you to associate things that would otherwise be difficult or restrictive.
Today I learned about before_actions in Ruby.
before_action :authenticate_admin, except: [:index, :show]
If you write the method authenticate_admin in your app contoller this allows you to select what you are allowing users and admins to do in your app.
Today I learned about creating array's in JavaScript.
const notes = ["note 1", "note 2", "note 3"]
let books = ["Book 1", "Book 2", "Book 3"]
Today I learned about terminal aliases
code ~/.bash_profile
alias clr="clear"
Today I learned about const in JavaScript. This allows you to create a variable that cannot be changed. This improves code readability.
const isRaining = true
isRaining = false // This code will not change isRaining to false and will cause an error when run
console.log(isRaining
Today I learned about Math in JavaScript.
let num = 105.9073
console.log(Math.round(num))
console.log(Math.floor(num))
console.log(Math.ceil(num))
Today I learned about built in JavaScript methods like .toUpperCase and .length
let name = "Taylor Dorsett"
console.log(name.length)
console.log(name.toUpperCase())
Today I learned you can write functions within JavaScript objects.
let resturant = {
name: "Half Sour",
guestCapacity: 75,
guestCount: 0,
checkAvailability: function (partySize) {
let seatsLeft = this.guestCapacity = this.guestCount
return partySize <= seatsLeft
}
}
Today I learned about changing data in objects in JavaScript.
let myBank = {
name: "Taylor Dorsett,
balance: 356
}
myBank.balance = 1000000
console.log(myBank)
Today I learned that no mater how many games of tennis I play with my Partner I will never win.
while true
taylor_win_tennis = false
end
Today I learned about REST naming conventions
"/photos" => "photos#index"
display a list of all photos - All REST API's should be the same.
Today I learned about datebase migrations and change comands in Ruby
def change
change_column :products, :price, :integer
end
Today I learned about Validation in Ruby
class User < ActiveRecord::Base
validates :name, :unquicness => true
end
Today I learned about template strings
let name = "Robert"
let age = 29
console.log(`I have a friend named ${name} who is ${age}.`)
This is similar to interpolation in Ruby.
Today I learned about default arguments in JavaScript
let getScoreText = function (name, score) {
console.log(name)
console.log(score)
}
getScoreText()
returns undefined twice while
let getScoreText = function (name, score = 0) {
console.log(name)
console.log(score)
}
getScoreText()
returns undefined and 0.
Today I learned the nothingness of a black hole generates a sound in the key of B flat.
Thanks Snapple Facts!
Today I learned about Global and Local scope in JavaScript
let name = "Taylor"
if (true) {
let name = "Dorsett"
console.log(name)
// Dorsett is printed
Today I learned about responsive HTML templates that are easy and free to use.
https://html5up.net/
Today I learned that github will host one page for you for free at .github.io
taylorod.github.io
Today I learned JavaScript uses dot notion when calling objects.
console.log(`${myBook.title} by ${myBook.author}`)
Today I learned not to post my API key's on Github and how to put my API Key in my bash profile.
export OPEN_WEATHER_API_KEY= api key
Today I learned about Inheritance in Classes.
class Employees
class Manager < Employee
Today I learned how to check what version of a programming language you have installed
# list whatever language you want to check
node -v
Today I learned how to initialize Git and have it push to a GitHub Repository
git init
git add --all
git commit -m "commit message"
Today I learned about ruby's .each method
numbers = [1, 3, 4]
numbers.each do |number|
puts number
end