Skip to content

Instantly share code, notes, and snippets.

@ampvchen
ampvchen / keymap.cson
Created July 27, 2017 18:00
Fix ctrl-tab to change tabs
'body':
'ctrl-tab ^ctrl': 'unset!'
'ctrl-tab': 'pane:show-next-item'
'ctrl-shift-tab ^ctrl': 'unset!'
'ctrl-shift-tab': 'pane:show-previous-item'
@ampvchen
ampvchen / nvidia-drivers.bash
Last active July 19, 2017 15:37
Install Nvidia drivers
# Set blacklist
# /etc/modprobe.d/blacklist.conf
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
# Edit Grub
@ampvchen
ampvchen / CapsLkCtrl.reg
Created July 12, 2017 23:49
Change the CapsLk to Ctrl on Windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00
@ampvchen
ampvchen / Vagrantfile
Last active May 6, 2019 01:47
Ruby Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
RUBY_ARCHIVE = {
"linux" => "ruby-2.4.1",
}
INSTALL = {
"linux" => "apt-get update -qq; apt-get install -qq -y git curl tmux zsh ",
}.freeze
@ampvchen
ampvchen / .vimrc.*
Created October 12, 2016 20:50
vimrc
" .vimrc.before
let g:airline_powerline_fonts = 1
" .vimrc.after
" Strip trailing whitespace
function! <SID>StringTrailingWhitespaces()
" Preparation: save last search, and cursor positoin
let _s=@/

Keybase proof

I hereby claim:

  • I am ampvchen on github.
  • I am vchen (https://keybase.io/vchen) on keybase.
  • I have a public key ASDdoNZZbipD6WApuASbI5sUfNbu6QD-Z6LjjLJLl5Ti-wo

To claim this, I am signing this object:

@ampvchen
ampvchen / ssl-redirect.rb
Last active July 18, 2017 14:51
SSL Redirect
def ensure_domain
if Rails.env.production?
if request.host.split(".")[1].to_s != 'herokuapp' && request.subdomain != 'www'
redirect_to request.url.sub('//', '//www.')
end
end
end
@ampvchen
ampvchen / .vim
Created March 21, 2014 18:12
Vim Remove Trailing Whitespaces
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s