I'm having problems accessing cljs source-map files from inside the browser. It looks like it is trying to fetch them from a wrong url. E.g:
http://localhost:3000/js/main.out/cljs/main.out/cljs/spec.cljs
But it should be rather:
http://localhost:3000/js/main.out/cljs/spec.cljs
The main.cljs.edn in my boot-clj project looks like this:
{:require [myapp.core]
:init-fns [myapp.core/init]
:compiler-options {:asset-path "js/main.out"}}
Does anybody know how to fix this?
Related
I have a web application that uses enlive.
If I change an html file used by a template I don't see the changes unless I restart figwheel.
I am using ring.middleware.reload/wrap-reload like this:
(-> routes
(ring.middleware.reload/wrap-reload {:dirs ["src" "resources"]})
...
...but without any effect.
Note that if I change any .clj or .cljs file I don't have to restart the server.
Following the link given by Piotrek I found this project which fixed my issue: https://github.com/kolov/enlive-reload
The fix was to wrap the routes with (wrap-enlive-reload) and now everything works just fine.
I've got a project where a ton of PDF files were added right into the /public_html directory.
I've cleaned them up into a folder:
/public_html/external
Now, I've got links like this:
href = "/some-pdf-file.pdf"
I need to change them all using Regex (Joomla+ReReplacer) to:
href = "/external/some-pdf-file.pdf"
I'm willing to bet it's a simple one-line-regex command and I'm going to feel like an idiot once I see it.
Not 100% sure what the setup is, but here's a guess in JavaScript. Please adapt as needed.
source.replace(/(href\s+=\s+")([^"]*\.pdf)(")/, "$1/external$2$3");
Probably a bit overkill, but you get the idea.
I am desperately looking for a rule to achieve the following:
Input URL request would be:
http://myserver.com/param/other/folders/and/files.php
It should redirect to
http://myserver.com/other/folders/and/files.php?p=param
similarly the basic index request
http://myserver.com/param/
would redirect to
http://myserver.com/?p=param
All my php files need the parameter, wherever they are. It'd be nice if JS and CSS files would be excluded but I guess it doesn't really matter since the /file.css?p=param would just be ignored and not cause a problem. I have found rules to map a folder to the GET parameter but none of them are working for php files deeper than the index file on the root level. Thanks so much in advance
Replace
http:\/\/([^\/]+)\/(\w+)\/(.*)
with
http:\/\/\1/\?p=\2\/\3
example regex page at https://regex101.com/r/sU6lR9/1
i have problems in handling a simple html-link with the IWebBrowser2-Interface.
Image i navigate to an url like that
scheme://host:port/path.html
The file path.html contains html/javascript code that automatically links to another html file, that is located in an url like this
scheme://host:port/target.html
The first file is loaded fine. But once the IE handles the link from path.html the value of the url, which is passed as a parameter to the OnBeforeNavigate2-Handler contains a strange value looking like this
"about:target.html"
There is indeed the name of the file, that path.html linked to, but the whole
remaining part of the url is lost.
Does anybody has an idea how this inconvenience could be resolved?
Thanks in advance.
http://localhost/students/index.cfm/register?action=studentreg
I did not understand the use of 'register' after index.cfm. Can anyone please help me understand what it could mean? There is a index.cfm file in students folder. Could register be a folder name?
They might be using special commands within their .htaccess files to modify the URL to point to something else.
Things like pointing home.html -> index.php?p=home
ColdFusion will execute index.cfm. It is up to the script to decide what to do with the /register that comes after.
This trick is used to build SEO friendly URL's. For example http://www.ohnuts.com/buy.cfm/bulk-nuts-seeds/almonds/roasted-salted - buy.com uses the /bulk-nuts-seeds/almonds/roasted-salted to determine which page to show.
Whats nice about this is it avoids custom 404 error handlers and URL rewrites. This makes it easier for your application to directly manage the URL's used.
I don't know if it works on all platforms, as I've only used it on IIS.
You want to look into the cgi.PATH_INFO variable, it is populated automatically by CF server when such URL format used.
Better real-life example would look something like this.
I have an URL which I want to make prettier:
http://mybikesite/index.cfm?category=bicycles&manufacturer=cannondale&model=trail-sl-4
I can rewrite it this way:
http://mybikesite/index.cfm/category/bicycles/manufacturer/cannondale/model/trail-sl-4
Our cgi.PATH_INFO value is: /category/bicycles/manufacturer/cannondale/model/trail-sl-4
We can parse it using list functions to get the same data as original URL gives us automatically.
Second part of your URL is plain GET variable, it is pushed into URL scope as usually.
Both formats can be mixed, GET vars may be used for paging or any other secondary stuff.
index.cfm is using either a CFIF IsDefind("register") or a CFIF #cgi.Path_Info# CONTAINS statements to execute a function or perform a logic step.