Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0| // plugged in this answer from S.O. - https://stackoverflow.com/a/8904008/5172977 | |
| // import { Upload } from 'antd'; | |
| // function returns a promise | |
| beforeUpload = (file) => { | |
| return new Promise((resolve, reject) => { | |
| // check the file type - you can specify the types you'd like here: | |
| const isImg = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png' || file.type === 'image/gif'; | |
| if (!isImg) { |
| import React, { useRef, useEffect } from 'react'; | |
| const scaleWidth = 500; | |
| const scaleHeight = 500; | |
| /* | |
| topImage is an object | |
| { | |
| image: String, // name of image | |
| imageUrl: String, // full url of remote hosted image |
| rem see https://github.com/coreybutler/nvm-windows/issues/300 | |
| @echo off | |
| SETLOCAL EnableDelayedExpansion | |
| if [%1] == [] ( | |
| echo Pass in the version you would like to install, or "latest" to install the latest npm version. | |
| ) else ( | |
| set wanted_version=%1 |
| const PLUGIN_NAME = 'MY_WEBPACK_PLUGIN'; | |
| class MyWebpackPlugin { | |
| constructor() { | |
| this.cssReady = false; | |
| this.cssFiles = []; | |
| } | |
| apply(compiler) { | |
| compiler.hooks.watchRun.tap(PLUGIN_NAME, () => { | |
| this.cssReady = false; |
Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
| #!/bin/bash | |
| #get highest tag number | |
| VERSION=`git describe --abbrev=0 --tags` | |
| #replace . with space so can split into an array | |
| VERSION_BITS=(${VERSION//./ }) | |
| #get number parts and increase last one by 1 | |
| VNUM1=${VERSION_BITS[0]} |
| import React from "react"; | |
| const scaleWidth = 500; | |
| const scaleHeight = 500; | |
| function draw(canvas, scaleX, scaleY) { | |
| const context = canvas.getContext("2d"); | |
| context.scale(scaleX, scaleY); | |
| context.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight); |
| # ========================================================== | |
| # NPM | |
| # ========================================================== | |
| npm set registry https://registry.npmmirror.com # 注册模块镜像 | |
| npm set disturl https://npmmirror.com/mirrors/node # node-gyp 编译依赖的 node 源码镜像 | |
| ## 以下选择添加 | |
| npm set sass_binary_site https://registry.npmmirror.com/mirrors/node-sass # node-sass 二进制包镜像 | |
| npm set electron_mirror https://registry.npmmirror.com/mirrors/electron/ # electron 二进制包镜像 |