- Singleton
- Factory
- Iterator
- Strategy
- Facade
- Proxy
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
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
| <title>Payment Method</title> | |
| <link href="style.css" rel="stylesheet"></head> | |
| <body> | |
| <div class="gray-block"> | |
| <div class="payment-method"> |
None of the string methods modify this – they always return fresh strings.
-
charAt(pos: number): stringES1Returns the character at index
pos, as a string (JavaScript does not have a datatype for characters).str[i]is equivalent tostr.charAt(i)and more concise (caveat: may not work on old engines).
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
| // under Google Chrome 36 | |
| Object.prototype.toString.call([]) | |
| // "[object Array]" | |
| Object.prototype.toString.call(function(){}) | |
| // "[object Function]" | |
| Object.prototype.toString.call({}) | |
| // "[object Object]" | |
| Object.prototype.toString.call(null) | |
| // "[object Null]" |
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.php | |
| function create_posttype() { | |
| register_post_type('projects', | |
| array( | |
| 'labels' => array( | |
| 'name' => 'Проекты', | |
| 'singular_name' => 'Проект', | |
| 'add_new' => 'Добавить новый' | |
| ), |
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 my_login_logo(){ | |
| echo ' | |
| <style type="text/css"> | |
| #login h1 a { background: url('. get_bloginfo('template_directory') .'/img/logo.png) no-repeat -7px -9px !important; } | |
| </style>'; | |
| } | |
| add_action('login_head', 'my_login_logo'); | |
| /* Ставим ссылку с логотипа на сайт, а не на wordpress.org */ | |
| add_filter( 'login_headerurl', create_function('', 'return get_home_url();') ); |
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 | |
| $args = array( | |
| 'cat' => 6, | |
| 'post_type' => 'photos', | |
| 'posts_per_page' => 5 | |
| ); | |
| $new_query = new WP_Query( $args ); ?> | |
| <?php if($new_query->have_posts()) : while ($new_query->have_posts()) : $new_query->the_post(); ?> | |
| <?php the_content();?> |
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 if ( have_posts() ) : query_posts('p=1'); | |
| while (have_posts()) : the_post(); ?> | |
| <div <?php | |
| if ( $thumbnail_id = get_post_thumbnail_id() ) { | |
| if ( $image_src = wp_get_attachment_image_src( $thumbnail_id, 'normal-bg' ) ) | |
| printf( ' style="background-image: url(%s);"', $image_src[0] ); | |
| }?> ></div> | |
| <?php endwhile; endif; wp_reset_query(); ?> |
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
| //HTML | |
| <img class="img-svg" src="img/.."> | |
| //JS | |
| $('img.img-svg').each(function(){ | |
| var $img = $(this); | |
| var imgID = $img.attr('id'); | |
| var imgClass = $img.attr('class'); |
NewerOlder