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 / vim-cheatsheet.md
Created June 16, 2017 21:44 — forked from 0xadada/README.md
VIM movement, keyboard commands and shortcuts
  • 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 / 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>
@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.

@saifulapm
saifulapm / nearby-coordinates.sql
Created May 12, 2020 18:11 — forked from statickidz/nearby-coordinates.sql
Ordering with SQL by nearest latitude & longitude coordinates (MySQL & SQLite)
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC
@saifulapm
saifulapm / page.google-product-feed.liquid
Created October 16, 2021 03:50 — forked from cameroncowden/page.google-product-feed.liquid
Shopify Google Product Feed xml generator
{% comment %}
Instructions:
- Create a blank page called 'Google Base Product Feed'and save it
- Open that page for editing and select 'page.google-feed' from the page template selector
- Add a brief site description to the meta-shop-description snippet
- The feed url should now be available at http://www.yoursite.com/pages/google-base-product-feed
- validate your field at http://validator.w3.org/feed/
- when ready, submit your feed at http://base.google.com
@saifulapm
saifulapm / match_visual.vim
Created September 30, 2024 18:10 — forked from AndrewRadev/match_visual.vim
Match other instances of visually selected areas
" Install by saving as plugin/match_visual.vim in your Vim (or Neovim) config
" directory.
"
" Reimplementation of https://github.com/aaron-p1/match-visual.nvim
"
" Requires the function `getregion`, you have it if this expression prints 1:
"
" echo exists('*getregion')
"
if !exists('*getregion')