Just a dump of handy live templates I use with IntelliJ. They should also work with WebStorm.
- Go to
settings. - Search for
live templates. - Under the javascript section you should be able to manage your templates.
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>JQM latest - issue template</title> | |
| <meta charset="utf-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link rel="stylesheet" href="http://code.jquery.com/mobile/git/jquery.mobile-git.css"> | |
| <script src="http://code.jquery.com/jquery-1.10.1.js"></script> | |
| <script src="http://code.jquery.com/mobile/git/jquery.mobile-git.js"></script> | |
| <script> |
| describe('e2e: main', function() { | |
| var ptor; | |
| beforeEach(function() { | |
| browser.get('/'); | |
| ptor = protractor.getInstance(); | |
| }); | |
| it('should load the home page', function() { |
| <!-- | |
| Responsive Web Design Basics | |
| https://developers.google.com/web/fundamentals/design-and-ui/responsive/ | |
| Use the meta viewport tag to control the width and scaling of the browser's viewport. | |
| Include width=device-width to match the screen's width in device-independent pixels. | |
| Include initial-scale=1 to establish a 1:1 relationship between CSS pixels and device-independent pixels. | |
| Ensure your page is accessible by not disabling user scaling. |
| // https://css-tricks.com/forums/topic/setting-a-div-height-to-the-window-viewport-size/ | |
| $(document).ready(function(){ | |
| resizeDiv(); | |
| }); | |
| window.onresize = function(event) { | |
| resizeDiv(); | |
| } |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Serialization; | |
| using System.Web.Http; | |
| using Vidly.Handlers; | |
| namespace Vidly | |
| { | |
| public static class WebApiConfig | |
| { | |
| public static void Register(HttpConfiguration config) |
| <connectionStrings> | |
| <add name="AW" connectionString="Data Source=.\sql2014;Initial Catalog=AdventureWorks2014;Integrated Security=True;" providerName="System.Data.SqlClient"/> | |
| </connectionStrings> | |
| <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"> | |
| <parameters> | |
| <parameter value="AW" /> | |
| </parameters> |
| <div id="remote"> | |
| <input class="typeahead" type="text" placeholder="Oscar winners for Best Picture"> | |
| </div> |
| // 1. Select a theme from bootswatch. | |
| // 2. Download the css to the Content folder and name it with the theme name. For example, bootstrap-readable.css. | |
| // 3. In solution explorer, show all files. Add the new file to the project so it's tracked in source control. | |
| // 4. Update BundleConfig.cs to use the new file. | |
| bundles.Add(new StyleBundle("~/Content/css").Include( | |
| "~/Content/bootstrap-readable.css", | |
| "~/Content/site.css")); |
| public static void Register(HttpConfiguration config) | |
| { | |
| // Configure json formatting so pascal casing in c# code will be | |
| // camel case for javascript. | |
| // Set formatting to Formatting.Indented | |
| var settings = config.Formatters.JsonFormatter.SerializerSettings; | |
| settings.ContractResolver = new CamelCasePropertyNamesContractResolver(); | |
| settings.Formatting = Formatting.Indented; |