So I have one local container that I want to use for the Remote-Containers support. But I can't seem to create a single default devcontainer.json to utilize this. Am I correct that it's a file per project or repository?
The idea is to have the devcontainer.json version-controlled in the repository, so that anyone checking the repo out can use the standard container configuration.
If you're cloning a 3rd party repo which you want to run locally in a container, you will need to create the config file yourself if it's missing.
If you find yourself in need of the same devcontainer config over and over again, consider submitting a pull request at https://github.com/microsoft/vscode-dev-containers.
Having said that, it should be straightforward to create the config. If you're going to use an existing Docker image it is as simple as creating a single file:
.devcontainer/devcontainer.json
{
"image": "local image name or remote url"
}
If you have a Dockerfile you want to build from, again it's a single option:
{
"dockerFile": "Dockerfile"
}
That's all you need. Fire Reopen in container VS Code command and you're set.
If you want to configure port mapping, or change the user you will need to add that of course, but anyway it will be quite minimal.
Related
I'm building an app in React Native. I want to include a field in the settings screen which displays the build version of the app. This is because I test the app on several devices (5 different ones at the moment). A build label would therefore be useful just to be sure what bundle I'm running. The build label will basically just state the date that the bundle was built. For instance 20181201 (which would be 1st of December 2018). I can quite easily just create a constant, and update the constant manually before building a bundle. However, this relies on me remembering to update that label. It would be nice if this label was automatically generated at the time of build. Any good suggestions as to how I could achieve this in React Native?
If you write the build number you want in:
Android - app/build.gradle versionCode property
iOS - ios/[APP_NAME]/info.plist CFBundleVersion property
You can use react-native-device-info.
Check out getBuildNumber method.
I use a json file that contains information about the build. This json file is then imported and its contents are used to make a footer on the settings page, this allows me to track which build is on which device.
Personally I use Bitrise to make my builds, so in my workflow there I have a step that runs a bash script that updates the json file with specific information. i.e. date and time of build, Bitrise build number etc.
Alternatively if you don't use a CI suite like Bitrise
For iOS you could use a Pre-action in Xcode and run a script that would update the json file when you create your archive. Edit schema... select Pre-actions and then add a Run Script.
For Android you could use a custom task as explained in this SO answer Execute a custom independent gradle task in android studio
I need to build like some sort of input where you can set an import/export default path. To demonstrate what I'm trying to build I will use Chrome's default download location as example.
If anyone have any idea how I can start tackling this it will be very helpful.
Btw, I want to build this with reactjs
UPDATE:
When you click on the CHANGE button it will open the file system where you can set the path where the downloads will go. I want to do exactly that. I'm building a report UI where you can export/import reports.
I have a selenium grid2 set up on an AWS instance, and I was wondering if there's a way I could view the logs on my local machine?
I understand I can visit: http://MyServerAddress/grid/console and view all of the nodes but I want the actual log.
Its a bit of a pain having to remote desktop to the server each time I want to view it.
I was thinking something like http://MyServerAddress/grid/log but alas, it doesnt seem to be an option.
There's nothing available out of the box. But you can build this on your own.
You would first need to enable logging for your Grid and have the logs dumped to a specific folder.
You would now need to build a custom Servlet and inject it into the servlet (See here for details on how to do it )
Assuming that your servlet is called "HubLogServlet", you should be able to access it via the link http://localhost:4444/grid/admin/HubLogServlet
You can refer to this LogServlet for a sample.
I am using socialengine as content management system, when i change the socialengine site to production mode it did not load the css file, I figured out that my $staticBaseUrl function is not returning the website name.
I manually added the path in default layout to load the css file, it works but a font family (centurygothic) is not loads. I am using SocialEngine's 4.2.4 version, please help.
I am using plesk panel for as hosting server.
If you use paths in your css file (theme_name/main.css or Modulename/externals/styles/main.css), you can use following way of indicating path:
~/application/..., where ~ will be automatically parsed and replaced by staticbaseurl.
Firstly no need to manually adjust the $staticBaseUrl in the layout. There is a setting in the admin panel (general settings) where you just specify what the URL is. This is commonly used to set the CDN URL.
Secondly, most of the CSS files in production get minimized and appended to each other, so you will only see one query similar to this: /application/css.php?request=application/themes/default/theme.css
Thirdly, if there is still an issue there may be a number of reasons. For example, are you using the http://example.com/home or http://example.com/index.php/home URL format?
I recently started to learn about AngularJS and came across WebStorm and the AngularJS plugin by John Lindquist. Started by creating a new project using the angular-seed project and imported to WebStorm using File -> Open Directory. My directory structure looks like this
Now when I try to Debug it I get a 404 error. If I move the file app/index.html to the root folder and adjust all URL's to begin with app then it works fine. Is there a way to keep the default folder structure without moving the index.html to the root folder and also make it work with WebStorm?
I am using WebStorm 6.0.2.
I use WebStorm 7, so there might be some discrepancy in comparison with version 6 that you're using, but the over-all functionality is the same.
Quick solution:
Open the file in the editor and right click in the code to access the context menu. Choose the "Debug" option, which should start a debug session pointing to the current page.
Configuration solution:
WebStorm supports configurations for setting up different debugging scenarios. From the "Run" menu, choose the "Configurations" option. Add a JavaScript debug configuration, and add the URL you want in the designated field within the dialog presented.
Then, when you initialize a debugging session (a general one, not one for a specific page), you're presented a small dialog that allows you to choose a debug configuration.
Maybe there are more options or ways to accomplish the same thing as well, but I've never really given it more thought. I hope this is a working solution for you, but if not there's alway the documentation. If you need further clarification with regard to my answer, just give me a comment.