Neovim packer - can't get vim-prettier to load by filetype - prettier

I'm trying to load vim-prettier to load in packer.nvim by file type, but must be doing something wrong. My packer config looks like:
use {
'prettier/vim-prettier',
run = 'yarn install',
ft = {'javascript', 'typescript', 'css', 'less', 'scss', 'graphql', 'markdown', 'vue', 'html'}
}
However, when I load a javascript file, and try to run :Prettier, I get the result: E492: Not an editor command: Prettier
If I remove the ft part of the config, prettier is loaded for everything, which I'm trying to avoid. Is there another part of the config I'm missing to make ft load the opt plugin correctly?
Thanks!

Related

docusaurus fails to find images after build

I have a Docusauris site that works fine when in development mode, served using npm run start. My docs pages (e.g. docs/GettingStarted.md) include images such as:
<img src="/images/Buttons.png" width="400"/>
which are displayed properly when using the development server.
However, if I now run npm run build and npm run serve, the images are not found. The build process should have changed the URL to, e.g. assets/images/Buttons.png, but it didn't; it remains unchanged as /images/Buttons.png.
It is possible that this arises from a bad docusaurus.config.js. The docusaurus directory is at http://localhost/prsm/doc/help and I am looking at the served pages at http://localhost:3000/prsm/doc/help/
The docusaurus.config.js config has the lines:
const config = {
title: 'PRSM',
tagline: 'Participatory System Mapper',
url: 'http://localhost',
baseUrl: '/prsm/doc/help/',
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
favicon: '/images/favicon.ico',
...
What am I doing wrong?
What I should have done is read the documentation even more closely. The correct syntax for what I was trying to achieve is:
<img src={require("/static/images/Buttons.png").default} width="400"/>

How to make packer generated ova file work with vCenter?

I built an ova file using packer. I am using virtualbox-iso builder
source "virtualbox-iso" "test" {
.
.
.
}
But when I try to import the ova in vcenter, it gives me the following error:
Issues detected with selected template. Details: - -1 VALUE_ILLEGAL:
No supported hardware versions among [virtualbox-2.2]; supported:
[vmx-04, vmx-07, vmx-08, vmx-09, vmx-10, vmx-11, vmx-12, vmx-13,
vmx-14, vmx-15, vmx-16, vmx-17, vmx-18, vmx-19].
looks like this is a common problem. I found a few docs related to this. Most of them are talking about using external tools to fix this like OVFTOOL and then to edit the OVF XML file in the OVA package.
https://tutorials.technology/tutorials/How-to-create-a-vmware-OVA-from-a-virtualbox-ova.html
Is there any packer configuration that fixes this issue?

aws devicefarm python upload apk - android_app_aapt_debug_badging_failed

I am uploading the APK using python code, when I check for status after create_upload and uploading the actual file then I keep getting FAILED with android_app_aapt_debug_badging_failed. Any Idea why ?
Sorry to hear that you are running into issues with the upload.
For the error code you are facing, i am pasting the debugging steps below
Debugging Steps
During the upload validation process, AWS Device Farm parses out information from the output of an "aapt debug badging " command.
Make sure that you can run this command on your Android application successfully. In the following example, the package's name is app-debug.apk.
Copy your application package to your working directory, and then run the command:
$ aapt debug badging app-debug.apk
A valid Android application package should produce output like the following:
package: name='com.amazon.aws.adf.android.referenceapp' versionCode='1' versionName='1.0' platformBuildVersionName='5.1.1-1819727'
sdkVersion:'9'
application-label:'ReferenceApp'
application: label='ReferenceApp' icon='res/mipmap-mdpi-v4/ic_launcher.png'
application-debuggable
launchable-activity: name='com.amazon.aws.adf.android.referenceapp.Activities.MainActivity' label='ReferenceApp' icon=''
uses-feature: name='android.hardware.bluetooth'
uses-implied-feature: name='android.hardware.bluetooth' reason='requested android.permission.BLUETOOTH permission, and targetSdkVersion > 4'
main
supports-screens: 'small' 'normal' 'large' 'xlarge'
supports-any-density: 'true'
locales: '--_--'
densities: '160' '213' '240' '320' '480' '640'
I was having this exact issue, and none of the suggestions were doing any good.
The fix was to assign the file to data instead of files.
def upload_app(path):
url, arn = create_signed_upload('ANDROID_APP')
headers = {'content-type': 'application/octet-stream'}
with open(path, 'rb') as app:
requests.put(url, data=app, headers=headers)
success = wait_on_upload(arn)
return success

Compiling Compass in an Ember-CLI project

I'm using ember-cli v0.0.23, and am trying to get the broccoli-compass package working with my project, and I've run into some problems.
First, in my Brocfile, I have replaced the standard Ember-CLI "blueprint" version of:
var styles = preprocessCss(appAndDependencies, prefix + '/styles', '/assets');
with the following:
var compileCompass = require('broccoli-compass');
var styles = compileCompass(appAndDependencies, 'app/styles/app.scss', {
outputStyle: 'expanded',
sassDir: 'app/styles',
imagesDir: 'public/images/'
});
However, when I run an ember build, I receive the following output:
$ ember build
[broccoli-compass] Error: Command failed: Errno::ENOENT on line ["155"] of /Library/Ruby/Gems/2.0.0/gems/compass-0.12.6/lib/compass/compiler.rb: No such file or directory - /Users/gaker/Sites/project/tmp/tree_merger-tmp_dest_dir-GrWa8Zva.tmp/app/styles/app.scss
Run with --trace to see the full backtrace. The command-line arguments was: `compass compile app/styles/app.scss --relative-assets --sass-dir app/styles --output-style expanded --images-dir public/images/ --css-dir "../compass_compiler-tmp_dest_dir-eFsq51BG.tmp"`
If I try to run the compass command that is output in the error in my terminal, it does create the file, only it is up one directory from my project root (notice --css-dir in the output).
I have tried many combinations of options sassDir, imagesDir, etc when calling compileCompass and this is the closest I've gotten.
So any ideas on what I can do to successfully get compass, broccoli-compass and ember-cli playing nicely?
Thanks in advance
You can use ember-cli-compass-compiler addon to compile compass in ember-cli apps.
Just do the following in your ember-cli app:
npm install --save-dev ember-cli-compass-compiler
This is all you need to do, everything works as expected from now on. It compiles your appname.scss file into appname.css on ember build or ember serve command.
Try this (added prefix and cssDir):
var compileCompass = require('broccoli-compass');
var styles = compileCompass(appAndDependencies, prefix + '/styles/app.scss', {
outputStyle: 'expanded',
sassDir: prefix + '/styles',
imagesDir: 'public/images/',
cssDir: '/assets'
});
Steffen

Embedding python error Import by filename is not supported

I'm trying to embed python in to my application and have got stuck pretty early on.
I am embedding python into my C++ application and using the code found at this tutorial:
http://docs.python.org/2/extending/embedding.html#pure-embedding
My application matches entirely and compiles successfully no errors. However on running the application pModule = PyImport_Import(pName); line fails returning 0 meaning I get error output from PyErr_Print() of
Failed to load "C:\Users\workspace\dpllib\pyscript.py"
ImportError: Import by filename is not supported.
The application is being called with the commands C:\Users\workspace\ndnlib\pyscript.py multiply 50 150
I can't be sure, but I'm thinking that since pName is set to argv[1] and you're using the full path to call the script, then argv[1] is the full path. This means the code would try to import "C:\Users\workspace\dpllib\pyscript.py", which python can't (it can only import "pyscript").
Try running the script by just typing "pyscript.py" from within the directory and see if the error changes to 'Failed to load "pyscript.py"'. If it does, then you have to fix it so it doesn't just import argv[1] and modifies the string to get a module name instead of a file name.
It is simplier if you create your file as a module.
For instance,
create this:
<project>/MyModule/__init__.py
Then run your file <project>/script.py
dyn_module_name = (... get module name 'MyModule' from console arguments ...)
my_dynamic_module = __import__(dyn_module_name)
Since it would be a module, it will load while your scripy.py execution