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
@veirus
veirus / base.el
Created Jan 4, 2019
Emacs config
View base.el
;;; Package --- Summary
;;; Commentary:
;;; General Emacs configuration
;;; Code:
;;; Закрывать *scratch* при запуске.
(kill-buffer "*scratch*")
;; (desktop-save-mode 1)
(fset 'yes-or-no-p 'y-or-n-p)
View SavedState.vim
" It's probably not exactly what you want, because you mentioned autocmds in the original post, but you may be interested in :h :DiffOrig. FWIW, here's a modified version of this custom command which I'm using:
com! -bar DiffOrig echo s:diff_orig()
fu! s:diff_orig() abort
let cole_save = &l:cole
setl cole=0
vnew
setl bh=wipe nobl bt=nofile noswf
View Photo_Effects_Relplot_Seaborn_1.py
from PIL import Image
import numpy as np
import matplotlib.pyplot as pyplot
import pandas as pd
from datetime import datetime
import seaborn as sns
ini = datetime.now()
fle = "Cosmonaut" # File name
@veirus
veirus / .eslintrc.js
Created Nov 7, 2018 — forked from nkbt/.eslintrc.js
Strict ESLint config for React, ES6 (based on Airbnb Code style)
View .eslintrc.js
{
"env": {
"browser": true,
"node": true,
"es6": true
},
"plugins": ["react"],
"ecmaFeatures": {
@veirus
veirus / InsertFoldmarker.vim
Last active Oct 8, 2018
Quick and "smart" (not really...) insertion of current foldmarker + mostly accurate (not really...) foldlevel
View InsertFoldmarker.vim
function! InsertFoldMarker(...) abort
let l:cur_line = getline('.')
let l:markers = split(&l:fmr, ',')
let l:marker = (a:0) && len(l:markers)>1 ? l:markers[1] : l:markers[0]
let l:level = foldlevel('.')
let l:level = l:level == 0 ? '1' : l:level
let l:cms = split(&l:cms, '%s')
" TODO: handle paired comment markers
let l:cms = (a:0) && len(l:cms)>1 ? l:cms[1] : l:cms[0]
let l:marker_cnt = count(l:cur_line, l:cms)
@veirus
veirus / packages-vivid.vim
Last active Oct 8, 2018
Installing Vim plugins using `axvr/Vivid.vim`. Pros: less boilerplate than `minpac`; Cons: you need to enable plugins *manually* - may brake some of them.
View packages-vivid.vim
" quick add plugins for a plugin manager to load {{{1
function! AddPacFromCb() abort
if v:version >= 801 || (v:version == 800 && has("patch1630"))
let l:cb = trim(@+)
else
" do oldschool way to trim all spaces and whatnot
let l:cb = substitute(@+,'\v^\s*(.{-})\s*\n$','\1','')
endif
let l:cb = substitute(l:cb, '\v^https://github.com/','','')
put = 'Plugin ''' . l:cb . ''''
@veirus
veirus / md2org_URLS.vim
Last active Jul 30, 2018
Convert markdown style links to emacs orgmode format
View md2org_URLS.vim
" even easier with `.\{-}`:
%s/\[\(.\{-}\)](\(.\{-}\))/[[\2][\1]]/g
View steamGamesList.js
var names = document.body.getElementsByClassName('gameListRowItemName');
var namesString = '';
for (var i = 0; i < names.length; i++) namesString += (names[i].innerText + '\n');
@veirus
veirus / better_jk.vim
Last active Jun 27, 2018
Mappings for easier line navigation with <j> and <k> when `wrap` is on
View better_jk.vim
" screen line scroll - very useful with wrap on
" https://bluz71.github.io/2017/05/15/vim-tips-tricks.html
nnoremap <expr> j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj'
nnoremap <expr> k v:count ? (v:count > 5 ? "m'" . v:count : '') . 'k' : 'gk'
@veirus
veirus / dror_pathlib.py
Created Jun 7, 2018
My *favourite* sorting script now with **Pathlib**
View dror_pathlib.py
#!/usr/bin/env python3.6
# -*- coding: utf-8 -*-
# dror - pathlib edition
# Based on https://gist.github.com/dansku/9040240#file-dropboxorganize-py
__lastchanged__ = '2018-06-07 06:07'
__verstion__ = '0.6.2'
from datetime import date
from pathlib import Path
You can’t perform that action at this time.