how to add a custom file type in jupyterlab launcher? - jupyter-lab

I work with jupyterlab on daily basis and I would like to customize my launcher to add extra file type. Right now I need to create a new text file and then change the extention.
If anyone can help me add Yaml for example ?

Related

How to Create .wgetrc format file in Linux

Hi anyone knows how to create .wgetrc file on Linux? I want to add user credentials in this file for building Yocto image purpose. Any helps will be very appreciated.
Here’s a sample .wgetrc file and here’s some documentation on the possible values you can set in it. The file should exist in $HOME/.wgetrc, you can use any text editor to create and edit it.

How to add a Notebook (.ipynb file) to Launcher?

I would like to add a new specific notebook or a file in the Launcher tab instead of a kernel.
What kind of ways are there?

How to set default file extension of saving file for specific syntax in Sublime Text 3

The C++ standard doesn't rule the file extension, so the most of people use .cpp, but I prefer using .cc, how to tell Sublime Text save to .cc when using C++ syntax as default?
The way to change the default file extension shown by the save-as dialog when saving a file set to a specific syntax is to override that syntax's default .sublime-syntax file. In your case that would be the C++.sublime-syntax file.
Of course, as MattDMo points out, the easiest thing to do is to manually type the preferred file extension whenever you save a file. But for those that want to make the change, here's how to do it.
Open the Command Palette and select View Package File.
Type C++ and then select C++/C++.sublime-syntax. ST will open the file.
Near the top you should see file_extensions: and a list like this:
file_extensions:
- cpp
- cc
- cp
- cxx
- c++
...snip...
ST uses the 1st item in the file_extensions list as the default file extension for the save-as dialog.
To make .cc the default extension instead of .cpp, edit the list order so that - cc is the 1st item and - cpp is 2nd, i.e. swap the top 2 lines around.
Now save the file in your ST config Packages directory with this path: ../Packages/C++/C++.sublime-syntax. If you like you can create a C++ directory in Packages and then just use Ctrl+S to save because the path will have been automatically set by ST but the file won't save unless the ../Packages/C++/ directory already exists.
Note: The full path on a Linux machine would be like this: /home/user/.config/sublime-text-3/Packages/C++/C++.sublime-syntax
The Package Resource Viewer plugin's Open Resource Command Palette command could be used to extract .sublime-syntax files instead of ST's native View Package File command. That plugin will automatically create the appropriate Packages directory when necessary.
Your altered Packages/C++/C++.sublime-syntax file will now override the default version that is shipped with ST. You can reverse this easily simply by deleting the file. It is safe to delete the directory as well if you are not overriding any other files in the same directory.
The only problem with this is when you install a new version of ST. If the newly installed version has an updated C++.sublime-syntax file, the local one you've created will continue to override the new one. To get around this delete your altered Packages/C++/C++.sublime-syntax file when you install a new version of ST and repeat the steps above to restore your preferred default file extension once the installation has been done.
Unfortunately there is no way around this, you can not partially override the C++.sublime-syntax file with just the file_extensions: section. Of course new versions of ST don't come along very frequently and the C++.sublime-syntax file gets updated even less often. So this is not a major issue.

Where are the default packages in Sublime Text 3 on Ubuntu?

I'm migrating from Sublime Text 2 to 3. In Sublime Text 2, I changed a lot of the default settings of the editor -- such as the tab bar height, sidebar color, etc. -- by modifying the Default.sublime-theme file in sublime-text-2/Packages/Theme - Default. I was also able to modify the colors of the default color schemes in a similar fashion. I've been trying to figure out how to do this for Sublime Text 3, but can't seem to find these files. ~/.config/sublime-text-3 only seems to contain overrides for user settings, not the default settings.
This link on the Sublime Text forums seems to give the location for Windows and Mac, but not for Ubuntu. I've searched a bit to no avail. Does anyone have suggestions?
Thank you!
To amplify on #skuroda's answer - ST3 contains all of its data that, in ST2, was stored in Packages/PackageName, in PackageName.sublime-package files that are basically just zip files, or "Resources" as they're now known. Using PackageResourceViewer, you can easily edit the individual files contained within the resource, then save it back again. When saved, the proper directory structure under Packages/PackageName will be created, allowing you to edit the file directly next time. The way file precedence works in Sublime, any file that exists in ~/.config/sublime-text-3/Packages/PackageName/ will override any file of the same name stored in PackageName.sublime-package.
However, since you don't want these files to be accidentally overwritten, I would suggest creating ~/config/sublime-text-3/Packages/User/Themes/ and User/Color Schemes directories and storing your customized files there instead. The User/ directory is protected from overwrites during upgrades, etc., and unless you're planning on creating a customized theme or color scheme for redistribution through Package Control, it's best practice to keep your files in there.
EDIT
I just realized you hadn't gotten an answer to your original question - where are the files stored? If you installed the .deb file from sublimetext.com, all the .sublime-package files are in /opt/sublime_text/Packages.
If you want the easiest way to save your customized settings first copy all the default settings and paste into a new file named Preferences.sublime-settings.
Then make your changes and save the file to:
/home/**username**/.config/sublime-text-3/Packages/User
In order to see the .config folder you will have to enable show hidden files.
The instructions are written at the top of the default settings list in case you are wondering where got this from.
In the ST console, try entering sublime.executable_path(). This should get you close to where you need to be. Also, you should copy the content of the file out and move them (under a new name to the packages folder). You probably don't want your modifications to be reverted on subsequent update. An alternative method is to try overriding the files you need to. I haven't done that for theme files, so I'm unsure if everything will work as it should. If you take the override route, I'd recommend using PackageResourceViewer. I wrote it to help with browsing/overriding package files in ST3.
You can use
dpkg -L <package name>
For example
dpkg -L subli<tab>
Just open up sublime text, hit ctrl+` to open sublime text console, then run these command accordingly
sublime.packages_path() to see user installed packages directory
sublime.installed_packages_path() to see zipped packages (with .sublime-package file type) directory
Mostly likely, you'll find the Default package inside zipped packages directory.
You can use PackageResourceViewer to see zipped packages's contents as #MattDMo suggested, but more over, you can actually extract zipped packages into user installed package directory directly using PackageResourceViewer's extract command.

Setting up an icon for start menu folder group in InnoSetup

To my surprise I did not find the solution how to set up an icon for the start menu application group folder laying ahead. I am looking for the automatic solution in InnoSetup script.
Thank you in advance.
Create the desktop.ini file with the content like this if you want to use the *.ico as a resource (where c:\somepath\icon.ico is path to your icon):
[.ShellClassInfo]
IconResource=c:\somepath\icon.ico,0
Or create the desktop.ini file with the content like this if you want to use the icon from the executable as a resource (where c:\somepath\program.exe is path to your executable):
[.ShellClassInfo]
IconResource=c:\somepath\program.exe,0
Save this desktop.ini file into the directory where you want to apply the icon. One very important note, you have to set to this newly created file attributes Hidden and System, otherwise it won't work!
So please check very carefully if the InnoSetup won't clear these attributes if you'll have the file included in your setup package while installing.

Resources