http://guides.rubyonrails.org/migrations.html
- add_column
- add_index
- change_column
- change_table
- create_table
- drop_table
| const fs = require('fs'); | |
| const stripe = require('stripe')('STRIPE KEY GOES HERE'); | |
| let { task, desc } = require('jake'); | |
| const read_stripe_config = config_name => { | |
| const file = fs.readFileSync(`./data/${config_name}.json`); | |
| return JSON.parse(file); | |
| }; |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import { Label, Menu, Tab } from 'semantic-ui-react'; | |
| import VideoTabContent from './VideoTabContent'; | |
| import AudioTabContent from './AudioTabContent'; | |
| import SubtitleTabContent from './SubtitleTabContent'; | |
| export function VideoTool({ data }) { | |
| if (!data) return <div />; |
| {"lastUpload":"2021-01-14T06:33:37.400Z","extensionVersion":"v3.4.3"} |
| # Map vs Object | |
| | Map | Object | | |
| | --------------------- | ------------------------------| | |
| | Map is introduces in ES6. | Objects were there since the birth of JS. | | |
| | Accepts anything (even NaN) as key. | The keys can only be String or Symbol. | | |
| | `.set()` and `.get()` functions are used. | Assign values with `=` operator. | | |
| | Is an iterable and `forEach` & `for of` can be used. | Not an iterable. You can not use `myObj.forEach()` etc.| | |
| | `.size` property of a map shows the size. | You can not get size of an object easily. | | |
| | Map is a map. You can even do `myMap.set("set", "will not change set")`. | As objects has prototypes, key conflicts may occur. | | |
| | Map has `.clear()` to clear everything. | To clear properties, you need to write manual code. | |
| module.exports = { | |
| "extends": [ | |
| "airbnb", | |
| "prettier", | |
| "prettier/react" | |
| ], | |
| "parser": "babel-eslint", | |
| "parserOptions": { | |
| "ecmaVersion": 8, | |
| "ecmaFeatures": { "experimentalObjectRestSpread": true, "impliedStrict": true, "classes": true } |
| // async function <-> new Promise Object | |
| // await keyword <-> then() method call | |
| // catch block <-> catch() method call | |
| // return keyword <-> resolve() function call | |
| // throw error <-> reject() function call | |
| // | |
| // Async Version | |
| async function callAPIs(){ | |
| try{ |
| # Initialize directory to EB | |
| eb init | |
| # set ENV variables | |
| eb setenv [key]=[value] # set environment variable | |
| # view EB ENV variables | |
| eb printenv | |
| # view eb events log |
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
| Style/EmptyMethod: | |
| EnforcedStyle: expanded | |
| SupportedStyles: | |
| - compact | |
| - expanded | |
| Style/StringLiterals: | |
| EnforcedStyle: single_quotes | |
| SupportedStyles: | |
| - single_quotes |
http://guides.rubyonrails.org/migrations.html