- View: Also called a "template", a file that contains markup (like HTML) and optionally additional instructions on how to generate snippets of HTML, such as text interpolation, loops, conditionals, includes, and so on.
- View engine: Also called a "template library" or "templater", ie. a library that implements view functionality, and potentially also a custom language for specifying it (like Pug does).
- HTML templater: A template library that's designed specifically for generating HTML. It understands document structure and thus can provide useful advanced tools like mixins, as well as more secure output escaping (since it can determine the right escaping approach from the context in which a value is used), but it also means that the templater is not useful for anything other than HTML.
- String-based templater: A template library that implements templating logic, but that has no understanding of the content it is generating - it simply concatenates together strings, potenti
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Get Google Page Speed Screenshot | |
| * | |
| * Uses Google's Page Speed API to generate a screenshot of a website. | |
| * Returns the image as a base64 jpeg image tag | |
| * | |
| * Usage Example: | |
| * echo getGooglePageSpeedScreenshot("http://ghost.org", 'class="thumbnail"'); | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Image Preview</title> | |
| <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> | |
| <style type="text/css"> | |
| * { | |
| box-sizing: border-box; | |
| position: relative; | |
| -moz-box-sizing: border-box; |
Синхронизация настроек Sublime Text 3
Синхронизация настроек Sublime Text 3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- From this Fiddle: http://jsfiddle.net/HDakN/ --> | |
| <input type="text" id="phone" /> | |
| <p> 1) Use the jQuery Browser Plugin v0.0.6 | |
| </p> | |
| <p> 2) Use the Masked Input plugin for jQuery | |
| </p> | |
| <p> 3) Write this jQuery: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $('.tabber-menu a').on('click', function(e) { | |
| e.preventDefault(); | |
| var tab = $($(this).attr('href')); | |
| $(this).addClass('active'); | |
| $(this).siblings().removeClass('active'); | |
| $('.tabber-item').removeClass('active'); | |
| tab.addClass('active')(); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ymaps.ready(init); // когда апи готово, инициализируемя карту | |
| var customMap; // объявим переменную для карты | |
| function init () { // функция инициализации | |
| customMap = new ymaps.Map("contactsMap", { // создадим карту выведем ее в див с id="customMap" | |
| center: [56.8585970678523,35.919971999999994], // центра карты | |
| behaviors: ['default', 'scrollZoom'], // скроллинг колесом | |
| zoom: 18, // масштаб карты | |
| controls: ["zoomControl", "fullscreenControl"] // элементы управления | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Store the meta element | |
| var viewport_meta = document.getElementById('viewport-meta'); | |
| // Define our viewport meta values | |
| var viewports = { | |
| default: viewport_meta.getAttribute('content'), | |
| landscape: 'width=640' | |
| }; | |
| // Change the viewport value based on screen.width |