#100DaysOfCode Round 4

šŸ‘‘ Round 4 Projects šŸ‘‘

Hightlights from this round:

All projects:

R4 Day 100: 2021-09-08 Wednesday

Last day of code! Poked around on codewars

R4 Day 99: 2021-09-07 Tuesday

Codewars, learning list comprehension!

R4 Day 98: 2021-09-06 Monday

Played with some python and file reading lines

R4 Day 97: 2021-09-05 Sunday

Reviewing some python code :)

R4 Day 96: 2021-09-04 Saturday

Javascript 30 Day 13 How to copy JS arrays and objects

R4 Day 95: 2021-09-03 Friday

Skip

R4 Day 94: 2021-09-02 Thursday

Tried running a prior university project on my Mac, but everything is so out-of-date and broken.

R4 Day 93: 2021-09-01 Wednesday

Skip

R4 Day 92: 2021-08-31 Tuesday

Update styles for mobile and add robots.txt. Good default:

User-agent: *
Allow: /

R4 Day 91: 2021-08-30 Monday

Skip

R4 Day 90: 2021-08-29 Sunday

Skip

R4 Day 89: 2021-08-28 Saturday

Check Lighthouse scores

Actionable:

Updated score: (at least all green)

R4 Day 88: 2021-08-27 Friday

Modified table styles to be responsive on mobile.

R4 Day 87: 2021-08-26 Thursday

Update Copy button to copy the fake shortened link to clipboard

R4 Day 86: 2021-08-25 Wednesday

Build dynamic rows in table for shortened links and create more dynamic (fake) link shortener.

R4 Day 85: 2021-08-24 Tuesday

Styling for mobile menu, transitions and SVG image, and fix ARIA

R4 Day 84: 2021-08-23 Monday

JavaScript for mobile menu toggle

R4 Day 83: 2021-08-22 Sunday

Styling tweaks for FED project #3.

Still to do:

R4 Day 82: 2021-08-21 Saturday

Working on FED project #3. Styled hero background to be better for mobile and desktop; updated URL shortener to include (faked-in) result if the link given in valid. Spacing between table rows (given a different background color) is kind of difficult actually. Ended up using a border top for tr + tr.

R4 Day 81: 2021-08-20 Friday

Added form validation for the URL box using PristineJS validation library. Added alert colors to base theme & FED project #3, generated with https://colors.eva.design/.

R4 Day 80: 2021-08-19 Thursday

Skip

R4 Day 79: 2021-08-18 Wednesday

Try out Storybook with Jigsaw (no-go); Try out responsively for Chrome

R4 Day 78: 2021-08-17 Tuesday

Setup JavaScript to use in the project #3

R4 Day 77: 2021-08-16 Monday

Skip

R4 Day 76: 2021-08-15 Sunday

FED Project #3, card designs

R4 Day 75: 2021-08-14 Saturday

FED Project #3, font styles

R4 Day 74: 2021-08-13 Friday

Styling the form and more of project 3. Instead of using offset margins and padding for the off-centered look of the form, I used a 50%/50% linear background.

.cta-form {
  background:linear-gradient(to bottom, $color-white, $color-white 50%, $color-gray-light 50%);
}

R4 Day 73: 2021-08-12 Thursday

Sass variables, like all Sass identifiers, treat hyphens and underscores as identical. This means that $font-size and $font_size both refer to the same variable.

Restructuring projects 1-3 using !default; reduces repeating code and overrides.

Original:

File Size
/js/main.js 10.9 KiB
css/main.css 6.74 KiB
css/proj01.css 7.38 KiB
css/proj02.css 8.35 KiB
css/proj03.css 9.36 KiB

Updated compiled sizes after restructure:

File Size
/js/main.js 10.9 KiB
css/main.css 6.34 KiB
css/proj01.css 6.79 KiB
css/proj02.css 7.72 KiB
css/proj03.css 8.52 KiB

R4 Day 72: 2021-08-11 Wednesday

Skip

R4 Day 71: 2021-08-10 Tuesday

Read up on the scss !default usage. Will try to reorder my base theme after my child themes to see if this helps reduce redundancy.

R4 Day 70: 2021-08-09 Monday

