Skip to content

Instantly share code, notes, and snippets.

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 />;
@naterexw
naterexw / cloudSettings
Last active January 14, 2021 06:33
Visual Studio Code Settings Sync Gist
{"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. |
@naterexw
naterexw / .eslintrc.js
Last active January 11, 2019 06:53
ESlint config
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{
@naterexw
naterexw / commands
Last active December 19, 2017 14:06
# 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 ->
@naterexw
naterexw / .rubocop.yml
Last active August 7, 2019 04:39
Rubocop config file ~/.rubocop.yml
Style/EmptyMethod:
EnforcedStyle: expanded
SupportedStyles:
- compact
- expanded
Style/StringLiterals:
EnforcedStyle: single_quotes
SupportedStyles:
- single_quotes
@naterexw
naterexw / rails_migration_cheatsheet.md
Created February 17, 2017 03:43 — forked from amejiarosario/rails_migration_cheatsheet.md
Rails Migration - Cheatsheet