In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:
- You can separate the code into different repositories.
| 'use client' | |
| import { test } from './server' | |
| import { useServerAction } from './hook' | |
| export default function Home() { | |
| const { data, loading, error, execute: testAction } = useServerAction(test) | |
| if (loading) return <div>Loading...</div> | |
| if (error) return <div>Error: {error.message}</div> |
| const { createLogger, format, transports } = require('winston') | |
| const moment = require('moment') | |
| // set default log level. | |
| const logLevel = 'info' | |
| var logger = createLogger({ | |
| level: logLevel, | |
| levels: { | |
| fatal: 0, |
| """ | |
| # App Engine import data from Datastore Backup to localhost | |
| You can use this script to import large(ish) App Engine Datastore backups to your localohst dev server. | |
| ## Getting backup files | |
| Follow instructions from Greg Bayer's awesome article to fetch the App Engine backups: | |
| http://gbayer.com/big-data/app-engine-datastore-how-to-efficiently-export-your-data/ |
| const fs = require('fs'); | |
| const path = require('path'); | |
| /** | |
| * Replaces tailwind 0.x color CSS classes with 1.0 names | |
| * E.g. "bg-grey-light" is replaced with "bg-gray-400" | |
| * | |
| * This is a "dumb" replacement that searches for string patterns across the | |
| * specified files, | |
| * |
| -Xmx2048m | |
| -Xms1024m | |
| -XX:NewRatio=1 | |
| -XX:ReservedCodeCacheSize=240m | |
| -XX:+UseCompressedOops | |
| -Dfile.encoding=UTF-8 | |
| -XX:+UseConcMarkSweepGC | |
| -XX:SoftRefLRUPolicyMSPerMB=50 | |
| -ea | |
| -Dsun.io.useCanonCaches=false |
| # List all installed versions. | |
| nmv ls | |
| # Install a specific version. | |
| nvm install 9.6.0 | |
| # Use a specific version. | |
| nvm use 9.6.0 | |
| # Set the Default Version. |
| # Steps we will take: | |
| # 1. Change Local (Docker Machine) image type (this will take a bit) | |
| # 2. Resize image | |
| # 3. Resize partion | |
| # | |
| # Also see: https://docs.docker.com/articles/b2d_volume_resize/ | |
| # IMPORTANT: Make sure Local is not running! | |
| VM_NAME="local-by-flywheel" | |
| NEW_DISK_SIZE=50000 |