Building out HTML and some more base styles (padding, menu, forms) https://virtual.github.io/fed-projects/03/

R4 Day 69: 2021-08-08 Sunday

Start FED Project #3; going a little more complex now that I have a standard base theme figured out with overrides. More things to add the base core will become apparent like list styles, menu things. :)

R4 Day 68: 2021-08-07 Saturday

Finished FED Project #2; added flexbox mixins to the base SCSS core (pretty easy!); refactored base to a ā€˜baseā€™ folder to cleanup the structure a little.

R4 Day 67: 2021-08-06 Friday

Setup and worked on FED Project #2

R4 Day 66: 2021-08-05 Thursday

Learning Go (Googleā€™s machine learning language) on SoloLearn app

R4 Day 65: 2021-08-04 Wednesday

Skip

R4 Day 64: 2021-08-03 Tuesday

Set up FED projects to allow for theme / scss variable overrides in order to maintain one general base code and themes that can override it.

proj01.scss:

@import './variables';
@import './01/variables';

// General includes
@import './structure';
@import './colors';
@import './typography';
@import './lists';

@import './components/buttons';

// Local overrides
@import './01/structure';
@import './01/colors';
@import './01/components/cards';
@import './01/components/buttons';

R4 Day 63: 2021-08-02 Monday

Skip

R4 Day 62: 2021-08-01 Sunday

Worked on building out more columns, margin, and theme classes (similar to Bootstrap) using scss for loops.

$marginbuffers: 5;
@for $i from 0 through $marginbuffers {
  .my-#{$i} {
    margin-top: $i * ($theme-font-size-base * .5);
    margin-bottom: $i * ($theme-font-size-base * .5);
  }
  .mt-#{$i} {
    margin-top: $i * ($theme-font-size-base * .5);
  }
  .mb-#{$i} {
    margin-bottom: $i * ($theme-font-size-base * .5);
  }
}

R4 Day 61: 2021-07-31 Saturday

Worked on FED Project #1

R4 Day 60: 2021-07-30 Friday

Read Code Complete pp 86-94; inheritance, abstraction

R4 Day 59: 2021-07-29 Thursday

Skip

R4 Day 58: 2021-07-28 Wednesday

Skip

R4 Day 57: 2021-07-27 Tuesday

Skip

R4 Day 56: 2021-07-26 Monday

Got stylelint working with some third-party packages

package.json:

{
  "name": "code",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "stylelint": "^13.13.1", 
    "stylelint-declaration-block-no-ignored-properties": "^2.4.0",
    "stylelint-config-rational-order": "Allohamora/stylelint-config-rational-order#master",
    "stylelint-order": "^2.2.1",
    "stylelint-scss": "^3.20.1"
  }
}

.stylelintrc.json:

{
  "plugins": [
    "stylelint-order", 
    "stylelint-config-rational-order/plugin",
    "stylelint-declaration-block-no-ignored-properties"
  ],
  "rules": {
    "order/properties-order": [[], { "severity": "warning" }], 
    "order/order": [
			"custom-properties",
			"declarations"
		],
    "plugin/rational-order": [true, {
      "border-in-box-model": false,
      "empty-line-between-groups": false,
      "severity": "warning"
    }],
    "declaration-no-important": true,
    "plugin/declaration-block-no-ignored-properties": true
  } 
}

R4 Day 55: 2021-07-25 Sunday

Working on setting up my styelint for a computer but it turns out thereā€™s some issues with this package not being updated for sometime: stylelint-config-rational-order; need to find a new way to accomplish it, due to security vulnerabilities on these packages.

Quick update to add border-radius; if you have an outer parent with a border radius, you can use overflow: hidden to give all the child elements the same border-radius. Never quite thought that through :)

R4 Day 54: 2021-07-24 Saturday

Updated scss to use some functions

R4 Day 53: 2021-07-23 Friday

Setup some styles and HTML for a small project.

R4 Day 52: 2021-07-22 Thursday

Set up a second page in jigsaw

R4 Day 51: 2021-07-21 Wednesday

Not exactly coding; spent the evening trying to figure out mic recording and processing tracks on reaper

