Skip to content

Instantly share code, notes, and snippets.

View mantissa23's full-sized avatar

ma mantissa23

  • 23zzle
View GitHub Profile
tar --exclude='*node_modules*' --directory=@ -zcvf @.tar.gz .
@mantissa23
mantissa23 / raw.githubusercontent.com_nodejs_node_main_tools_msvs_install_tools_install_tools.bat
Created September 25, 2023 10:42
raw.githubusercontent.com_nodejs_node_main_tools_msvs_install_tools_install_tools
@echo off
setlocal
title Install Additional Tools for Node.js
cls
echo ====================================================
echo Tools for Node.js Native Modules Installation Script
echo ====================================================
@mantissa23
mantissa23 / machine.js
Created December 24, 2021 23:52
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
autoKeyboardLang : function(str)
{
var s = [
"й","ц","у","к","е","н","г","ш","щ","з","х","ъ",
"ф","ы","в","а","п","р","о","л","д","ж","э",
"я","ч","с","м","и","т","ь","б","ю"
];
var r = [
"q","w","e","r","t","y","u","i","o","p","\\[","\\]",
@mantissa23
mantissa23 / Win10-64bit-npm.md
Created May 27, 2021 00:10 — forked from jtrefry/Win10-64bit-npm.md
Configuring Windows 10 (64-bit) for npm and node-gyp
  • 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.)
  • Open a new command prompt and run the following commands. If these install without errors, you have bypasse
В fields.yaml отдельно прописать my_field@update - то есть состояние кнопки при update.
Пример:
my_field:
type: text
...
my_field@update:
type: text
disabled: true
...
Если нужна связь типа "Запись имеет комментарий(ии)", то есть без pivot таблицы,
а просто таблица комментариев имеет доп. столбец с id записи, то:
1. модели Запись прописываем:
public $hasMany = [
'comments' => 'author\myplugin\Models\Comment'
];
2. Контроллеру Записи прописываем:
public $implement = ['Backend\Behaviors\RelationController'] и public $relationConfig = 'config_relation.yaml';
@mantissa23
mantissa23 / AllMethods.vue
Last active December 22, 2020 12:07
VAC (vue-awesome-countdown) 🍉 All Methos
<vac :left-time="9999999000">
<div
slot="prev"
slot-scope="vac">
<button type="button"
@click="() => {
vac.startCountdown()
}"
:disabled="vac.state === 'process' || vac.state === 'finished'">Start</button>
<button type="button"
@mantissa23
mantissa23 / smsForm.vue
Last active December 22, 2020 12:07
VAC (vue-awesome-countdown) 🍉 Send sms code
<!-- https://vac.js.org/ -->
<template>
<form action="/reg" method="post">
Phone Number: <input type="text" name="phoneNumber" v-model="formData.phoneNumber">
<vac
ref="sendSMSCode"
tag="button"
type="button"
:autoStart="false"
:left-time="60000"
@mantissa23
mantissa23 / SingletonDefaultExportInstance.js
Created December 17, 2020 06:52 — forked from dmnsgn/SingletonDefaultExportInstance.js
ES6 singleton pattern: module default exports an instance
class SingletonDefaultExportInstance {
constructor() {
this._type = 'SingletonDefaultExportInstance';
}
singletonMethod() {
return 'singletonMethod';
}
static staticMethod() {