In the root of your project, add .gitlab-ci.yml
with the configuration below.
image: node:latest
stages:
# Adapted from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile | |
# Install dependencies only when needed | |
FROM node:16-alpine AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm ci | |
# Rebuild the source code only when needed |
# https://github.com/messense/homebrew-macos-cross-toolchains | |
brew tap messense/macos-cross-toolchains | |
brew install x86_64-unknown-linux-gnu | |
export CC_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-gcc | |
export CXX_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-g++ | |
export AR_X86_64_UNKNOWN_LINUX_GNU=x86_64-unknown-linux-gnu-ar | |
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc |
/** | |
* 计算双线性内插点的值 | |
* @param {Point} pt 目标点位 | |
* @param {Point} p1 左上 | |
* @param {Point} p2 右上 | |
* @param {Point} p3 左下 | |
* @param {Point} p4 右下 | |
* | |
* @returns {Number} pt的插值结果 | |
*/ |
Just run the script in your terminal like this... | |
node script-file.js > log-file.txt | |
This tells the shell to write the standard output of the command node script-file.js to your log file instead of the default, which is printing it to the console. | |
This is called redirection and its very powerful. Say you wanted to write all errors to a separate file... | |
node script-file.js >log-file.txt 2>error-file.txt | |
Now all console.log are written to log-file.txt and all console.error are written to error.txt |
import React, { Component } from 'react'; | |
import TextField from 'components/base/TextField'; | |
const WAIT_INTERVAL = 1000; | |
const ENTER_KEY = 13; | |
export default class TextSearch extends Component { | |
constructor(props) { | |
super(); |
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |
/* http://meyerweb.com/eric/tools/css/reset/ | |
v2.0-modified | 20110126 | |
License: none (public domain) | |
*/ | |
html, body, div, span, applet, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
a, abbr, acronym, address, big, cite, code, | |
del, dfn, em, img, ins, kbd, q, s, samp, | |
small, strike, strong, sub, sup, tt, var, |
#add 'node_modules' to .gitignore file | |
git rm -r --cached node_modules | |
git commit -m 'Remove the now ignored directory node_modules' | |
git push origin <branch-name> |