R4 Day 50: 2021-07-20 Tuesday

Setup a local environment for working on front-end projects

R4 Day 49: 2021-07-19 Monday

Skipped

R4 Day 48: 2021-07-18 Sunday

JavaScript30, project 12, key sequence detection (like the Konami code used on buzzfeed) pretty magical!

R4 Day 47: 2021-07-17 Saturday

Code Complete, pp 74-86

R4 Day 46: 2021-07-16 Friday

Finished JavaScript 30 project 11 with custom video controls.

R4 Day 45: 2021-07-15 Thursday

Worked more on JavaScript 30 project #11. Reminder about how cool .dataset.myitem is to pull any items that have an attribute like data-myitem

R4 Day 44: 2021-07-14 Wednesday

Skip

R4 Day 43: 2021-07-13 Tuesday

Started project 11, video player. Seems like thereā€™s a feature/bug that the video will automatically start/stop on click without an event listener for video.click (so basically if you listen for it, youā€™re doubling the work and negating the effect). Also interesting: videos have no ā€œplayingā€ status, only ā€œpaused.ā€

R4 Day 42: 2021-07-12 Monday

Not muchā€“figured out the Flask app uses django for HTML templating.

R4 Day 41: 2021-07-11 Sunday

Adding Flask-Scss to the flask app and restructured some of the scss files; added vars

R4 Day 40: 2021-07-10 Saturday

Working to setup https://github.com/virtual/flask-tutorial to maybe work on a team repo project with arek_grows!

R4 Day 39: 2021-07-09 Friday

Trying to scrape practice questions for license information to make Anki cards but the API seems to be limited to 10 results, no matter what limit you put.

R4 Day 38: 2021-07-08 Thursday

QA Strategy

Test by changing your locale in your OS! Can also try the Language Switcher App. Virtual environments can be good.

R4 Day 37: 2021-07-07 Wednesday

Localization solutions:

R4 Day 36: 2021-07-06 Tuesday

If youā€™re formatting with bold, italics, or underlines, this may not work in other languages:

Formatting:

Adapting UI

Pseudolocalization

R4 Day 35: 2021-07-05 Monday

Media:

  1. Unlocalize media
    • Yellow school buses are not common outside NA
  2. Media swapping
    • Should be as easy to swap as text
    • RtL / LtR infographics
    • Japan reads comics RtL but text LtR
  3. Media separation
    • Avoid text in an image
  4. Media context
    • Know guidelines of things to avoid in countries / context
  5. Keep all source files
    • Makes dubbing easier
    • Some countries are accepting of dubbing, others not
    • Make sure all audio can be turned off

Internationalizing GUI

Unicode:

Diacritical marks - accents, tone marks used for pronunciation

Fonts

RTL Support

BiDi - Bi-directional text; where using a mix of LTR & RTL text in the same field or interface

Characters Direction Effect
Most alphabets LTR Strong
Hebrew & Arabic RTL Strong
European numbers none Weak
Abbr. Code Point Name Description
LRE U+202A LEFT-TO-RIGHT EMBEDDING Treat the following text as embedded left-to-right.
RLE U+202B RIGHT-TO-LEFT EMBEDDING Treat the following text as embedded right-to-left.
LRO U+202D LEFT-TO-RIGHT OVERRIDE Force following characters to be treated as strong left-to-right characters.
RLO U+202E RIGHT-TO-LEFT OVERRIDE Force following characters to be treated as strong right-to-left characters.
PDF U+202C POP DIRECTIONAL FORMATTING End the scope of the last LRE, RLE, RLO, or LRO.

Use example, as stored in database:

×Ŗבו×Ŗכ: [U+202a] 123 Easy St. [U+202c]

Desired output:

123 Easy St. :כ×Ŗוב×Ŗ

202C allows us to ā€œpopā€ back to global settings after overriding

You can also use native HTML solution (as stored in DB):

×Ŗבו×Ŗכ: <span dir="ltr">123 Easy St.</span>

R4 Day 34: 2021-07-04 Sunday

Content

Strings:

Numbers:

R4 Day 33: 2021-07-03 Saturday

ā€“

