How to change "source mapped from " text in browsers? - javascript

I'm generating my JS files with typescript compiler API, and modifying the generated source maps to put relevant information in the source map (like the correct paths to the source code).
Currently, when I open a file in "Sources" tab in chrome. There's the text (source mapped from http://example.com/) in the bottom bar, it's incorrect because I expect there to be a link to the generated file clicking on which should show me the raw source in the sources tab.
So, is there a field I can add in source map files or is there any other way that I can see the generated file link in the "source mapped from" part?

Related

Plotly graph not showing up in rendered html

I made a notebook in VSC with some plotly histograms. They show up in VSC under the cell as expected. However when I convert to html with jupyter nbconvert --to html --no-input main.ipynb and then load the html file in my browser, those graphs don't show up. There is a missing place where they should be. I can see the div in the inspect window but they're just blank space. In the console I see
file:///C:/localpath/plotly.js net::ERR_FILE_NOT_FOUND
which is deriving from (among others)
h.load # require.min.js:34
The require.min.js is from https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js
I tried manually adding <script src="https://cdn.plot.ly/plotly-2.18.0.min.js"></script> to the html file after the title but before the <script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script>.
I can see in my network activity that it downloads that js file but then it still tries to download the local version. I searched the html file and there's no direct reference to plotly.js so it seems it's some interaction with that require.js
If I manually download https://cdn.plot.ly/plotly-2.18.0.min.js and save it to the same directory as the html file and rename it to plotly.js then it works but I don't want to have to do that because then it makes sharing the html file extra cumbersome.
How do I get the html file from my notebook to load the remote plotly.js instead of insisting on it coming from a local file at the same relative path?
I needed to change my renderer to notebook_connected
import plotly.io as pio
pio.renderers.default = "notebook_connected

VS Code - How to Hide Files' Paths in Search Palette

When I search for some keywords in my project using the Search palette, VS Code by default shows the path of each file beside the file in the search result section, as shown below (i.e., folder-one\folder-two):
How can I hide the paths? I googled and searched in the VS Code settings, but could not be successful.

How to download a canvas rendered pdf file opening in pdf.js?

I have zero knowledge with regard to coding. I desperately need to download a pdf file which is being shown in the fashion attached to this post. The download button is not working and I've tried everything which I can to download the file. Any help is welcome. Things which I've tried are
Finding file source in network tab under inspect element
Finding any URl leading to the pdf again in the inspect elements tab.
Saving the page as Html, upon which it downloads but never opens again with the pdf required.
Also in my limited research which I could make sense of was, the page used canvas element to render the pdf. Text of pdf is seen to be entered manually in a separate layer.
The address of the pdf being rendered is actually visible in the url on your image.
the ../../ means go up 2 directories.
So that means the absolute url for your pdf is this.
https://www.time4education.com/MoodlePages/catmttt/cat20materialvideos/VAHO1002103.pdf

Adobe Illustrator - Automate changing TrueType fonts to OpenType versions

I am trying to figure out a script (be it javascript or AppleScript) or anything that can change truetype fonts in multiple .eps files to the opentype (otf) versions of those fonts without having to do it in Illustrator manually for each file.
This is probably impossible or but any suggestions even if they don't do this exactly would be welcome.
This can be achieved using the following AppleScript, however you'll need to define a list of font mappings.
1. Example AppleScript
set fontMap to {{"Courier", "CourierPSStd"}, {"Baskerville", "BaskervilleMTStd-Regular"}, {"GillSans", "GillSansStd"}}
tell application "Finder"
set chosenFolder to choose folder with prompt "Choose a folder which contains the EPS files to process"
set epsFileList to files of entire contents of folder chosenFolder whose name extension is "eps" and creator type is "ART5" as list
my replaceFonts(epsFileList, fontMap)
end tell
on replaceFonts(epsFileList, fontMap)
tell application "Adobe Illustrator"
repeat with thisEpsFile in epsFileList
set user interaction level to never interact
open thisEpsFile as alias without dialogs
tell document 1
repeat with thisMap in fontMap
try
set text font of (characters of stories whose properties contains {text font:text font (item 1 of thisMap)}) to text font (item 2 of thisMap) of application "Adobe Illustrator"
end try
end repeat
close saving yes
end tell
set user interaction level to interact with all
end repeat
end tell
end replaceFonts
2. What does the script do?
It prompts the user to select a folder which contains the .eps files to be batch processed.
Each .eps file found in the chosen folder (including those in subfolders) are opened in Illustrator repeatedly.
Upon opening each file it finds all instances of a given font and replaces it with another given font.
Each file is saved, then closed before processing the next file.
3. What you'll need to do before running the script...
Unfortunately, there is no way for Illustrator to know which TrueType font should be replaced with which equivalent OpenType font. So you'll need to define which font should be mapped/replaced with which font yourself. To do this you'll need to define each font paring in the first line of code which currently reads:
set fontMap to {{"Courier", "CourierPSStd"}, {"Baskerville", "BaskervilleMTStd-Regular"}, {"GillSans", "GillSansStd"}}
This line of code, (a two dimensional Array), given it's current values informs the script to:
Replace any instances of "Courier" with "CourierPSStd".
Replace any instances of "Baskerville" with "BaskervilleMTStd-Regular".
Replace any instances of "GillSans" with "GillSansStd".
Tip: How can I find the correct names of fonts to create the fontMap array?
I suggest you launch Illustrator and run this very simple script from the AppleScript Editor:
tell application "Adobe Illustrator"
set fontNames to name of every text font
end tell
If you look in the Result panel in the AppleScript Editor you'll see a list of names for each font available on your computer.
4. Notes
The line of code on line 5 which reads;
set epsFileList to files of entire contents of folder chosenFolder whose name extension is "eps" and creator type is "ART5" as list
obtains the list of .eps files to process from the chosen folder. Currently any file found which has a name extension of "eps"and a creator type of "ART5", ("ART5" means it's created by Illustrator), will be included in the batch process. You may need to omit the part which reads:
and creator type is "ART5"
if your .eps files have not been created by Illustrator. However, the script may then attempt to process any bitmap .eps files too - (such as those created in PhotoShop).
Caution: This script currently saves any changes made to your files, so it can be quite destructive if you haven't defined the appropriate fontMap array. I recommend that that you run this on duplicates of your .eps files whilst testing and maybe omit the line of code which reads close saving yes until you're confident your fontMap is yielding the desired results

I cant find the icon that is placed in maps

I have a website.
http://shipm8.ship2you.co/contactus
I have to change the icon that is appearing on the map, but I don't know where that icon is located.Can anybody help?
view-source->main.js->http://shipm8.ship2you.co/images/marke‌​r.png
When you check page source (right click-> view source), you should find image URL there. If you can's see it, itis most likely it is served by JS from some file. My assumption was to check custom (not known library seen there) file and first one to check was main.js file. In that file you would search for block of code that is responsible for google map. Actually first logic thinking for you should be to check google map code - where is called, calculated, executed... So there you can follow URL for marker. I noticed it is relative URL and just being appended to base url it showed image as well.

Categories

Resources