###Custom Post Types
function codex_custom_init() {
$labels = array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
| // Simple | |
| array.sort(function(a,b){ | |
| a = new Date(a.date); | |
| b = new Date(b.date); | |
| return a<b?-1:a>b?1:0; | |
| }); | |
| // Generic | |
| (function(){ | |
| if (typeof Object.defineProperty === 'function'){ |
###Custom Post Types
function codex_custom_init() {
$labels = array(
'name' => 'Books',
'singular_name' => 'Book',
'add_new' => 'Add New',
| // Modules | |
| var shoppingModule = angular.module('ShoppingModule', ['moduleDependency1', 'moduleDependency2']); | |
| // Controllers | |
| shoppingModule.controller("HomeController", ["$scope", "$resource", | |
| function($scope, $resource) { | |
| } | |
| ]); |
| //************************************************************** | |
| var Vehicle = (function(){ | |
| function Vehicle(model, year, engineSize) { | |
| this.model = model; | |
| this.year = year; | |
| this.engineSize = engineSize; | |
| var engineIsStarted = false; | |
| this.isStarted = function () { return engineIsStarted; } | |
| this.start = function () { engineIsStarted = true; } | |
| this.stop = function () { engineIsStarted = false; } |
| /* Let's get this party started */ | |
| ::-webkit-scrollbar { | |
| width: 5px; | |
| } | |
| WebKit | |
| ______ | |
| Set overflow : scroll; !! |
| <rewrite> | |
| <rules> | |
| <rule name="Default" stopProcessing="true"> | |
| <match url="^(?!Content|Scripts|favicon|robots|App|api|breeze|sitemap.xml).*" /> | |
| <action type="Rewrite" url="/" /> | |
| </rule> | |
| </rules> | |
| </rewrite> |
| textarea { | |
| resize: vertical; | |
| overflow-y: hidden; /* prevents scroll bar flash */ | |
| padding-top: 1.1em; /* prevents text jump on Enter keypress */ | |
| } | |
| // Automatic resizing for textareas | |
| // auto adjust the height of | |
| $(document).on('keyup', 'textarea', function (e) { |
| .ellipsis { | |
| overflow: hidden; | |
| height: 100px; | |
| line-height: 25px; | |
| } | |
| .ellipsis:before { | |
| content:""; | |
| float: left; | |
| width: 5px; |
| var a = $.Deferred(function(dfd) { | |
| setTimeout(function() { | |
| //dfd.resolve(); | |
| dfd.reject(); | |
| },5000); | |
| }).promise(); | |
| a.then(function() { | |
| alert("success"); | |
| }).fail(function() { |
| .h-vcenter-parent { | |
| display: table; | |
| } | |
| .h-vcenter-child { | |
| display: table-cell; | |
| vertical-align: middle; | |
| } |