R4 Day 32: 2021-07-02 Friday

  1. Identify target locales
  2. Internationalize your product
  3. Pseudo-localization - test that media, text is changing
  4. Test for functionality
  5. Add additional locales
  6. Test each locale

Localization solution - one spot for all localizations, translations, media

Research

Specialists

R4 Day 31: 2021-07-01 Thursday

Localization for Developers

Steps for localization:

  1. Translation (inc. reading direction)
  2. Unit conversion
  3. Social conventions - accommodating user expectations
  4. Legal regulation

Considerations:

Localization != language

Associated Preferences:

Identifying locales: typically defined using two values: (eg en_US vs en_CA)

  1. language in lowercase (ISO 639.1 - 2 chars/639.2 - 3 chars)
  2. region in uppercase (ISO 3166 - 2 chars)

R4 Day 30: 2021-06-30 Wednesday

Fixing some of my better codepens!

R4 Day 29: 2021-06-29 Tuesday

Attempted to add editing and adding ability for Recipe app ingredients, but ended up scrapping it.

R4 Day 28: 2021-06-28 Monday

Looking into implementing internationalization (i18n) for my Recipe app, but running into some issues with wrapping the export class in the library. (Example) May try it on a simpler app, or non-React project another time.

R4 Day 27: 2021-06-27 Sunday

Fixed 3-year old issue with my Recipe App search! It turns out the key for the card component wasnā€™t correct which was causing the wrong results to cache/render. Also spent a good chunk of time playing with outdated node_modules.

R4 Day 26: 2021-06-26 Saturday

Starting freeCodeCamp Information Security, Python for Penetration Testing

Socket: an internal endpoint for sending and receiving data (analogy: outlet)

Types:

  1. TCP - transmission control protocol (IPV4 or IPV6)
  2. UDP

R4 Day 25: 2021-06-25 Friday

Styling broken images with CSS

R4 Day 24: 2021-06-24 Thursday

Finished the Probability Calculator and claimed my Scientific Computing with Python certification! Pretty excited :)

R4 Day 23: 2021-06-23 Wednesday

Sick day but did learn a bit more about Pythonā€™s random library. Itā€™s more predestined randomizationā€“it always gives the same ā€œrandomā€ result given the same inputs. (Good for testingā€¦) It can instead be re-written using SystemRandom()

sr = random.SystemRandom()
# for truly random use sr
# randomSelection = random.choice(contents)
randomSelection = sr.choice(contents)

R4 Day 22: 2021-06-22 Tuesday

Battling it out with Python and bash; turns out I just needed a restart. šŸ˜…

Did end up changing my launch.json for python (internalConsole from integratedTerminal), so now it has different colors. (Not sure if itā€™s betterā€¦)

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Current File",
      "type": "python",
      "request": "launch",
      "program": "main.py",
      "console": "internalConsole"
    }
  ]
}

Passing test #2, butā€¦ why is always returning ['blue', 'red'] for a ā€œrandomā€ choice?

R4 Day 21: 2021-06-21 Monday

Started the fifth python projectā€“Probability Calculator, passing 1/3 tests.

R4 Day 20: 2021-06-20 Sunday

Finished Polygon Area Calculator! Seemed a lot easier than the last challenge. :D

R4 Day 19: 2021-06-19 Saturday

Started Polygon Area Calculator

R4 Day 18: 2021-06-18 Friday

Finished Python Budget App! šŸŽ‰ Calculated percentages overall for withdrawals and added accurate representations for the bar chart. A nifty function:

R4 Day 17: 2021-06-17 Thursday

Setup the vertical labels for the categories for the Python Budget App.

R4 Day 16: 2021-06-16 Wednesday

šŸŒ‘

R4 Day 15: 2021-06-15 Tuesday

Working through the final python project #3, started setting up the bar chart; also worked on a definition to center the category title when printing the given category object.

R4 Day 14: 2021-06-14 Monday

Simple day of python on sololearn app

R4 Day 13: 2021-06-13 Sunday

Tests #8-10 of Budget app passing; need to still center the title of the instance dynamically.

Overriding what is returned when calling the instance obj by overriding __str__ in the Class; roughly:

