Why do I have no 'custom' Directory at ~/.jupyter/custom? - javascript

I'm trying to add some custom Javascript to a Jupyter notebook by using the custom.js they provide. On their webpage, they say you can find the custom.js folder at ~/.jupyter/custom/custom.js.
However, when I look for the file there, I can't see it. I don't even have a custom directory. Instead, I see a file called migrated.
Weirdly, if I run Jupyter and go http://localhost:8888/custom/custom.js I can see the file, but it's not present in the folder.
What's happening here? Should I just create my own custom folder?

This worked for me.
Open a terminal and visit the path given in the documentation. Run:
> ls -a
To get a list of everything in the directory, the -a option includes hidden files. If the directory definitely isn't there, run the following commands:
> mkdir custom
> cd custom
> touch custom.js
In order, the first command creates the custom directory, the second command moves you into that directory, and the third creates the custom.js file within that directory.
To edit custom.js in your code editor of choice run:
> open custom.js
To edit custom.js directly in your terminal, run:
> vim custom.js
Hopefully, that solves the issue for everyone.

Related

Can I separate index.html and js bundle to different folders?

I need the following folder structure:
public
index.html
build
main.js
other.js
I have created simple demo, here is a link to github, so you can check the configs:
https://github.com/ArtemDomochka/dev-server
Problem: dev-server doesn't work
Details: If I will build the project with npm run build everything is good. But whenever I start dev-server with npm run start it doesn't work. May be dev-server changes file structure, but in browser I just get error: Cannot GET /, so it can't even find index.html
Is it possible to fix it?
There is also an interesting observation: If I will build project and then serve it, page will be loaded correctly, but it will not handle code changes in real time

Visual Studio Code - Source Control > 10k changes

Im new to programming as well as Git.
When opening a Git repository in Visual Studio Code that I created myself I've noticed my source control panel telling me that there is above 10k changes made, its in User/Gitfolder (MAC M1). Im the only one in this repository and haven't made any changes to it. What may be the problem?
When opening VSC I get a small warning window with the text "The git repository at '/Users/username' has too many active changes, only a subset of Git features will be enabled"
By some reasons git is tracking the files in your /user/username folder. In your file explorer enter in to '/Users/username' folder. From the view option in window ribon bar check 'hidden item' option. when all hidden items appears delete the .git folder.
[%WSL UBUNTU] Happened to me. I think when you opened your project in VS Code, you were in the root directory instead of a project folder further down your file system tree, so what you are seeing are the installations from your root folder being included in your VS Code workspace.
[If you need to rearrange your file system folders or create a projects folder, type 'explorer.exe .' in your linux terminal]
I would close VS Code instance, open your Linux Terminal and navigate to your projects folder: cd /home/'user name'/projects. Then type 'code .'
A new VS Code workspace will open in the right directory and the git will not include those root repositories
I ran into this issue just recently. It solved itself once I initialized the project folder as a git repository with the git init.
If it was already initialized make sure you are in the correct project folder and if you are then display the hidden files and delete the .git folder.

JavaScript React hiding source files in sources tab

I have recently developed a website, it's NodeJs (on Ubuntu) and running a React app. The problem is, for example, on Chrome; when you right-click on the website and check sources you can see the source codes and all the files. I want to hide all of them.
In this section, I want to hide the source codes (files) in the server.
I tried couple of solutions on the internet but none of them worked.
For example,
I've added "build": "GENERATE_SOURCEMAP=false react-scripts build", in package.json and then I did run pm2 reload (also yarn build etc)
I've created a file called .env and added this line GENERATE_SOURCEMAP=false in it.
None of them has worked. My website is currently active right now and I want to hide source files, how can I hide these source files from sources tab so people can't see the source codes?
After long research, I have found the solution.
Create a file called .env in your project. The name of the file is just .env.
In that .env file put this line GENERATE_SOURCEMAP=false and save.
Then, run npm run build or yarn build.
This will generate a build folder for production. After that, depends on what you are using, run this build file for running the website. For example, I'm using pm2 on my Ubuntu server, so I've used pm2 serve build 3000 --spa (my website is running on port 3000) Also be careful you are in the same path with the build folder.
That's it. Now all the source code files are gone and website works like a charm.

NPM live server won't load my project website

I'm new in using NPM. I wanted to load my project website in live server, but whenever I type live-server in the terminal, it only shows LISTING DIRECTORY (which is the list of all the files I have in my project website folder such as html, css, & script) instead of loading my project website. I tried to google it but found no answer. I don't know what to make sure or what to do about it.
If you don't specify a directory index somewhere (the default is a file named index.html) the server doesn't know what file you want to use as an entry point, so it'll just respond with a directory listing.
The docs say, you can add an index file by specifying the --entry-file command line parameter:
serve this file (server root relative) in place of missing files (useful for single page apps)
Just add the entry point to the startup script, by running
$ live-server --entry-point=PATH

Installing Firefox plugins issue

I am trying to install my own firefox plugin. I follow this tutorial. But each time this gives me following error:-
Firefox could not install the file at
file:///home/ubuntu/googbar.xpi
because: Install script not found
-204
That error means that your file doesn't have an install.rdf file. Please note that it needs to be at the top level of the XPI archive. So maybe you made a mistake packing the file and install.rdf landed in a subdirectory. You can check the list of files using unzip -l googbar.xpi command, it should list install.rdf without a directory name before it.

Categories