Skip to content

Instantly share code, notes, and snippets.

View m-pokrovskii's full-sized avatar

Maxim Pokrovskii m-pokrovskii

View GitHub Profile
@m-pokrovskii
m-pokrovskii / javascript_resources.md
Created July 7, 2014 17:20 — forked from jookyboi/javascript_resources.md
Here are a set of libraries, plugins and guides which may be useful to your Javascript coding.

Libraries

  • jQuery - The de-facto library for the modern age. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers.
  • Backbone - Backbone.js gives structure to web applications by providing models with key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing API over a RESTful JSON interface.
  • AngularJS - Conventions based MVC framework for HTML5 apps.
  • Underscore - Underscore is a utility-belt library for JavaScript that provides a lot of the functional programming support that you would expect in Prototype.js (or Ruby), but without extending any of the built-in JavaScript objects.
  • lawnchair - Key/value store adapter for indexdb, localStorage
@m-pokrovskii
m-pokrovskii / css.css
Created April 13, 2014 07:04
vertical positioning
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@m-pokrovskii
m-pokrovskii / function.php
Created April 2, 2014 13:03
Wordrepss. What file name is used
add_filter( 'template_include', 'var_template_include', 1000 );
function var_template_include( $t ){
$GLOBALS['current_theme_template'] = basename($t);
return $t;
}
function get_current_template( $echo = false ) {
if( !isset( $GLOBALS['current_theme_template'] ) )
return false;
if( $echo )
[64] => stdClass Object
(
[term_id] => 64
[name] => осень
[slug] => osen
[term_group] => 0
[term_taxonomy_id] => 65
[taxonomy] => idea_seasons
[description] =>
[parent] => 0
@m-pokrovskii
m-pokrovskii / function.php
Last active August 29, 2015 13:57
Fix wordpress custom post type pagination 404 error
<?php
function change_ppp() {
if((is_tax('catalog_cat') || is_tax('idea_categories')) && !is_admin() ) {
set_query_var( 'posts_per_page', '-1' );
}
return;
}
add_action( 'parse_query', 'change_ppp' );
// If you don't understand how is it works, it's fine!
traceroute to cloudflare.com (198.41.213.157), 64 hops max, 52 byte packets
1 192.168.1.1 (192.168.1.1) 1.450 ms 0.973 ms 0.819 ms
2 10.121.84.233 (10.121.84.233) 21.801 ms
10.121.84.221 (10.121.84.221) 48.601 ms 74.984 ms
3 10.121.84.234 (10.121.84.234) 22.461 ms 21.761 ms 21.574 ms
4 mx-ll-110.164.0-161.static.3bb.co.th (110.164.0.161) 29.383 ms
mx-ll-110.164.0-163.static.3bb.co.th (110.164.0.163) 29.714 ms
mx-ll-110.164.0-169.static.3bb.co.th (110.164.0.169) 30.000 ms
5 mx-ll-110.164.0-158.static.3bb.co.th (110.164.0.158) 29.585 ms
mx-ll-110.164.0-162.static.3bb.co.th (110.164.0.162) 30.390 ms 29.433 ms
@m-pokrovskii
m-pokrovskii / gist:9137305
Created February 21, 2014 16:20
The best way to vertical allign
<!-- containing element to implement centering trick on -->
<div class="wrapper">
<!-- element to center -->
<div class="container">
<h1>Hello World</h1>
<p>Hi, I am page content.</p>
</div>
</div>
@m-pokrovskii
m-pokrovskii / gist:8842595
Created February 6, 2014 11:41
Vertiacal align to image
<html >
<head>
<title>Test</title>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
<style type="text/css">
.wrapper1 {
white-space:nowrap;
max-width:50%;
}
.wrapper2 {
@m-pokrovskii
m-pokrovskii / gist:7717995
Created November 30, 2013 11:38
text-shadow inner shadow trick
.counter-corner__counter {
position: relative;
color: #000;
font-weight: bold;
}
.counter-corner__counter:before {
content: attr(title);
color: transparent;
position: absolute;
.ps-container .ps-scrollbar-y {
position: absolute; /* please don't change 'position' */
right: 14px; /* there must be 'right' for ps-scrollbar-y */
width: 8px;
background-color: #00aeef;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
opacity: 0;
filter: alpha(opacity = 0);