Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js.
| const crypto = require('crypto'); | |
| const algorithm = 'aes-256-ctr'; | |
| let key = 'MySuperSecretKey'; | |
| key = crypto.createHash('sha256').update(String(key)).digest('base64').substr(0, 32); | |
| const encrypt = (buffer) => { | |
| // Create an initialization vector | |
| const iv = crypto.randomBytes(16); | |
| // Create a new cipher using the algorithm, key, and iv | |
| const cipher = crypto.createCipheriv(algorithm, key, iv); |
| -- Based on the original articel at http://www.codeproject.com/Articles/22824/A-Model-to-Represent-Directed-Acyclic-Graphs-DAG-o | |
| -- Here is a port to MySQL | |
| -- Edge table | |
| DROP TABLE IF EXISTS `Edge`; | |
| CREATE TABLE IF NOT EXISTS `Edge` ( | |
| `id` int(11) NOT NULL, | |
| `entry_edge_id` int(11) DEFAULT NULL COMMENT 'The ID of the incoming edge to the start vertex that is the creation reason for this implied edge; direct edges contain the same value as the Id column', | |
| `direct_edge_id` int(11) DEFAULT NULL COMMENT 'The ID of the direct edge that caused the creation of this implied edge; direct edges contain the same value as the Id column', | |
| `exit_edge_id` int(11) DEFAULT NULL COMMENT 'The ID of the outgoing edge from the end vertex that is the creation reason for this implied edge; direct edges contain the same value as the Id column', |
Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js.
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "fmt" | |
| "io" | |
| "io/ioutil" | |
| "os" |
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "os/exec" | |
| "strings" | |
| ) | |
| func main() { |
| import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node"; | |
| export const mergeMeta = ( | |
| overrideFn: V2_MetaFunction, | |
| appendFn?: V2_MetaFunction, | |
| ): V2_MetaFunction => { | |
| return arg => { | |
| // get meta from parent routes | |
| let mergedMeta = arg.matches.reduce((acc, match) => { | |
| return acc.concat(match.meta || []); |
| """ | |
| Reworked code based on | |
| http://trevorius.com/scrapbook/uncategorized/pyqt-custom-abstractitemmodel/ | |
| Adapted to Qt5 and fixed column/row bug. | |
| TODO: handle changing data. | |
| """ | |
| import sys |
| #!/usr/bin/env python | |
| """ | |
| Refs: | |
| "[Maya-Python] Customized display of files/folders in a QTreeView that is using QFileSystemModel." | |
| https://groups.google.com/d/topic/python_inside_maya/TaFm2yNToJ8/discussion | |
| """ | |
| from PySide import QtCore, QtGui | |
| from PySide6 import QtCore | |
| class TreeItem: | |
| def __init__(self, data, parent=None): | |
| self.parent_item = parent | |
| self.item_data = data | |
| self.child_items = [] | |
| def appendChild(self, item): | |
| self.child_items.append(item) |
| from PySide6 import QtWidgets | |
| import sys | |
| from tests.test_tree import TreeModel | |
| class TreeWindow(QtWidgets.QMainWindow): | |
| def __init__(self): | |
| super().__init__() | |
| self.tree_view = QtWidgets.QTreeView() |