Skip to content

Instantly share code, notes, and snippets.

View saifulapm's full-sized avatar
I may be slow to respond.

Saiful Islam saifulapm

I may be slow to respond.
View GitHub Profile
@saifulapm
saifulapm / UTF8MB4 with Rails fix.md
Last active September 19, 2018 00:31
Specified key was too long; max key length is 767 bytes

I’ve recently received this error when using UTF8MB4 with Rails.

Mysql2::Error: Specified key was too long; max key length is 767 bytes

After finding this issue on the Rails GitHub page, this is the fix:

Create a file called config/initializers/mysql.rb and copy the following into it

@saifulapm
saifulapm / download-egghead-io-videos.md
Created June 22, 2018 01:43 — forked from shivamkr19/download-egghead-io-videos.md
Download free egghead.io videos

Download free egghead.io videos

Download Egghead.io videos using Lynx Browser and youtube-dl. This method will only work for videos that do not require a pro account.

Prerequesits

You need a Unix/Linux box with Lynx console browser and Youtube-dl installed.

" For vundle
filetype off
set nocompatible " be iMproved
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
" Git tools
Bundle 'tpope/vim-fugitive'
" Dependency managment
@saifulapm
saifulapm / Rake Database.md
Created October 17, 2017 22:31 — forked from stevenyap/Rake Database.md
List of rake commands to manage database

Create database

rake db:create

Create database table

This will creates a migration file in /db/migrate without table definition.

rails g migration create_<TABLE>
  • Dynamic Dispatch
  • Dynamic Method
  • Ghost Methods
  • Dynamic Proxies
  • Blank Slate
  • Kernel Method
  • Flattening the Scope (aka Nested Lexical Scopes)
  • Context Probe
  • Class Eval (not really a 'spell' more just a demonstration of its usage)
  • Class Macros
@saifulapm
saifulapm / vim-cheatsheet.md
Created June 16, 2017 21:44 — forked from 0xadada/README.md
VIM movement, keyboard commands and shortcuts
@saifulapm
saifulapm / Vim_Splits.md
Last active June 16, 2017 21:42
Vim Better Movements

The basics Splits Movement

Create a vertical split using :vsp and horizontal with :sp.

By default, they duplicate the current buffer. This command also takes a filename:

:vsp ~/.vimrc

You can specify the new split height by prefixing with a number: