Skip to content

Instantly share code, notes, and snippets.

View temazinkin's full-sized avatar

Tema Zinkin temazinkin

View GitHub Profile
{
"window.restoreFullscreen": true,
"workbench.editor.untitled.hint": "hidden",
"workbench.iconTheme": "vs-minimal",
"workbench.startupEditor": "none",
"workbench.tips.enabled": false,
"workbench.tree.indent": 20,
var div = $("#mydiv");
div.scrollTop(div.prop('scrollHeight'));
@temazinkin
temazinkin / search.js
Created April 3, 2017 04:52
Поиск по списку без учета регистра
$(document).ready(function(){
$.expr[":"].Contains = $.expr.createPseudo(function(arg) {
return function( elem ) {
return $(elem).text().toUpperCase().indexOf(arg.toUpperCase()) >= 0;
};
});
$('#search').val('');
$('#search').keyup(function(e) {
var inputValue = $.trim($(this).val()).toLowerCase()
, $menuElements = $('.task-list a')
@temazinkin
temazinkin / textNum.js
Created April 2, 2017 16:39
Числительные. Склонение слов на javascript
function declOfNum(number, titles) {
cases = [2, 0, 1, 1, 1, 2];
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ];
}
declOfNum(count, ['найдена', 'найдено', 'найдены']);

Keybase proof

I hereby claim:

  • I am zinkinru on github.
  • I am nightcoder (https://keybase.io/nightcoder) on keybase.
  • I have a public key whose fingerprint is 9FB9 03C3 E0F1 FF55 94F9 7EDD B45D 8C3C 299B F7C4

To claim this, I am signing this object:

@temazinkin
temazinkin / functions.php
Created March 21, 2016 21:54 — forked from jameskoster/functions.php
WooCommerce - Change number of products per row
// Change number or products per row to 3
add_filter('loop_shop_columns', 'loop_columns');
if (!function_exists('loop_columns')) {
function loop_columns() {
return 3; // 3 products per row
}
}
{
"auto_indent": true,
"auto_match_enabled": true,
"binary_file_patterns":
[
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
"*.ttf",
@temazinkin
temazinkin / wp.loop.php
Created October 6, 2015 08:02
main loop wordpress
<!-- Start the Loop. -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div class="post">
<h2>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_title(); ?>
</a>
</h2>
<small>
@temazinkin
temazinkin / wp-signup.php
Created September 29, 2015 14:04
Signup page
<?php
// All stuff from wp-signup.php
// WordPress 4.1
function selena_network_show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
$current_site = get_current_site();
// Blog name
echo '<div class="form-group">';
if ( !is_subdomain_install() )
echo '<label for="blogname" class="control-label">' . __('Site Name:') . '</label>';
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre,
form, fieldset, input, p, blockquote, table, th, td, embed, object {
padding: 0;
margin: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset, img, abbr {