Skip to content

Instantly share code, notes, and snippets.

Alex veirus

View GitHub Profile
huytd / todo.vim
Created Jun 14, 2020
A Todo list syntax in Vim, with an actual checkbox
View todo.vim
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
" Custom conceal
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* for details):
jeremiegirault /
Last active May 15, 2019
Use inline SVG in vue.js

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 / function_invocation.js
Last active Jun 5, 2020
11 Ways to Invoke a Function
View function_invocation.js
(_ => console.log(2))();
eval('console.log(3);');, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);, null, [9]);, null, 10);
lleaff / Discord_-_Open_chat_in_popup.user.js
Last active May 18, 2020
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
// @supportURL
// @match*
// @version 1
// @run-at document-end
// @grant none
// @noframes
nkbt / .eslintrc.js
Last active Jul 9, 2020
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 / Copy text directly from Photoshop text layer.
Last active Dec 19, 2019
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! -
* Compatibility above Photoshop CS6
* Licensed under the Creative Commons Attribution 2.5 License -
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
nifl / grok_vi.mdown
Created Aug 29, 2011
Your problem with Vim is that you don't grok vi.
View grok_vi.mdown

Answer by Jim Dennis on Stack Overflow question

Your problem with Vim is that you don't grok vi.

You mention cutting with yy and complain that you almost never want to cut whole lines. In fact programmers, editing source code, very often want to work on whole lines, ranges of lines and blocks of code. However, yy is only one of many way to yank text into the anonymous copy buffer (or "register" as it's called in vi).

The "Zen" of vi is that you're speaking a language. The initial y is a verb. The statement yy is a simple statement which is, essentially, an abbreviation for 0 y$:

0 go to the beginning of this line. y yank from here (up to where?)

You can’t perform that action at this time.