Skip to content

Instantly share code, notes, and snippets.

View mogilka's full-sized avatar

Natalie Didenko mogilka

View GitHub Profile
@mogilka
mogilka / ClientWidget.php
Last active March 7, 2017 16:08
PHP: How to make Web widget with limited (authorized) access
<?php
/**
* Client widget model
* @todo for Client and Widget entities you should create appropriate models
*/
class ClientWidget {
public static function getTable() {
return 'client_widget';
}
@mogilka
mogilka / aria-multitabs.js
Created February 7, 2017 07:42
WAI-ARIA lets us to write understandable and role-oriented code for HTML-pages. Its tabs example belongs to only one tabbed block on the web-page: https://github.com/w3c/aria-practices/tree/master/examples/tabs. I modified it to make it possible to apply for any separated tabbed block on one page
/**
* Multiple tabbable blocks on one page
* Demo: https://tablo.moe/demo/team?id=11&style=fca
* Original for 1 tabable block on the page: https://github.com/w3c/aria-practices/blob/master/examples/tabs/js/tabs.js
*/
var tabbable = function(elemid) {
var container = document.getElementById(elemid);
if (!container)
return;

Keybase proof

I hereby claim:

  • I am mogilka on github.
  • I am mogilka (https://keybase.io/mogilka) on keybase.
  • I have a public key whose fingerprint is E534 5AF3 D0B5 CA2B 24E7 0F47 C157 4FB5 EDCD 98FD

To claim this, I am signing this object:

@mogilka
mogilka / gist:510ff7dc10a4dec92c37
Last active August 29, 2015 14:05
There is perfect library ViewPagerIndicator which TabPageIndicator class allow to make tabbed activity and horizontally scroll content pages with the headings. But I needed to have one fixed page and scrollable tabbed menu. In this case, tapping on tab should refresh page, load relevant content and center tab in the bar. The menu should be a fre…
package kz.eml.ui;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT;
import kz.eml.R;
import android.content.Context;
import android.support.v4.view.PagerAdapter;
import android.util.AttributeSet;
import android.util.Log;
import android.view.View;