Skip to content

Instantly share code, notes, and snippets.

View akirap3's full-sized avatar

akirapf3 akirap3

View GitHub Profile

Create a website in Pythonanywhere

This is a note in Section 19: Web Development with Python , Complete Python Developer in 2020: Zero to Mastery,The environment I use is windows 10

本地端

1.使用 sublime,創建 index.html, script.js, style.css,此三個檔案放在同一個資料夾

2.會使用到Flask可以參考官方文件

The reseasons why I want to learn Markdown syntax :


Reason

1. I can edit whole contents in words and codes. No images are copied in a markdown file, they are indirectly linked to URLs of the source images. It's a clear pattern.
2. If you are often using Github, you may notice that the editing method of readme.md is Markdown syntax.
3. As an engineer, I would like to indulge in the coding environment as possible, even when I compose an article. Markdown is a way to achieve that.
4. I think it's not to difficult to get this skill if you have some background in coding. Grasp some keynote syntaxes and the most used ones. Hence, you may find it's not scaring for you.
PeterFan@DESKTOP-CVDK4VF MINGW64 ~/Desktop/freecodecamp/Freecodecamp_Front_End_Libraries (master)
$ git rm --cached ./.ipynb_checkpoints
fatal: not removing './.ipynb_checkpoints' recursively without -r

PeterFan@DESKTOP-CVDK4VF MINGW64 ~/Desktop/freecodecamp/Freecodecamp_Front_End_Libraries (master)
$ git rm -r --cached ./.ipynb_checkpoints
rm '.ipynb_checkpoints/01_FrontEndLibraries_Bootstrap-checkpoint.ipynb'
rm '.ipynb_checkpoints/02_FrontEndLibraries_jQuery-checkpoint.ipynb'
rm '.ipynb_checkpoints/03_FrontEndLibraries_Sass-checkpoint.ipynb'

Basic JavaScript: Comment Your JavaScript Code

Best Practice

  • As you write code, you should regularly add comments to clarify the function of parts of your code. Good commenting can help communicate the intent of your code—both for others and for your future self.

There are two ways to write comments in JavaScript:

  • Using // will tell JavaScript to ignore the remainder of the text on the current line:

Introduction to the ES6 Challenges

  • ECMAScript is a standardized version of JavaScript with the goal of unifying the language's specifications and features. As all major browsers and JavaScript-runtimes follow this specification, the term ECMAScript is interchangeable with the term JavaScript.

  • Most of the challenges on freeCodeCamp use the ECMAScript 5 (ES5) specification of the language, finalized in 2009.

  • The most recent standardized version is called ECMAScript 6 (ES6), released in 2015.This new version of the language adds some powerful features that will be covered in this section of challenges, including:

    • Arrow functions
  • Classes

Introduction to the Regular Expression Challenges

This is note of regular expression from freecodecamp

  • Regular expressions are special strings that represent a search pattern. Also known as "regex" or "regexp", they help programmers match, search, and replace text.
  • Regular expressions can appear cryptic because a few characters have special meaning.
  • The goal is to combine the symbols and text into a pattern that matches what you want, but only what you want.

Regular Expressions: Using the Test Method

  • JavaScript has multiple ways to use regexes. One way to test a regex is using the .test() method. The .test() method takes the regex, applies it to a string (which is placed inside the parentheses), and returns true or false if your pattern finds something or not.

Introduction to the Debugging Challenges

  • Debugging is the process of finding exactly what isn't working and fixing it

  • These issues generally come in three forms:

    1. syntax errors that prevent a program from running
    2. runtime errors when code fails to execute or has unexpected behavior
    3. semantic (or logical) errors when code doesn't do what it's meant to.
  • Example of a syntax error - often detected by the code editor:

Basic Data Structures: Use an Array to Store a Collection of Data

  • The below is an example of the simplest implementation of an array data structure. This is known as a one-dimensional array, meaning it only has one level, or that it does not have any other arrays nested within it.
let simpleArray = ['one', 2, 'three', true, false, undefined, null];
console.log(simpleArray.length);
// logs 7

Introduction to Basic Algorithm Scripting

  • To make solving problems easier, it can be helpful to break them down into many chunks. Then, each chunk can be solved one by one.
  • For example, if you are building a calculator, don't try to solve the problem as a whole. First, consider how to get inputs. Then, determine each arithmetic operation one by one. Finally, display the results.

Basic Algorithm Scripting: Convert Celsius to Fahrenheit

function convertToF(celsius) {

Object Oriented Programming: Create a Basic JavaScript Object

Objects in JavaScript are used to model real-world objects, giving them properties and behavior just like their real-world counterparts. Here's an example using these concepts to create a duck object:

let duck = {
  name: "Aflac",
  numLegs: 2
};