How do I configure an ultisnip to override an existing snippet? - vim

I use rails.vim but would like to override one or two snippets with my own using ultisnips.
I've created the snippets but since they're already defined by rails.vim a menu now appears when triggered. I'd like my snippets to override the existing one to avoid the menu.

The solution is to use priority directive. All snippets default to a priority of 0. Therefore, adding this to the top of my custom snippets solved the issue:
# top of custom snippets file
priority 1

Related

Prevent ReSharper removes the existing region while doing file formatting

I have a file layout that gonna apply when I reformat the code. It is doing well. However, I got some specific codes that I have a #region around them. The ReSharper would remove these existing #region and apply its pattern.
Is there any way to prevent that? I selected [Remove Regions] to None for the Pattern setting but it doesn't work.
Screenshot of the File Layout Setting
You have to ensure several things:
Set Remove Regions to None in the Default Pattern
Enable Apply file layout in the code cleanup profile of your choice
Check all other R# layers to make sure that your custom layout doesn't get overridden.
Doing all these checks, the region MyRegion doesn't get removed on code cleanup.

Two plugins extended the same block of smarty in backend(ExtJs)

Two plugins extended the same block of smarty in backend(ExtJs).
Both plugins are adding buttons in the toolbar of order listing. Separately they working correctly but if they installed together one of them only is showing.
I tried one of them prepend and 2nd append.
Solutions --- in overrided Ext.js component's method should call
me.callOverridden(arguments)
instead of
me.callParent(arguments).

Is there a way to ignore code style setting in Android Studio

As the title suggests, I would like to have a code style (for Kotlin) in place but ignore a specific rule (specifically "Chained method calls").
This rule should simply not apply when using the code formatting functionality and just let the developer judge on a case-by-case basis.
You should be able to achieve this with the following configuration inside
Preferences > Editor > Code Style > Kotlin:
You will also want to activate the setting to preserve your line breaks:

Changing Gantry v4 menu color

I can't seem to figure out how to change the menu color or add a background to the menu bar in Gantry 4 for Joomla. Tired of the gray or dark gray default.
I could change the font and selection through the .less file but not the menu itself.
The documentation on the Gantry website is too general.
Thank You in advance.
Also check: menu-light.less & menu-dark.less in the less\ directory.
The folks at RocketTheme don't recommend editing the compiled CSS (but it works great as #Adriana pointed out).
Hi Gantry framework for joomla as you probably notice uses Less to really understand how to change things on the template you first have to learn how less works even that Gantry compiles the less files for you. Less it is fantastic so it worth it. Basically you use a code to define css in a clever way much more economic and then you compile this into more efficient css files
If you change the compiled files as our friends are saying here make not sense at all because as soon you compile again (and you will) this files will be override and all your work lose.
I will give you the direction and you will see that it is not that difficult as look.
1- check the menu you had selected on your Gantry template under Templates Manager - Style - menu style.
2- on your less folder you will see a less file for each of the menu styles with the main variables
for example menu-dark.less try to make sense of the variables and the colors and change them to see what is what.
3- on the same folder you have menu.less and there is where the magic is done using the variables from the previous file. You will see that for example define first level of menu you will have something like:
&.l1 {
> li.active {
background: #menuActiveBack;
So that menuActiveBack variable will be the background value of the active li of the level 1.
4- the last part will be the menu-hovers.less that i thinks it is over complicate things because it is not a need to have a different file to do the hovers but there it is.
You can control CSS compression, Compile Wait Time and Debug Header, as well as manually clear the cache with the Clear Cache button at Extensions → Template Manager → gantry → Advanced → Less Compiler.
more info at: ganty less documentation
Hope it helps to start with....
Happy coding,
Eduardo
it took me a while maybe half an hour to go through the "menu" css file in the "css-compiled" folder.
You can find all the css to alter the background and colors of Gantry's default menu.. I'm using Gantry v4 also.
Go here:
Joomla>templates>gantry>css-compiled>menu-675c76.....
Please view my image to see my results:
http://dream2unite.com/images/misc/GANTRY-MENU-675c76.png
Use FireBug or similar to find the default CSS styling.
Create a file /templates/gantry/css/gantry-custom.css and add your own CSS to override the default CSS.
This is a better method than editing compiled or other template less or css files which can be overwritten during compilation or when the template is updated.

How to move private fields to the top of the class with ReSharper

I want to move all the private fields in a class to the top or at least to a block where they are gathered together.
Is there any quick way to achieve this with ReSharper?
You want the feature called Cleanup Code.
You can access it via
CTRL+ALT+F, according to my keyboard shortcuts, or
the window menu Resharper | Code | Cleanup code...
Ensure that your profile has the option Reorder members selected. If you want to change the way that the reordering works, you can, but it's a little involved.
You can also apply this across an entire project or the entire solution by right-clicking at the appropriate level in solution explorer and choosing the Cleanup Code... option from there.
I answered a similar question here. It's for putting them at the bottom, but should be enough information to get you set up too.
Have you tried the Clean code options?
I believe you can set the behaviour there.
Kindness,
Dan

Resources