How can I auto-insert a comment header in Coda? - comments

Whenever I create a new file, I would like to be able to include a comment header that has me as the author and some copyright info. How can I automatically generate this?

You could create a "Clip". A clip is basically a pre-defined snippet of code that can be quickly inserted.
The Clips button is along the bottom of the Coda window next to "Hints".
Clips make it really easy to insert a block of code quickly (like <!Doctype ...>).

Related

Can you sort the code snippets table?

In Xcode 5, can you sort the list of code snippets?
I've made one of my own and it's down at the bottom. I'd rather have it be up at the top.
One cannot automatically sort the snippets. One can go into the snippet file and reorder the snippets. System snippets are always presented first so to move a user snippet to the top one would copy the data for the snippet between the dictionary tags (....) to the top of the system snippets.
How to do it
Be advised that it is likely one would lose the ordered snippets when Xcode is upgraded so this should be considered but here is the way to force the issue:
Backup the affected system snippet file
(/Applications/Xcode.app/Contents/PlugIns/IDECodeSnippetLibrary.ideplugin/Contents/Resources/SystemCodeSnippets.codesnippets)
for safety
User snippets are stored as a series of xml files located in the
following directory ~/Library/Developer/Xcode/UserData/CodeSnippets/
Create a user snippet
Go to the user snippets folder and open the file just created with a
text editor (these are just xml files so TextEdit, TextMate, et al
will do)
Copy the user snippet between the ... tags
Paste the user snippet data into the system snippet data at the top
Why you should avoid doing it
Changes will likely be lost when Xcode is updated
You can and should create a shortcut that will allow you to type the
entire snippet into code easily
Your title of the snippet is also searchable (making the snippets easy to find)
What is the alternative
I suggest you open an enhancement request at http://bugreport.apple.com to ask Apple to make a sort option available.

how to disable tag validation in ckeditor?

CKeditor apparently automatically creates matching end tags when you enter a start tag. Is there a way to turn this behavior off?
I have a situation where I am creating two blocks of text in an admin program using CKeditor, then I'm using these to paint a page with the first block, some static content, and then the second block. Now I've got a case where I want to wrap the static content in a table. I was thinking, No problem, I'll just put the <table> tag in the first block and the </table> tag in the second block, and the static content will be inside the table. But no, CKeditor insists on closing the table tag in the first block.
In general, I can go to source mode and enter HTML directly, but CKeditor then decides to reformat my tagging. This seems to rather defeat the purpose of having a source mode. (I hate it when I tell the computer what I want and it tells me, No, you're wrong, I know better than you what you want!)
CKEditor produces valid HTML. Valid HTML has to include both - start and end tags. There's no way to change this behaviour without hacking editor. Note that even if you'll force editor to produce content without one of these tags it will then try to fix this and won't do this as you expect. E.g. load:
<p>foo</p></td></tr></table>
And you'll completely loose this table so only regexp based fix on data loading could help. In the opposite case:
<table><tr><td><p>foo</p>
You'll end up with paragraph wrapped with table, so it's better. But what if someone would remove this table from editor contents?
Therefore you should do this integration outside editor - prepend table to contents of one editor and append to contents of second one. You simply cannot force editor to work on partial HTML.

CKEditor: insert HTML from clip-board at current insertion point in WYSIWYG mode?

It seems that to insert HTML into the source code in CKEditor one must view source, then scan down through the code to find the appropriate insertion point.
I have a situation where the user will have HTML in their clipboard, but will not be HTML proficient, and will have a tough time understanding where in the source they need to insert the clip of HTML
SO: Is there a way to get CKEditor to paste, into the source code, whatever is in the user's clipboard at the current insertion point while in WYSIWYG mode?
Would this require developing a plugin? If so, could anyone someone provide a high-level overview of how that would be done?
use the Embed Media plugin which is available.
Just add that plugin. Using that the user can paste the html code in a dialog box and that will be pasted in the editor wherever the cursor was.

Which file should I edit to change the breadcrumbs starting point?

I wanted to change the breadcrumbs starting point from Home to My title. I edited the file /magento/app/code/core/Mage/Catalog/Block/Breadcrumbs.php but it doesn't seem to be working. Is XML playing a role in that?
thanks
Your best option is to use Magento's translate feature. Notice how the text in Breadcrumbs.php is wrapped with ->__('text') which instructs Magento to see if there is a translation for text for the current module. If you turn on Translate Inline in System>Config>Admin>Developer, you will be able to edit the text on the page (after refreshing, click the red box then the little book icon). This will then be entered into the database in the core_translate table and replaced in future page renders.
As a general rule, you should never edit files in app/code/code as you will break future upgrades and patches.
turn on Translate Inline in System>Config>Admin>Developer, you will be able to edit the text on the page (after refreshing, click the red box then the little book icon)

FPDI, how to remove automatic page counter

I'm using FPDI together with TCPDF to add a page to a already existing PDF-file. This works great, but I have one problem. When I output the new PDF I get an automatic page counter in the lower right corner, "112/299" for example. I find no documentation in FPDI or TCPDF about this automaticly generated page counter.
This problem only occurs when I put the file through FPDI, which narrows it down to FPDI I suppose.
My question is: How do I remove this god awful page counter in the bottom right corner of every page in my FPDI-generated PDF-file.
Thankful for answers.
I solved it, finally. The thing was, TCPDF puts default headers and footers on every page it generates, you can disable this with;
$object->setPrintHeader(false);
$object->setPrintFooter(false);
The thing was, I use FPDI to concatenate two PDF-files into one. To do this, you have to iterate over every page in both of the files you want to put together, and then finally add all these pages to a new PDF-file and output it.
So the solution was disabling the header and footer in every page sent to the new PDF-file, in the object it self who iterates over this. Just use;
$this->setPrintHeader(false);
$this->setPrintFooter(false);
If you're using PHP of course, otherwise you'll figure it out!

Resources