Skip to content

Instantly share code, notes, and snippets.

View IOZ's full-sized avatar
🏠
Working from home office

Igor Zimnitskiy IOZ

🏠
Working from home office
View GitHub Profile
@IOZ
IOZ / main.js
Created March 18, 2014 15:26
Selectik
(function(){
var eventMatchers = {
'HTMLEvents': /^(?:load|unload|abort|error|select|change|submit|reset|focus|blur|resize|scroll)$/,
'MouseEvents': /^(?:click|mouse(?:down|up|over|move|out))$/
}
var defaultOptions = {
pointerX: 0,
pointerY: 0,
button: 0,
@IOZ
IOZ / module.js
Created March 14, 2014 09:07
Pattern Module
/**
* Pattern Module
* p - parent object
* t - reference to this into the module
*/
var App;
App = (function(){
return {};
@IOZ
IOZ / module.js
Created March 12, 2014 17:21
Modular js architecture
var MODULE = {};
/* User page */
MODULE.User = (function(module){
var username = '';
var methods = {
setName: function(name){
username = name;
@IOZ
IOZ / vk_remove_fans
Last active March 25, 2017 18:38
Tiny script, which automatically remove vk fans
/* User settings */
var time = 500; // time delay, 500 work fine
var type = 'deactivated'; // type of user: deactivated or all
/* do not change */
var
fans = document.querySelectorAll('.fans_fan_row'),
fans_length = fans.length,
fans_bl = [],
@IOZ
IOZ / GetViewPort.js
Last active August 29, 2015 13:55
Get window viewport width and height
/**
* Get window viewport width
* @param side {string} - (width|height|both)
*
* Usage getViewPort('width'); // return viewport width
*/
function getViewPort(side){
var side = side || 'both';
var viewport = { width: 0, height: 0 };
@IOZ
IOZ / jquery_project_pattern.js
Created February 3, 2014 11:50
Project pattern
/**
* Application
* @constructor
*/
function App(){
var T = this;
this.body = $("body");
this.doc = $(document);
this.win = $(window);
module.exports = function (grunt) {
//описываем конфигурацию
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'), //подгружаем package.json, чтобы использовать его данные
/*jshint: { // описываем как будет проверять наш код - jsHint
options: {
curly: true,
eqeqeq: true,
immed: true,
{
"name": "terminal-ukraine",
"version": "1.0.0",
"description": "project description",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"grunt": "~0.4.2",