Skip to content

Instantly share code, notes, and snippets.

Alex veirus

Block or report user

Report or block veirus

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
@ramil-k
ramil-k / i.js
Created Jun 22, 2018
iterators to generators
View i.js
const movies = {
action: ['dark', 'aveng'],
comedy: ['life', 'lights'],
[Symbol.iterator]*() {
for (let movies of Object.values(this)) {
// option 1:
for (let movie of movies) {
yield movie;
}
// option 2 (see https://developer.mozilla.org/ru/docs/Web/JavaScript/Reference/Statements/function* for details):
@jeremiegirault
jeremiegirault / README.md
Last active May 15, 2019
Use inline SVG in vue.js
View README.md

Install svg-inline-loader for webpack :

npm install svg-inline-loader --save-dev

Add it to your loaders in module.loaders section of webpack.config.js:

{
  test: /\.svg$/,
  loader: 'svg-inline-loader'
@myshov
myshov / function_invocation.js
Last active Jul 8, 2019
11 Ways to Invoke a Function
View function_invocation.js
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@lleaff
lleaff / Discord_-_Open_chat_in_popup.user.js
Last active Jun 10, 2019
Adds a "open in popup" button to channels
View Discord_-_Open_chat_in_popup.user.js
// ==UserScript==
// @name Discord - Open chat in popup
// @namespace lleaff
// @updateURL https://gist.github.com/lleaff/8514033dc8e54ce02d6adf3c2e46d8ff/raw/Discord_-_Open_chat_in_popup.user.js
// @supportURL https://gist.github.com/lleaff/8514033dc8e54ce02d6adf3c2e46d8ff#comments
// @match https://discordapp.com/channels/*
// @version 1
// @run-at document-end
// @grant none
// @noframes
@nkbt
nkbt / .eslintrc.js
Last active Sep 19, 2019
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@praveenvijayan
praveenvijayan / Copy text directly from Photoshop text layer.
Last active Oct 4, 2018
Copy text directly from text layer. Works above photoshop cs6. Copy following script file into /Applications/Adobe Photoshop CC 2014/Presets/Scripts (MAC) or C:\Program Files\Adobe\Adobe Photoshop CC 2014\Presets\Scripts (WIN). Assign shortcut for easy access (cmd+option+c / ctrl+alt+c)
View Copy text directly from Photoshop text layer.
/*****************************************************************
*
* Copy Layer text 1.0 - by Praveen Vijayan! - http://www.decodize.com/
*
* Compatibility above Photoshop CS6
*
* Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
*
*****************************************************************/
View console.log.vim
" Console log from insert mode; Puts focus inside parentheses
imap cll console.log();<Esc>==f(a
" Console log from visual mode on next line, puts visual selection inside parentheses
vmap cll yocll<Esc>p
" Console log from normal mode, inserted on next line with word your on inside parentheses
nmap cll yiwocll<Esc>p
You can’t perform that action at this time.