def __str__(self):
    output = ''
    for iter in range(len(self.ledger)):
      output = output + str(self.ledger[iter]['amount'])
    return f'{output}'

Using Sphinx documentation for Python is helpful for later auto-generating docs.

Example:

def transfer(self, amount, targetCategory):
  '''
  Send a message to a recipient

  :param float amount: The amount of money to transfer
  :param str targetCategory: The target category to transfer to
  :return: `True` if the transfer took place, and `False` otherwise
  :rtype: boolean
  :raises ValueError: if the targetCategory exceeds 160 characters
  :raises TypeError: if the targetCategory is not a basestring
  '''

Had a bit of fun at looking at more profile customizations & updated my GitHub profile a bit with Spotify stats from JeffreyCA, also their project spleeter web looks really neat. Will need to check out :)

R4 Day 12: 2021-06-12 Saturday

Python Project #3: Budget App

Revising Python and objects from py4e

Use dir(var) to list all the items/methods inside a variable

Use dictionaries for a structure like {'jack': 4098, 'sape': 4139}

R4 Day 11: 2021-06-11 Friday

Back to python, setup the Budget App locally; tried adding a few lines of code to the class but itā€™s obvious I completely forgot everything about python classes.

R4 Day 10: 2021-06-10 Thursday

Added a bit more random sizing, hover effects and interactive note sounds using Tone JS. Done with this project for a bit, not quite going the way I want between the advanced svgs and delays Iā€™d like. And the interactivity, Iā€™m not even sure what I want.

R4 Day 9: 2021-06-09 Wednesday

Added animation delay and better handling for performance; only showing svg changes on submit.

A few gotchas:

Sentiment Analyzer - count your lucky stars okay star star star rawr star star circle mew star

R4 Day 8: 2021-06-08 Tuesday

i hate cirlces and stars

Oh, no, not really. But now my sentiment app adds svgs based on how many certain words appear (cirlce, star) with a very badly performing regex! You can also click them and see a nice console log.

R4 Day 7: 2021-06-07 Monday

Lifted the state for the sentiment analysis value for my sentiment analyzer and added some coloring based on positive / negative, and attempted to do some saturation value (HSL) based on just how intense the result is.

Learned about using isInfinite() instead of checking if a var equals Infinity (doesnā€™t work)

R4 Day 6: 2021-06-06 Sunday

Configured my sentiment analyzer to run on replit!

Overview of changes:

Updated app.js:

require('dotenv').config();

if (process.env.NODE_ENV === 'production') { 
  app.use(express.static("./public/build"));
} else {
  app.use(express.static("public"));  
}

Added logging and debugging with log4js

A few ideas:

Also updated my Heroku apps since they have an necessary upgrade (The Heroku-16 stack is end-of-life).

R4 Day 5: 2021-06-05 Saturday

Added a textarea to input words/lyrics and then using Axios, make a post request to node which then queries my original function to output the sentiment value. :)

Looks like if I want this to run on replit, I need to set up some environment variables

R4 Day 4: 2021-06-04 Friday

Considering a sentiment analyzer to potentially create an interactive app that can later use a sound library

A few notes:

Resources:

R4 Day 3: 2021-06-03 Thursday

Learned thereā€™s no case statements for python, but may be coming soon :)

R4 Day 2: 2021-06-02 Wednesday

Not very pretty but now passing tests 2-5 for the Time Calculator Ā· (Replit)

Working with the Python debugger to check my values

R4 Day 1: 2021-06-01 Tuesday

Audio JS Libraries

To reset your Github account on VSCode after enabling 2FA use:

git config --global --unset credential.helper

Python Project #2: Time Calculator

Run debugger with F5 in VSCode; set up launch.json if needed, e.g.

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Python: Main File",
      "type": "python",
      "request": "launch",
      "program": "main.py",
      "console": "integratedTerminal"
    }
  ]
}

Implemented code to pass the first test for the Time Calculator

Tidy code to split a string and assign it as ints to two variables:

dHours, dMins = map(int,duration.split(':'))

šŸ‘‘ šŸ‘‘ Round 4 begins šŸ‘‘ šŸ‘‘

Ideas for Round 4 starting June 1, 2021