I am creating project with JS, HTML, CSS and I am trying to makes my workflow faster and easier, so I decide to install browser-sync to help with auto-reloading page during coding process. And that would be great solution but browser-sync constantly after 30-60 sec reloading my page, what is annoying because during debugging when I change something in google chrome dev tools, like css properties, browser reload and changes gone. This is how I start browser-sync
browser-sync start --server --files .
And this is my bs-config.js
module.exports = {
"ui": {
"port": 3001,
"weinre": {
"port": 8080
}
},
"files": ["./css/*.css", "./scripts/*.js", "./*.html"],
"watchEvents": [
"change"
],
"watchOptions": {
"ignoreInitial": false
},
"server": false,
"proxy": false,
"port": 3000,
"middleware": false,
"serveStatic": [],
"ghostMode": {
"clicks": true,
"scroll": true,
"location": true,
"forms": {
"submit": true,
"inputs": true,
"toggles": true
}
},
"logLevel": "info",
"logPrefix": "Browsersync",
"logConnections": false,
"logFileChanges": true,
"logSnippet": true,
"rewriteRules": [],
"open": "local",
"browser": "default",
"cors": false,
"xip": false,
"hostnameSuffix": false,
"reloadOnRestart": false,
"notify": true,
"scrollProportionally": true,
"scrollThrottle": 0,
"scrollRestoreTechnique": "window.name",
"scrollElements": [],
"scrollElementMapping": [],
"reloadDelay": 0,
"reloadDebounce": 0,
"reloadThrottle": 0,
"plugins": [],
"injectChanges": true,
"startPath": null,
"minify": true,
"host": null,
"localOnly": false,
"codeSync": true,
"timestamps": true,
"clientEvents": [
"scroll",
"scroll:element",
"input:text",
"input:toggles",
"form:submit",
"form:reset",
"click"
],
"socket": {
"socketIoOptions": {
"log": false
},
"socketIoClientConfig": {
"reconnectionAttempts": 50
},
"path": "/browser-sync/socket.io",
"clientPath": "/browser-sync",
"namespace": "/browser-sync",
"clients": {
"heartbeatTimeout": 5000
}
},
"tagNames": {
"less": "link",
"scss": "link",
"css": "link",
"jpg": "img",
"jpeg": "img",
"png": "img",
"svg": "img",
"gif": "img",
"js": "script"
}
};
I didn't add any configs to it. I was trying to find solution but nothing help.
What I want is to reloading page only when I make and save changes to .htm, .css, .js files and I thought that is default behavior for browser-sync.
Related
I have this call in a SAPUI5 code. Before the soldTo was a simple comboBox, but I changed it for a multiComboBox. So, now this.soldTo is an array.
this._oRouter.navTo("SearchResult", {
soldTo: this.soldTo,
shipTo: this.shipTo,
}, false);
The routing in manifest.json is defined like this:
"routing": {
"config": {
"routerClass": "sap.m.routing.Router",
"viewType": "XML",
"async": true,
"viewPath": "com.openOrder.AM.view",
"controlAggregation": "pages",
"controlId": "app",
"clearControlAggregation": false
},
"routes": [
{
"name": "RouteApp",
"pattern": "",
"target": [
"Search"
]
},
{
"pattern": "{soldTo}/{shipTo}/SearchResult",
"name": "SearchResult",
"target": [
"SearchResult"
]
},
{
"name": "ResultDetails",
"pattern": "{}/ResultDetails",
"target": [
"ResultDetails"
]
}
],
"targets": {
"Search": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "Search",
"viewLevel": 1
},
"SearchResult": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "SearchResult",
"viewLevel": 2
},
"ResultDetails": {
"viewType": "XML",
"transition": "slide",
"clearControlAggregation": false,
"viewName": "ResultDetails",
"viewLevel": 3
}
}
}
I'm getting this error after change.
"Uncaught TypeError: Cannot read properties of null (reading 'length')"
Does anyone has an exemple how to pass the multiComboBox values to the function Router.navTo, please?
There is no need to send the array with a URL. The URL makes only sense if you want a unique address for a specific record. Therefore you should pass it with the model on your component.
Define your model in the manifest. The definition will enable you to access it using "this.getModel(""). In your views you can access the model with "this.getOwnerComponent().getModel("").
I just try to install Ghost to Google Cloud App Engine. I follow the official instruction but I got error below:
2020-07-25 10:40:52 default[20200725t173735] Error: EROFS: read-only
file system, open
'/workspace/node_modules/ghost/content/logs/https___yaskurweb_appspot_com_production.error.log'
Then I change config.production.json from:
"logging": {
"level": "info",
"rotation": {
"enabled": true
},
"transports": ["file", "stdout"]
}
to
"logging": {
"transports": [
"stdout"
]
},
But I got another error below:
2020-07-25 10:58:47 default[20200725t175429] Error: EROFS: read-only
file system, copyfile
'/workspace/node_modules/ghost/core/frontend/services/settings/default-routes.yaml'
-> '/workspace/node_modules/ghost/content/settings/routes.yaml'
I think it's caused when Ghost tries to copy routes.yaml file to another directory. So I need to know how to disable writing any file in Ghost?
my full config.production.json is:
{
"url": "https://myproject.appspot.com",
"fileStorage": false,
"server": {
"port": 8080,
"host": "0.0.0.0"
},
"database": {
"client": "mysql",
"connection": {
"host": "*",
"port": "3306",
"user": "dev",
"password": "*",
"database": "test_db"
}
},
"mail": {
"transport": "Direct"
},
"logging": {
"transports": [
"stdout"
]
},
"process": "systemd",
"paths": {
"contentPath": "content/"
}
}
The problem is that config set content path to node_modules. it's should be installed root path.
so I changed from:
"paths": {
"contentPath": "content/"
}
to
"paths": {
"contentPath": "/workspace/content/"
}
And then work perfectly...
say I have a file link in the format of something like
https://drive.google.com/uc?id=1o9rhnAr2GIilfjxPm4Wdl1BlaVP4Gsj1
Is it at all possible to get the email address of the one who uploaded this file, since the link is public? I haven't been able to find anything like this in the docs
File.get request
will return all the information about the file including the users email. I have altered it slightly but anyone running this request is going to get your email you might want to scramble that file id :)
All you need is an API key to be able to get information about a public file.
curl \
'https://www.googleapis.com/drive/v3/files/1o9rhnAr2GIilfjxPm4Wdl1BlaVP4Gsj1?fields=*&key=[YOUR_API_KEY]' \
--header 'Accept: application/json' \
--compressed
response
{
"kind": "drive#file",
"id": "1o9rhnAr2GIilfjxPm4Wdl1BlaVP4Gsj1",
"name": "pokemon_terrain.jpg",
"mimeType": "image/jpeg",
"starred": false,
"trashed": false,
"explicitlyTrashed": false,
"spaces": [
"drive"
],
"version": "5",
"webContentLink": "https://drive.google.com/uc?id=1o9rhnAr2GIilfjxPm4Wdl1BlaVP4Gsj1&export=download",
"webViewLink": "https://drive.google.com/file/d/1o9rhnAr2GIilfjxPm4Wdl1BlaVP4Gsj1/view?usp=drivesdk",
"iconLink": "https://drive-thirdparty.googleusercontent.com/16/type/image/jpeg",
"hasThumbnail": true,
"thumbnailLink": "https://lh3.googleusercontent.com/1ZX-DvVSs70fPta2IAsg8tpYbkRDFeU0p-MVIdZPKY2PAGCGLqCAnXPl3MNMcafYNVfmAe2qips=s220",
"thumbnailVersion": "1",
"viewedByMe": false,
"createdTime": "2019-09-16T09:43:40.107Z",
"modifiedTime": "2020-02-13T14:12:57.036Z",
"modifiedByMe": false,
"owners": [
{
"kind": "drive#user",
"displayName": "p v",
"photoLink": "https://lh3.googleusercontent.com/a-/AOh14GjNKXej3SKi_Rc7VwlULYtsnN_A4uYJsxwoc_FR=s64",
"me": false,
"permissionId": "15907603398143100492",
"emailAddress": "vou.pandev#gmail.com"
}
],
"lastModifyingUser": {
"kind": "drive#user",
"displayName": "p v",
"photoLink": "https://lh3.googleusercontent.com/a-/AOh14GjNKXej3SKi_Rc7VwlULYtsnN_A4uYJsxwoc_FR=s64",
"me": false,
"permissionId": "15907603398143100492",
"emailAddress": "vourtspandev#gmail.com"
},
"shared": true,
"ownedByMe": false,
"capabilities": {
"canAddChildren": false,
"canAddMyDriveParent": false,
"canChangeCopyRequiresWriterPermission": false,
"canChangeViewersCanCopyContent": false,
"canComment": false,
"canCopy": false,
"canDelete": false,
"canDownload": true,
"canEdit": false,
"canListChildren": false,
"canModifyContent": false,
"canMoveChildrenWithinDrive": false,
"canMoveItemIntoTeamDrive": false,
"canMoveItemOutOfDrive": false,
"canMoveItemWithinDrive": false,
"canReadRevisions": false,
"canRemoveChildren": false,
"canRemoveMyDriveParent": true,
"canRename": false,
"canShare": false,
"canTrash": false,
"canUntrash": false
},
"viewersCanCopyContent": true,
"copyRequiresWriterPermission": false,
"writersCanShare": true,
"originalFilename": "pokemon_terrain.jpg",
"fullFileExtension": "jpg",
"fileExtension": "jpg",
"md5Checksum": "e7bb0cb361585f3845bd2a11e769c70b",
"size": "326467",
"quotaBytesUsed": "0",
"headRevisionId": "0BwYB7bTd8hGMd3A4WERUVHpuODNDdmM2MlZlNUNGQk9rc2hNPQ",
"imageMediaMetadata": {
"width": 460,
"height": 460,
"rotation": 0
}
}
I am getting an error on bundling my aurelia app.
Error is : Unable to calculate canonical name to bundle file
‘///twenty/two/2/.js’
Following is my Config.js content
"baseURL": "/src/",
"defaultJSExtensions": true,
"transpiler": "babel",
"babelOptions": {
"optional": [
"runtime",
"optimisation.modules.system",
"es7.decorators",
"es7.classProperties"
]
},
"paths": {
"*": "*",
"github:": "jspm_packages/github/",
"npm:": "jspm_packages/npm/",
"resources/": "resources/",
"account/": "account/",
"activity/": "activity/",
"dashboard/": "dashboard/",
"feedback/": "feedback/",
"home/": "home/",
"orders/": "orders/",
"shared/": "shared/",
"user/": "user/"
},
Following is the build/bundles.json
{
"bundles": {
"dist/app-build": {
"includes": [
"[*/**/*]",
"[*/**/*.html!text]",
"[*/**/*.css!text]"
],
"excludes": [],
"options": {
"inject": true,
"minify": true
}
},
"dist/aurelia": {
"includes": [
"aurelia-animator-css",
"aurelia-auth",
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-breeze",
"aurelia-dependency-injection",
"aurelia-dialog",
"aurelia-event-aggregator",
"aurelia-framework",
"aurelia-history",
"aurelia-history-browser",
"aurelia-http-client",
"aurelia-i18n",
"aurelia-loader",
"aurelia-loader-default",
"aurelia-logging",
"aurelia-metadata",
"aurelia-path",
"aurelia-route-recognizer",
"aurelia-router",
"aurelia-task-queue",
"aurelia-templating",
"aurelia-templating-binding",
"aurelia-templating-resources",
"aurelia-templating-router",
"aurelia-validation",
"babel",
"bootstrap",
"breeze",
"core-js",
"css",
"font-awesome",
"i18next",
"jquery",
"moment",
"ms-signalr-client",
"text",
"toastr"
],
"options": {
"inject": true,
"minify": true,
"rev": true
}
}
}
}
Please help me to figure out what is wrong.
I have saved checked nodes in cookies with this code:
$.cookie('q_cats', $("#category-tree").jstree("get_checked"), { expires: 7 });
I am loading my tree with this code:
$('#category-tree').jstree({
"plugins": ["wholerow", "checkbox", "search"],
"core": {
"themes": {
"responsive": false
},
"data": {
"url": "/blogs/get_cats/",
"dataType": "json"
}
}
});
I don't know how can check saved nodes in my tree
Why don't you use the state plugin - it does exactly that - restore state across refreshes / reloads. Just look it up, all you need to do is add a string to your config (plugins section):
$('#category-tree').jstree({
"plugins": ["wholerow", "checkbox", "search", "state"],
"core": {
"themes": {
"responsive": false
},
"data": {
"url": "/blogs/get_cats/",
"dataType": "json"
}
}
});