Run make in BBEdit on an .Rmd file - bbedit

I have a document (an RMarkdown document) which I am editing in BBEdit. I am also using a makefile to compile the final document and also do some other things.
At the moment, I have a terminal window open in which I run make html, but this requires me to switch to the terminal window and back.
Is there (and I am sure there is - I am new to BBEdit and only scratching the surface) a way of running make html from within BbEdit, preferably using a "per folder or project defined" command?

I can think of a couple of ways you might accomplish this.
Use a Shell Worksheet to run your make html command;
Write a #! (bash, Python, ruby, whatever) script to do the work, and place it in BBEdit's Scripts folder. BBEdit sets the environment up for #! scripts (you can read more about this in the manual), so your script could figure out what the appropriate directory is in which to run the make html, based on the path to the active document.

Related

VSCode - Automatically pick debugger

I have an Ansible workspace where I'm writing YML, PowerShell, and Python. Because of how things are set up where I work, I can't directly debug the YML files, so I need a custom launch configuration to run the files the way they are needed.
I'd love to just assign this to only YML extensions and leave the default debugger for Python and PowerShell files, as I switch between them quite often.
My current setup has a debug.ps1 file that will automatically switch between what it should launch based on the file that was debugged, but the Python files launch without the help of the Python debugger. I'd love for some way to either make that script launch the Python debugger, or make some sort of pre-debug task that tells VSCode what debugger to use.
Is there any way to do this?
Thanks!

My vs code python path has 2 different paths showing? one in white and one in blue

