Skip to content

Instantly share code, notes, and snippets.

Mikhail Kuznetcov shershen08

Block or report user

Report or block shershen08

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View grid line snippet
// Movable grid line
// ------------------
// remove on dblclick, several lines possible
jQuery('<div/>').prependTo('body')
.css({"position":"absolute","width": 1,"height":jQuery('body').css('height'),"background":"#f00","left":30,"z-index":10000, 'cursor':'pointer'})
.dblclick(function() {jQuery(this).remove();})
.hover(function(){
var lineId = (new Date()).getTime().toString().substr(8);
jQuery(this).addClass('grid-line').attr('id', 'grid'+lineId).css({"width": 2});
@shershen08
shershen08 / gist:edab3da7a932f6f94741
Created Jan 22, 2015
console parsing of page Книжный топ–лист D3
View gist:edab3da7a932f6f94741
//for page https://library.d3.ru/comments/613787/
var allNodes = document.querySelectorAll('.c_body b'), result = [];
function getBooksWithRating(item,i) {
var newItem = {}, rate;
newItem.text = item.innerHTML;
rate = item.parentNode.parentNode.querySelectorAll('.vote_result')[0] ? item.parentNode.parentNode.querySelectorAll('.vote_result')[0].innerHTML : 0;
newItem.rating = rate;
if(rate > 30){
result.push(newItem);
}
View gist:230de56763a75a7daabf
{"data":{"id":null,"primaryRoleId":66,"roleId":66,"type":"subjects","fields":[{"id":"282","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":null}]},{"id":"292","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":"EUR11111"}]},{"id":"2","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":"22222"}]},{"id":"5","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":"A"}]},{"id":"3","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":"33333"}]},{"id":"294","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":null}]},{"id":"4","type":"fields","subjectfields":[{"id":null,"type":"subjectfields","value":null}]}]},"included":[],"meta":{"apiversion":"1.0.0","language":"en_EN","self":""}}
@shershen08
shershen08 / cli-rss-reader.js
Created Mar 5, 2016
A simple RSS Reader with Readline in NodeJS
View cli-rss-reader.js
/*
Readline module is used to read and write data in console.
Full docs on Readline - https: //nodejs.org/api/readline.html
In this example the list of RSS channes from Yandex.news - https: //news.yandex.ru/export.html
To call the script you should use type: 'node --harmony cmd.js'
*/
// Adding needed modules:
// readline - reads console ine
// request - does http resquests
@shershen08
shershen08 / angular-masonry-deps.js
Created May 6, 2016
Single module for including all angular-masonry dependences via AMD
View angular-masonry-deps.js
/**
* Single module for including angular-masonry via AMD (e.g. RequireJS)
* includes: Bridget, matchesSelector, EvEmitter, Fizzy UI utils, getSize, imagesLoaded, Outlayer, Outlayer Item, Masonry
*
* Created at: 6-05-2016
* Created by: michail.kuznetsov@gmail.com
*/
define(['jquery'], function($) {
/**
@shershen08
shershen08 / fb-login.js
Created May 14, 2016
fb login boilerpale
View fb-login.js
// This is called with the results from from FB.getLoginStatus().
function statusChangeCallback(response) {
console.log('statusChangeCallback');
console.log(response);
// The response object is returned with a status field that lets the
// app know the current login status of the person.
// Full docs on the response object can be found in the documentation
// for FB.getLoginStatus().
if (response.status === 'connected') {
You can’t perform that action at this time.