- Install Git for Windows
- Install Node
- Install Python 2.7.3
- Install Microsoft Visual Studio 2015 Community
- Open the command prompt as Administrator, run the following commands, then close the command prompt (a new prompt is required before the new environment variables will be available)
- npm install -g npm
- (Upgrades to npm v3, which no longer nests dependencies indefinitely. No more "maximum path length exceeded" errors due to the 260 character path limit in Windows, or needing to delete node_modules with rimraf.)
- setx PYTHON C:\Python27\python.exe /m
- (May need to change path to your custom install directory.)
- npm install -g npm
- Open a new command prompt and run the following commands. If these install without errors, you have bypasse
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
В fields.yaml отдельно прописать my_field@update - то есть состояние кнопки при update. | |
Пример: | |
my_field: | |
type: text | |
... | |
my_field@update: | |
type: text | |
disabled: true | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Если нужна связь типа "Запись имеет комментарий(ии)", то есть без pivot таблицы, | |
а просто таблица комментариев имеет доп. столбец с id записи, то: | |
1. модели Запись прописываем: | |
public $hasMany = [ | |
'comments' => 'author\myplugin\Models\Comment' | |
]; | |
2. Контроллеру Записи прописываем: | |
public $implement = ['Backend\Behaviors\RelationController'] и public $relationConfig = 'config_relation.yaml'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SingletonDefaultExportInstance { | |
constructor() { | |
this._type = 'SingletonDefaultExportInstance'; | |
} | |
singletonMethod() { | |
return 'singletonMethod'; | |
} | |
static staticMethod() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple proxy/forwarding server for when you don't want to have to add CORS during development. | |
// Usage: node proxy.js | |
// Open browser and navigate to http://localhost:9100/[url] | |
// Example: http://localhost:9100/http://www.google.com | |
// This is *NOT* for anything outside local development. It has zero error handling among other glaring problems. | |
// This started as code I grabbed from this SO question: http://stackoverflow.com/a/13472952/670023 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const OFF = 0 | |
const WARN = 1 | |
const ERROR = 2 | |
// Gist fork: https://gist.github.com/mantissa23/53b1de222a798e5ef542f87b5ce0f8ad | |
module.exports = { | |
root: true, | |
env: { | |
browser: true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pulled from https://stackoverflow.com/questions/18641864/git-bash-shell-fails-to-create-symbolic-links | |
# https://stackoverflow.com/users/124119/camilo-martin | |
# Detect windows (assumes we are in 'msysgit' or similar). | |
windows() { [[ -n "$WINDIR" ]]; } | |
# Cross-platform symlink function. | |
# With one parameter, it will check whether the parameter is a symlink. | |
# With two parameters, it will create a symlink to a file or directory, | |
# with syntax: link $linkname $target |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"plugins": ["react"], | |
"ecmaFeatures": { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// APIStoreProps are properties that need to be | |
// ignored when running APIStore.makeStore() | |
const APIStoreProps = ['use', 'classes', 'constructor', 'init', 'state'] | |
// getMethods returns methods defined | |
// in a given class' prototype, except init and constructor | |
const getMethods = (cls) => { | |
return Object.getOwnPropertyNames(cls.prototype) | |
.reduce((obj, prop) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Устанавливаем October (установщиком или через Composer) | |
В папке с October устанавливаем пакет vue-cli (npm i -g vue-cli) и создаём vue приложение (vue init webpack my-app), | |
внутри папки my-app выполняем (npm i) и в итоге npm run dev (консоль и так подскажет) | |
Внутри my-app - npm i --save-dev axios (для запросов get, post к api) | |
Axios — это JavaScript-библиотека для выполнения либо HTTP-запросов в Node.js, либо XMLHttpRequests в браузере. | |
.htaccess (шоб axios мог получать данные): | |
Header add Access-Control-Allow-Origin "*" | |
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type" |
NewerOlder