Skip to content

Instantly share code, notes, and snippets.

View fogrew's full-sized avatar
🚀
Open for new opportunities

Andrew Gurylev fogrew

🚀
Open for new opportunities
View GitHub Profile
@fogrew
fogrew / countAuthors.js
Last active January 25, 2017 17:32
Authors of comments in issue: sort and remove duplicates
// get all elements with authors
var $authors = document.querySelectorAll('.comment .author');
var authors = [];
$authors.forEach(item => authors.push(item.innerText));
// sorting
authors.sort();
// remove duplicates
[...new Set(authors)];
// bookmarklet
@fogrew
fogrew / gulp-sprites.js
Created November 20, 2016 13:00
Gulp task for svg symbols sprite
'use strict';
const paths = require('../config/paths');
const fs = require('fs');
const path = require('path');
const svgSprite = require('gulp-svg-sprite');
module.exports = function(gulp, bs) {
return gulp.task('svg-symbols', function() {
@fogrew
fogrew / data.js
Last active November 7, 2020 09:08
get github issues with label
let eventsList = [];
require('./getGithub').then((data) => {
for (event in data) {
eventsList.push({
title: event.title,
url: event.html_url
});
}
@fogrew
fogrew / bookmarklet.lnk
Last active November 1, 2016 01:45
Filter github nodeschool comments
javascript:(function()%7Bvar%20b%3D%22javascripting%20git-it%20scope-chains-closures%20elementary-electron%20learnyounode%20how-to-npm%20stream-adventure%20how-to-markdown%20functional-javascript-workshop%20levelmeup%20expressworks%20makemehapi%20promise-it-wont-hurt%20async-you%20nodebot-workshop%20goingnative%20planetproto%20webgl-workshop%20esnext-generation%20test-anything%20tower-of-babel%20learnyoumongo%20regex-adventure%20learn-sass%20pattern-lab-workshop%20learnyoubash%20currying-workshopper%20shader-school%20bytewiser%20bug-clinic%20browserify-adventure%20introtowebgl%20count-to-6%20kick-off-koa%20lololodash%20learnyoucouchdb%20learnuv%20learn-generators%20learnyoureact%20perfschool%20web-audio-school%20torrential%20thinking-in-react%20node-debug-school%20seneca-in-practice%20less-is-more%22.split(%22%20%22)%2Cd%3D%7B%7D%3B%5B%5D.slice.call(document.querySelectorAll(%22.js-comment-body%22)).filter(function(c)%7Bc%3Dc.innerText.replace(%22%20%22%2C%22-%22)%3Bb.forEach(function(a)%7Ba%3Dc.match(a)%3Bnu
@fogrew
fogrew / sublime-keys.json
Created July 12, 2016 21:23
emmet one line key config
[
{ "keys": ["super+shift+r"], "command": "show_panel", "args": {"panel": "replace", "reverse": false} },
{ "keys": ["alt+w"], "command": "less_to_css" }
]
@fogrew
fogrew / .zshrc
Last active September 15, 2017 00:40
my .zshrc
# PATH
export PATH=$HOME/bin:/usr/local/bin:$PATH
# ZSH
ZSH_THEME="clean"
plugins=(git)
HIST_STAMPS="dd.mm.yyyy"
DISABLE_AUTO_UPDATE="true"
export ZSH="$HOME/.oh-my-zsh"
alias zshrc="subl ~/.zshrc"
@fogrew
fogrew / tricks.js
Created May 8, 2016 21:57
JavaScript tricks
// Converting NodeList to Arrays
[].slice.call(document.querySelectorAll(query));
// Shuffling array’s elements
[1,2,3].sort(Math.random() - 0.5); // [2,1,3]
// Caching the array.length in the loop
for(var i = 0, length = array.length; i < length; i++) {
console.log(array[i]);
}
@fogrew
fogrew / eachTags.js
Created February 21, 2016 11:52
Get XPath for node
[].forEach.call(document.getElementsByTagName('a'), function (link) {
console.log(getXPathForElement(link, document));
});
@fogrew
fogrew / easigns.scss
Created February 16, 2016 13:00
Google Material Transition Easing
$easing-swift: cubic-bezier(.4, 0, .2, 1);
$easing-swifter: cubic-bezier(.4, 0, 0, 1);
$easing-heavy: cubic-bezier(.7, 0, .6, 1);
$easing-swift-in: cubic-bezier(0, 0, .2, 1);
$easing-swift-out: cubic-bezier(.55, 0, .1, 1);
@fogrew
fogrew / Preferences.sublime-settings
Last active September 15, 2017 00:23
Preferences.sublime-settings
{
"auto_close_tags": true,
"auto_complete": true,
"auto_match_enabled": true,
"color_scheme": "Packages/User/SublimeLinter/base16-eighties (SL).tmTheme",
"draw_white_space": "all",
"enable_tab_scrolling": false,
"font_face": "Menlo",
"font_size": 18,
"highlight_line": true,