Skip to content

Instantly share code, notes, and snippets.

@artanikin
artanikin / Gemfile
Created July 9, 2020 03:09 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers

The Power of Vim

Today's episode: Compile/build/error check workflow. The Vim Way™

Introduction

The number one plugin that everyone and their relatives installs, without a second thought, if they want to check for errors in their script/language of choice, is syntastic. In my opinion, syntastic is a completely useless plugin. "HUH WTF?! How dare you insult my favorite plugin?!" Yes, that's right. I said

@artanikin
artanikin / colorscheme-override.md
Created May 26, 2020 19:40 — forked from romainl/colorscheme-override.md
The right way to override any highlighting if you don't want to edit the colorscheme file directly

The right way to override any highlighting if you don't want to edit the colorscheme file directly

Suppose you have weird taste and you absolutely want:

  • your visual selection to always have a green background and black foreground,
  • your active statusline to always have a white background and red foreground,
  • your very own deep blue background.

Your first reflex is probably to put those lines somewhere in your vimrc:

@artanikin
artanikin / gist:e1e36cac35c541109c94b899eacee6de
Created November 13, 2019 17:26
Ruby AES Encryption using OpenSSL
#!/usr/bin/env ruby
require "openssl"
require 'digest/sha2'
require 'base64'
# We use the AES 256 bit cipher-block chaining symetric encryption
alg = "AES-256-CBC"
# We want a 256 bit key symetric key based on some passphrase
digest = Digest::SHA256.new
@artanikin
artanikin / init.vim
Created August 29, 2019 05:09 — forked from danmikita/init.vim
File preview with FZF, RG, Bat, and Devicons
nnoremap <silent> <leader>e :call Fzf_dev()<CR>
" ripgrep
if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
set grepprg=rg\ --vimgrep
command! -bang -nargs=* Find call fzf#vim#grep('rg --column --line-number --no-heading --fixed-strings --ignore-case --hidden --follow --glob "!.git/*" --color "always" '.shellescape(<q-args>).'| tr -d "\017"', 1, <bang>0)
endif
" Files + devicons
@artanikin
artanikin / .gitconfig
Created December 26, 2018 07:55 — forked from huytd/.gitconfig
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
= surround '(', ')' do
%a{ href: "food" } chicken
-# Produces:
-# (<a href='food'>chicken</a>)
= succeed '.' do
%a{ href: "thing" } here
-# Produces:
-# <a href='thing'>here</a>.
@artanikin
artanikin / xterm-256color-italic.terminfo
Last active May 4, 2018 06:23 — forked from sos4nt/xterm-256color-italic.terminfo
A xterm-256color based TERMINFO that adds the escape sequences for italic
# A xterm-256color based TERMINFO that adds the escape sequences for italic.
#
# Install:
#
# tic xterm-256color-italic.terminfo
#
# Usage:
#
# export TERM=xterm-256color-italic
#
@artanikin
artanikin / HOWTO.md
Created December 4, 2017 22:47 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you