Skip to content

Instantly share code, notes, and snippets.

View mur-wtag's full-sized avatar
🏠
Working from home

M Mahabubur Rhaman (Rony) mur-wtag

🏠
Working from home
View GitHub Profile
@mur-wtag
mur-wtag / presenter.md
Created December 20, 2020 04:59
Presenter in MVC pattern

In view we are uing Presenter like this:

# app/views/galleries/show.html

<% present(object: @gallery, shop: @shop, gallery_items: @gallery_items) do |presenter| %>
  <div class="shop-name"><%= presenter.shop_name %></div>
    <div class="post-filter btn-filter d-inline-block">
     <div class="dropdown">
       <a class="filter-dropdown dropdown-toggle" href="#" role="button" id="postFilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@mur-wtag
mur-wtag / 01_persenter.md
Last active December 6, 2020 17:43
Coinberry Technical take home

In view we are uing Presenter like this:

# app/views/galleries/show.html

<% present(object: @gallery, shop: @shop, gallery_items: @gallery_items) do |presenter| %>
  <div class="shop-name"><%= presenter.shop_name %></div>
    <div class="post-filter btn-filter d-inline-block">
     <div class="dropdown">
       <a class="filter-dropdown dropdown-toggle" href="#" role="button" id="postFilter" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@mur-wtag
mur-wtag / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers. You want to perform git pull origin master for example, and you want this to happen without asking for a password.

@mur-wtag
mur-wtag / gist:b48b89688b58ac4792607d625ce43a18
Created March 18, 2019 03:36 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
https://github.com/wtag/IBE/blob/5e02f020d8f45f99e2b7560a767012dde750b512/app/flights/containers/QueuePlacementContainer.js#L14-L14
[%w(20 8 1 14 11), %w(25 15 21)].each do |outer|
outer.each_with_index do |inner, index|
printf "\e[32m#{(inner.to_i + 64).chr.downcase}\e[0m" if index.even?
printf "\e[31m#{(inner.to_i + 64).chr}\e[0m" unless index.even?
end
printf ' '
end