Datagrip comment header hotkey - datagrip

At my company I'd like to create a standard for the creation of database functions with a comment header, something like:
/*
==================================================
Author: John Doe
Created At: (Automatically fills in current date)
Where used: User fills in URL or whatever
==================================================
*/
Is there a way in data grip to bind this text to a hotkey?

Yes, of course: snippet functionality is called Live Templates.
Open Settings
Go to Live Templates
Create a new template with an abbreviation, say, 'com'.
In editor type 'com' and press Tab.
PS. Play with the variables for the placeholders.

Related

Hyperlink in an Xcode Comment

I am adding a hyperlink into the comments for my code for future reference. The hyperlink is being added by copying the url from Safari and then pasting it into Xcode.
The problem is that I can't control the hyperlink now that it has been pasted into my code and it is being modified when additional text is added.
Example URL: https://link.to.resource/DID/
How I want the link to be displayed: Device ID (listed in https://link.to.resource/DID/.)
How can I add the additional text without modifying the link location? When I add ./ to the end, it becomes part of the link and the address no longer works.
The simplest solution is to include a space or closing paren at the end of the link.
You can also use comment markup to add a link to Xcode's Quick Help Documentation.
/// Device ID (listed [here](https://link.to.resource/DID/))
This will create a quick help description that looks like this:
If you are really set on a period at the end of the link, you can add it inside the [] at the end of the link text. This is what Apple does in one of their examples for link markup. This adds a period at the end, but the period is styled as part of the link text.
/*:
For more information, see [The Swift Programming Language.](http://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/)
*/
Apple's Link Markup Documentation: https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_markup_formatting_ref/Links.html#//apple_ref/doc/uid/TP40016497-CH18-SW1

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.

Cannot add inline image/picture to a Rich Text control

I have a Rich Text control bound to a Body field in my Domino Document data source ... all is good for formatting text , :) emoticons and the usual stuff. The problem is when I try to paste or upload an inline image I get the following error shown in the inline image (hmmmm, works here) ...
Most likely a mis-understanding of the steps:
Select the file
Click on upload image (<-- that one gets lost on lots of users)
Click OK
For a more advanced user experience:
Use the RichText Editor Evolution from OpenNTF. That makes your life much easier.

How can I preview Virtuemart2 Order verification email layout changes?

I am trying to change the layout ( css/html structure) of Virtuemart 2 order verification emails. Problem is that I have to make a fake purchase each and every time I do a change in the 10 different files (located # components/com_virtuemart/views/invoice/order/tmpl) that create this email template.
The closest "preview" I got was this direct access url "http://domain.com/index.php?option=com_virtuemart&view=invoice&layout=invoice&format=html&tmpl=component&virtuemart_order_id=1401"
But again it loads Joomla's head/body elements not the actual email template.
So how can I have a "preview" of how the template looks like with my new changes BEFORE make an actual test purchase? Is this possible?
You shouldn't change the core files otherwise the next update of VirtueMart (of which there are many) will erase your changes.
You should use Joomla!'s template overrides which VM2 supports that way you can update as needed to new versions without loosing your changes. See this article on docs.joomla.org on "How to override the output from the Joomla! core" and this one on template overrides.
3. You need to add the &format=raw at the end of the link to retrieve just the output of the component with out the template/html body wrapped around it. Of course that relies on the component as well.
I was going to suggest using raw, but looking at the current VM2 it doesn't properly support the format=raw option. Looking at the mail layout in the invoice view it not structured to return it the way you expect, it actually generates a HTML version by default with a matching text only version.
The best I could come up given those two options
Return a close equivalent of the HTML email
http://domain.com/index.php?option=com_virtuemart&view=invoice&layout=mail&virtuemart_order_id=1401&tmpl=component
Return the text version, albeit wrapped in the html page... you may have to view the source to see your invoice text.
http://shop.craigphillips.biz/index.php?option=com_virtuemart&view=invoice&layout=mail_raw&virtuemart_order_id=4&tmpl=component

OpenXML: Allow editing of Content Controls in locked Word document

I want to create a Word document that works as a template, where all the document is locked from editing except the Content Controls (<sdt/> elements) in the document that the user can edit.
What I've seen is that if I lock the document edition (right now I'm using the _markAsFinal property) there's no way to unlock a single Content Control.
Am I missing something? Or is this by design?
In your settings.xml file, you'll want under <w:settings/> an element like this:
<w:documentProtection w:edit="forms" w:enforcement="1" w:cryptProviderType="rsaFull"
w:cryptAlgorithmClass="hash" w:cryptAlgorithmType="typeAny" w:cryptAlgorithmSid="4"
w:cryptSpinCount="100000" w:hash="UrgUnH3e8g+JF+pZ0azudEQQUYY="
w:salt="dKkOT11EOm/O3alLt8NBbQ=="/>
The hash and salt you'll need to set on your own, you can refer to the Ecma specs and implementation notes for those details, but this is a really good tutorial to just jump right in. But what this does is limit all editing to only content controls.

Resources