I am realizing the hardest part in learning to code is knowing how to even ask the right questions..
ill try and word it as best i can. I also will attach a screenshot.
I am running code in the terminal through VS code... and there is just so many files being shown every time i run the code. There is white and blue text that seems like the same thing? It makes it hard for me to see whats going on. Is there anyway to shorten or completely remove it? it seems 100% useless for just running some basic code.
The
C:/Program Files (x86)/Microsoft Visual Studio/shared/python37_64/python.exe
Is the Absolute path of the python executable.
And the
C:/PythonProjects/vscode/...../helloworld_start.py
Is the absolute path of the file that you are running.
Simple it is running
python helloworld_start.py
If you want to reduce this. You can simply open a terminal and change the directory to the current working directory and simply run the above command. This will use the relative path to run the helloworld_start.py file
First you need to add python to the Environment variables and then Open the terminal uin VSCode using Ctrl + ` and then cd to the current working directory and run python helloworld_test.py

Adding perl script to module distribution and making it accessible globally

I'm wondering if there is a tutorial or simple way to add perl scripts which I've written to be accessible to the user globally.
for eg. you apps like Carton, Cpanm, much like how npm has an npm install -g option.
I tried placing my scripts in the bin directory of my perl package but its not working.
The App::* area of cpan contains installable tools and utilities. Looking at a small one, like App::p I saw that its structure looked like it contained a Makefile.PL that used ExtUtils::MakeMaker to define how to build test and install the relatively small perl script.
However, if you're talking about just taking a script you wrote and making it something executable by you, the user, then it's basically the same way all scripting works (apologies if you weren't asking this):
One Unix, Linux and Mac OS X when using a shell like bash:
Any file can be made executable to the user by running chmod u+x filename
An executable file should start with a magic number, for plain text files containing scripts, the shebang is that number. So start your files with (as covered in man perlintro):
#!/usr/bin/perl
use strict;
use warnings;
When specifying an executable file from the command line you can type in the full path, possibly with conveniences from your shell. EG the file is at $HOME/myscripts/runme.pl you can type that at the prompt, the expanded /home/username/myscripts/runme.pl (/Users/username/myscripts/runme.pl on Mac OS X) or ~/myscripts/runme.pl at a bash prompt. Or if runme.pl is in your current working directory: ./runme.pl
If you just type runme.pl sh and bash and many shells will search your PATH variable in order and run the first runme.pl in any of the specified paths.
So if echo $PATH gives you something like: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin and you want the example in point 3 to work with just runme.pl you should
Either move the file into one of those directories (not recommended).
Or add export PATH=$PATH:$HOME/myscripts to the bottom of your ~/.bashrc or ~/.profile file or likewise for your preferred shell. Be sure to open a new login shell session, EG close that terminal window and open a new one.
On Windows, this is an exercise left to the reader. ☺

External editor for IPython notebook

I am using IPython notebook and I want to edit programs in an external editor.
How do I get the %edit file_name.py to open an editor such as Notepad++.
Running %edit? will give you the help for the %edit magic function.
You need to set c.TerminalInteractiveShell.editor, which is in your ipython_config.py. I'm not quite sure where this is located in Windows; on OS X and Linux, it is in ~/.ipython. You'll want to set the variable to be the full path of the editor you want.
Alternatively, you can create an environment variable EDITOR in Windows itself, and set that equal to the full path of the editor you want. iPython should use that.
I'm using Windows 7 and 8 (and 10TP) and Python 3.4.2.
I started with ipython locate to tell me where ipython thought config files suggested elsewhere should be. When I saw it was different I read around and came up with the following:
On my system, the ipython locate gave me c:\users\osmith\.ipython, not the _ipython you'll see mentioned in the YouTube videos done with Windows XP,
Look in the directory ipython locate specifies for a profile directory; if you aren't actively doing anything with ipython profiles, it should be .ipython\profile_default, if you are using profiles, then I leave it to you to s/profile_default/${YOUR_PROFILE_NAME}/g
Check the profile_default directory for a ipython_config.py file, if it's not there, tell IPython to initialize itself: ipython profile create
Open the config file in a text editor,
If you are the kind of person who hasn't messed around with their console overly much and installs things in standard places, you can skip straight to this step by typing: ipython profile create followed by start notepad .ipython\profile_default\ipython_config.py.
Search for the string c.TerminalInteractiveShell.editor,
The comment above this indicates you can also use the EDITOR environment variable, but hard coding file paths never hurt anyone so lets do eet:
Copy the line and remove the leading hash and spaces from the copy.
Replace the text between the apostrophes ('notepad') with the path of our desired editor, e.g.
c.TerminalInteractiveShell.editor = 'c:/program files (x86)/noddyeditor/noddy.exe'
There is a catch here, though; some modern editors get a bit fancy and automatically and, when invoked like this, detach from the console. Notepad++ and Sublime Text, for example. Sublime accepts a "--wait" option, which works some of the time; this tells the command invocation to hang around until you close the file, for some definition of until and some other definition of close.
However, the following setting will work most of the time for sublime text:
c.TerminalInteractiveShell.editor = '"c:/program files/sublime text 3/subl.exe" --wait'
(assuming c:\program files\ is where your sublime text 3 directory is)
Try the 'Pycharm' editor
This works for me.

Libreoffice Impress Export as Images extension does not work

Libreoffice Impress Export as Images extension does not work. "Export as Images" Menu is not being added to File Menu.
Link- http://extensions-test.libreoffice.org/extension-center/export-as-images
I am using Libreoffice 3.4. Any suggestions would be helpful.
Quick workaround: start the Export as Images macro manually. It's located under My Macros -> ExportImages -> ExportImages. Look for a macro named ExportAsImages and run it. Once found and started, it works fine :) (i don't know why it doesn't show up in the File menu).
EDIT:
Editing the macro is possible using the built-in IDE: once it's installed, you can access its LibreOffice Basic source using Tools-> Macros -> Organize Macros... -> LibreOffice Basic.
It's also possible to run it from the command line, but in its current form, it requires user interaction to specify the output file name and graphics format. So i assume it isn't possible to run it completely in "headless" mode without modifying the source. To run it from the command line on Linux, converting the file /tmp/mypresentation.odp, use:
$ simpress /tmp/mypresentation.odp "vnd.sun.star.script:ExportImages.ExportImages.ExportAsImages?language=Basic&location=application"