code-snippets

set text to google+ share button

妖精的绣舞 提交于 2019-12-04 04:14:11
I'm creating a page which has a g+ share button, but I wanted to dynamically change the description of the content to share. to customize the share button I am using the snippet with Open Graph protocol. The solution I tried was the following, but it did not work correctly: <meta property="og:title" content="O Fabuloso Gerador De Lero Lero v3" /> <meta property="og:image" content="images/robot.png" /> <meta property="og:description" content="..." /> $('meta[property="og:description"]').attr('content',text); var shareButtons = $('div:first','section.share-buttons'); shareButtons.html('');

Missing snippet in visual studio

老子叫甜甜 提交于 2019-12-04 03:48:07
Same installation of Visual studio on two machines, but in 1 i cant find the snippet "propdp" for DependencyProperty ? I only have prop/propg, cant really understand why. Is there an addon i have to install? Came across this same issue myself today after a fresh install of VS2008 on Win7 64 All I had to do to fix it was to Go to Tools > Code Snippets Manager Select Visual C# from the drop down menu Click Add Select the NetFx30 directory containing the code snippets, in my case it was... C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC#\Snippets\1033\NetFX30 You should immediately be able

Create Snippet with variables in Atom

折月煮酒 提交于 2019-12-04 03:14:48
Is it possible to incorporate variables into snippets in Atom? This comes in handy with for loops for example, when you want to pre-fill spots that are about to come. The snippets.cson entry with java as a source I would imagine. Unfortunately it is not working. '.source.java': 'For-Loop': 'prefix': 'fori' 'body': 'for (int ${1:VAR} = $2; ${VAR} < $3; ${VAR}++) {\n\t$3\n}' Update 2016-09 This is now supported in Atom - please see the other answer for how to use it. I can't delete this answer since it is the accepted one... Old Answer The documentation for the snippets package has an example

Writing custom completions in Sublime Text 2

强颜欢笑 提交于 2019-12-04 01:12:40
Sublime Text 2 comes with many built-in completions/templates for common idioms. In C++, these include for loops with fields, etc - if I wrote vec and pressed tab, it would expand to std::vector<field> v; where field is a writeable field. Many of these are written in a style that I do not like or do not provide things that I would like them to, and some that I want to use do not exist. Is there a way to modify these built-in "completions" and write my own? I believe you're looking to customize the snippets . Go to Preferences --> Browse Packages --> C++ and make whatever changes you need :)

Dynamic code snippet c# visual studio

倾然丶 夕夏残阳落幕 提交于 2019-12-04 00:48:30
I am working on a WinForms project with some repetitive tasks everyday. So I thought creating code a snippet will help me out, but it works for fixed code only. I want to dynamically create a code snippet, according to control names and some condition. I want to add the code once the design part is done. I define the control names like intTextboxAge . The snippet should add auto validation for all textboxes, using the fuction defined below. There have to be different controls based on the control's name prefix (int, str, dou, dec). Like such: public void AutoCode() { int i=0; foreach(On all

Adding code snippet in Code Snippet Library (Xcode 10)

﹥>﹥吖頭↗ 提交于 2019-12-03 23:33:10
Recently when I was using Xcode 10 beta 3 , I tried to make a code snippet and add it to the code snippet library . But the drag drop cannot be done as the code snippet library is detached in Xcode 10 , and hides when I click on a code. How to add code snippet in code snippet library in Xcode 10? After some time found out. Select the code you want to add to library. Right-click on it and click on Create Code Snippet from the pop-up menu. Apparently upto Xcode 9.x.x, this option was not there. For Xcode 10 to make a Snippet, 1) Select the resign of code you want to reuse in future. 2) Click the

Escaping the $ character in snippets

女生的网名这么多〃 提交于 2019-12-03 17:58:08
问题 I find myself doing a ton of jQuery these days, so I started to abstract out some of the common things I do into snippets. I look forward to sharing these with the community, but I'm running into an issue right now. The literals in snippets are defined by adding dollar signs ($) around the name of the literal to delimit where the value you would like to provide will go. This is difficult because jQuery uses the dollar sign notation in order to use a lot of its functionality. What is the

Get namespace in a Code Snippet

99封情书 提交于 2019-12-03 16:38:38
The Microsoft link here lists three methods that we can use. But how do we get the current namespace? I see there is a similar question, but the answer to that is using Macros, which doesnt solve this specific question. The NameSpace() to do something like this: <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> <CodeSnippet Format="1.0.0"> <Header> . . </Header> <Snippet> <Declarations> <Literal> <ID>namespace</ID> <Function>NameSpace()</Function> </Literal> </Declarations> <Code Language="csharp"> <![CDATA[ $namespace$ ]]> </Code> </Snippet> </CodeSnippet> <

Useful Delphi code templates

本秂侑毒 提交于 2019-12-03 13:18:58
问题 I've been programming in Delphi for a little over two years now, and I've only got maybe 5 custom templates, I feel as though I should have more. If anyone has any particularly useful ones it would be great to have a nice repository of them here on stackoverflow. I don't care whether you use the Delphi 2009 syntax or Delphi 7, but if the code you'd be generating only works on a particular version, please mention that. 回答1: There are a handful of useful ones here, including a few based on

Which file does Snippets of Chrome Dev Tool saved at?

若如初见. 提交于 2019-12-03 13:07:28
As I know , personal data always be saved at profile path which can be find at chrome://version. I added many snippets in my Chrome Dev Tool, and want to backup them . But I cann't find a file that snippets data saved in under this path. Does anyone knows ? Plz tell me . Thanks very much! As of Chrome 47 (or so), snippets are no longer available via localStorage. Also, natchiketa's answer is dependent on localStorage and also doesn't work any longer. Below is the current technique: getting snippets InspectorFrontendHost.getPreferences(_ => console.log(JSON.parse(_.scriptSnippets))) setting