What is wrong with this regex for content_scripts? - regex

I dont want it to run on tv.sme.sk. Why it still keeps coming up there
"content_scripts": [
{
"matches": ["http://*.sme.sk/*"],
"exclude_matches": ["http://tv.sme.sk/*"],
"js": ["script.js"],
"css": ["style.css"]
}]

I've checked it on a minimal example and it looks like you found a bug in Chrome. Funny part is that only CSS is injected to tv.sme.sk, javascript injection works as expected and follows the exclude_matches setting. I've played with include_globs and exclude_globs options but no luck.
Your best option is to inject CSS using insertCSS method.
EDIT
Yepp, this is a known bug.

Related

Tailwindcss prettier plugin only affects css files

Ive installed the prettier-plugin-tailwindcss in my emberjs app. It runs and sorts the classes in my css files correctly but it doesnt touch the handlebars files. The standard prettier stuff still works in the handlebar files.
Ive tried adding a twConfig to the .prettierrc as suggested in the docs but that was unrecognised.
I'd really like to use this plugin but I need to support the handlebars files. Please let me know if anyone has any ideas on how I could solve this.
Here's my current prettierrc.yaml
# We use pretty much all defaults from Prettier https://prettier.io/docs/en/options.html
# We prefer single quotes to align with our internal RECONZ styleguide
singleQuote: true
twConfig: 'app/tailwind/config.js' // adding this throws this error below
// [warn] Ignored unknown option { twConfig: "app/tailwind/config.js" }.
overrides:
- files: '*.hbs'
options:
parser: 'glimmer'
# The Ember community uses single quotes in JS & double in templates
singleQuote: false
These are the versions I have installed:
"prettier": "^2.6.0",
"prettier-plugin-tailwindcss": "^0.1.11",
yarn: v1.22.17
UPDATE: the issue seems to be the parser which is set to glimmer When I tried with html instead the plugin worked but unfortunately I need to keep the parser as glimmer because html also causes some unwanted effects. Is there another option I could use?

Problems loading/using jsoup in ColdBox/Lucee

there are many posts on issues similar to mine, but none of them has helped. Not sure what I am doing wrong. I am trying to load the jsoup jar using this.applicationSettings, and I keep getting an error. Specifically:
Application.cfc:
this.javaSettings = {
loadPaths = [ ".\lib" ],
loadColdFusionClassPath = true,
reloadOnChange= false
};
Yes, jsoup-1.11.2.jar is in \lib for that application. I tried \lib\ too; no joy.
But every time I try to use
myJsoup = createObject("java", "org.jsoup.Jsoup");
or
myJsoup = createObject("java", "org.jsoup.Jsoup").init();
I get an error,
cannot load class through its string name, because no definition for the class with the specified name [org.jsoup.Jsoup] could be found
Does not matter what function I place the init code in -- handler or model -- or if I put it in a cfscript or cfset. I can even put it in index.cfm and still get the same error. Does not matter what I restart or how many times I restart it. It is as if ColdBox and/or Lucee just refuses to acknowledge the existence of the jar file or something. What gives?
I sure would appreciate any tips! Thanks in advance!
I'm not sure if this is just bad documentation out in the wild, a shortcoming of my own understanding or simply a bug in ColdFusion and Lucee...
I put together a simple test and recreated what you're seeing in both engines. I originally figured there must be an issue with paths in Lucee but ACF produces the same error.
Looking at existing code I use, it seems I always populate the full path to the JAR/Class files.
I often do something like this (which works) to load everything in the /lib directory:
this.javaSettings.loadPaths = directoryList(expandPath("/lib"));
Which in turn sets the value to [ "/mypath/lib/jsoup-1.11.2.jar" ].

How to highlight code in hbs template?

I want to introduce into my project some code to be highlighted on certain pages (like index.hbs) I've searched for libraries that can do this and found tools like highlight.js, but I was unable to use it in my ember project. Can anyone explain how to import a custom library like highlight.js or can someone give me a recomandation for a tool. I've tried to use this tool: ember-cli-eg-code-highlight, but it is not specified how to use it. Ok I have installed it, pasted the {{highlight-js code=file lang=language hasLineNumbers=hasLineNumbers}} in my index.hbs, but it does not work. Also the ENV.emberHighlightJs: { style: 'arta' };I have no ideea where to put it. Tried to put it inember-cli-build.js but it is not working.
I have found also markdown-code-highlighting. But I am lost at this step: "In your Brocfile you'll need to import the CSS styling you want for the highlighter. " So where exactly is my brocfile in my ember project?
Did you restart ember server ?
You can find example of using ember-cli-eg-code-highlight here: https://github.com/EmberGrep/ember-cli-eg-code-highlight/blob/master/tests/dummy/app/templates/application.hbs
But it looks like addon is buggy. So it worth to check this PR https://github.com/EmberGrep/ember-cli-eg-code-highlight/pull/9
P.S. about brocfile -- now it names as ember-cli-build.js at the root of project

How to link bigcartel subdomain to dugway barebones site

Hello I am trying to learn how to develop big cartel themes with the dugway api and I am having trouble linking to the subdomain of a companies current products. Per the documentation it says I need to put in the subdomain in the config file.
This is what I have tried so far, in the dugway.json file I have this "store": {
"subdomain": "kounterfitklothing"
},
and then restarting the dugway server. Once I do that and refresh the page I still see the dugway barebones page.
I also tried adding options[:store] = 'kounterfitklothing' to the config.ru file and nothing happens. Any help would be greatly appreciated.
I can confirm that with the latest version, inserting this into the dugway.json file will load the store properly (config.ru is no longer used for loading the store):
{
"store": {
"subdomain": "kounterfitklothing"
}
}
It could be ignoring the setting if you're missing the first set of open/close braces as well, so double check that - and make sure you're using the latest version of Dugway as well.
I figured it out, I didn't remove the comma after the curly brace.

How can I have HTML tab expansion in ST2 w/ Emmet inside Handlebars templates(emberjs)?

Okay, so I'm using Sublime Text 2 with Emmet. But "Tab" expansion of HTML snippets doesn't work inside a script because of the scope.
Example:
In HTML, I can type "h1" and then hit tab, and it will generate <h1></h1>
When using Ember.js, and more specifically Handlebars, it doesn't work.
<script type="text/x-handlebars">
h1
</script>
Pressing tab after that "h1" doesn't expand it because it's inside a script; Emmet turns this off. I can press Ctrl+E, which is the "expand anywhere" hotkey, and that works just fine. However, that is uncomfortable and prone to missing and hitting things like Ctrl+S or Ctrl+D which have undesired effects.
So, how can I change this?
I tweeted at the developer, and got a reply, https://twitter.com/chikuyonok/status/398708331969540096
But couldn't understand what to do.
In my opinion, he meant that you needed to change the scope for expand_abbreviation_by_tab. Please open Default (Windows/Linux/OSX).sublime-keymap, search expand_abbreviation_by_tab, add source.js in operand list. It makes it take affect in JavaScript file.
"command": "expand_abbreviation_by_tab",
"context": [
{
"operand": "source.js, source.css, source.sass, source.less, source.scss, source.stylus, text.xml, text.html - source, text.haml, text.scala.html, source string",
"operator": "equal",
"match_all": true,
"key": "selector"
},
I'll add further clarification here since this took me a while to find out:
Copy all of the two keys: ["tab"] objects from the Emmet default keybindings
Paste them into your User keybindings
Add source.handlebars as an additional operand to each of the two contexts.
This also works with Ember Syntax Highlighting when the handlebars files are being interpreted as Glimmer files.