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
| // copied from http://stackoverflow.com/a/2790686 | |
| 'use strict'; | |
| // Add ECMA262-5 method binding if not supported natively | |
| // | |
| if (!('bind' in Function.prototype)) { | |
| Function.prototype.bind= function(owner) { | |
| var that= this; | |
| if (arguments.length<=1) { |
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
| var getPreloader = function(dest, options){ | |
| options = $.extend({ | |
| alt: '', | |
| css: { | |
| display: 'block', | |
| margin: '30px auto' | |
| }, | |
| src: '/assets/ajax_loaders/loader-big.gif' | |
| }, options); |
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
| // Preferences > Key Bindings - User | |
| { "keys": ["ctrl+shift+w"], "command": "noop"} |
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
| // required plugin: https://github.com/jisaacks/ChainOfCommand | |
| // Preferences > Key Bindings - User | |
| [ | |
| { "keys": ["alt+shift+r"], | |
| "command": "chain", | |
| "args": { | |
| "commands": [ | |
| ["unindent", { | |
| "context": [ |
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
| function getPostsWithMeta() { | |
| global $wpdb; | |
| $query = " | |
| SELECT DISTINCT | |
| ID, | |
| post_title, | |
| post_date, | |
| guid | |
| FROM wp_posts |
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
| /** | |
| * Queue System Object | |
| * | |
| * DOM structure requires some time to load, | |
| * so we need to wait with events attachment. | |
| * Queuing allows to manipulate functions call order | |
| * properly. | |
| * | |
| * Important: | |
| * Remember to add Queue.done() in the very end |
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
| // WP 4.0 qTranslate FIX | |
| add_action( 'admin_init', 'custom_deregister_editor_expand' ); | |
| function custom_deregister_editor_expand() { | |
| wp_deregister_script('editor-expand'); | |
| } |
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
| <style> | |
| .full-width { position: relative; width: 100%; height: 300px; } | |
| .full-width:before { content: " "; display: block; position: absolute; width: 300%; height: 100%; left:-100%; background: inherit; z-index:-1; } | |
| .full-width:after { content: " "; display: block; position: absolute; top:0; width: 100%; height: 100%; left:0; right: 0; margin: auto; z-index:-1;} | |
| </style> | |
| <div style="width:300px;min-height:600px;margin:0 auto"> | |
| <div class="full-width" style="background: #c0c0c0 url('http://lorempixel.com/1800/600/nature/1800x600/') no-repeat center top;"> | |
| <img alt="" src="http://placehold.it/300x300" style="opacity:0.8;"/> | |
| </div> |
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
| if( ! get_role('simple_user')){ | |
| add_role( | |
| 'simple_user', | |
| __( 'Użytkownik' ), | |
| array( | |
| 'read' => true, // true allows this capability | |
| ) | |
| ); | |
| } |