Skip to content

Instantly share code, notes, and snippets.

View hoasung01's full-sized avatar
🎯
Focusing

nguyenngochai hoasung01

🎯
Focusing
View GitHub Profile
@hoasung01
hoasung01 / System Design.md
Created December 28, 2019 08:04 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@hoasung01
hoasung01 / interviewitems.MD
Created September 10, 2017 08:32 — forked from KWMalik/interviewitems.MD
My answers to over 100 Google interview questions

##Google Interview Questions: Product Marketing Manager

  • Why do you want to join Google? -- Because I want to create tools for others to learn, for free. I didn't have a lot of money when growing up so I didn't get access to the same books, computers and resources that others had which caused money, I want to help ensure that others can learn on the same playing field regardless of their families wealth status or location.
  • What do you know about Google’s product and technology? -- A lot actually, I am a beta tester for numerous products, I use most of the Google tools such as: Search, Gmaill, Drive, Reader, Calendar, G+, YouTube, Web Master Tools, Keyword tools, Analytics etc.
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them? -- Google competes on numerous fields: --- Search: Baidu, Bing, Duck Duck Go
@hoasung01
hoasung01 / subdomain-localhost-rails-5.md
Created June 11, 2017 07:49 — forked from indiesquidge/subdomain-localhost-rails-5.md
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@hoasung01
hoasung01 / chef.md
Created February 16, 2017 01:33 — forked from oNguyenThanhTung/chef.md
Tìm hiểu về Chef

Tìm hiểu về Chef

##Giới thiệu

Trong các giai đoạn phát triển các ứng dụng, dịch vụ dùng server thì việc xây dựng deployment là không thể thiếu được. Giai đoạn này đòi hỏi người thiết định phải có kinh nghiệm, kiến thức về server, cấu hình hệ thống, performance. Đặc biệt là đối với các hệ thống có số node (server) từ 2 hoặc nhiều hơn thì việc thống nhất giữa 2 server là rất quan trọng. Người thực hiện bắt buộc phải ghi nhớ các libraries, tools của từng loại server (DB server thế nào, Cache server, Web server như thế nào). Ngoài ra các thiết lập, cấu hình đã dùng trong quá trình development và production cũng phải đảm bảo tính thống nhất. Do đó quá trình deployment thường gặp phải các khó khăn

@hoasung01
hoasung01 / cancan_matchers.rb
Created November 26, 2016 23:50 — forked from fotinakis/cancan_matchers.rb
Custom rspec matcher for testing CanCan abilities
# Custom rspec matcher for testing CanCan abilities.
# Originally inspired by https://github.com/ryanb/cancan/wiki/Testing-Abilities
#
# Usage:
# should have_abilities(:create, Post.new)
# should have_abilities([:read, :update], post)
# should have_abilities({manage: false, destroy: true}, post)
# should have_abilities({create: false}, Post.new)
# should not_have_abilities(:update, post)
# should not_have_abilities([:update, :destroy], post)
@hoasung01
hoasung01 / apache
Last active November 4, 2016 03:54 — forked from felipelavinz/apache
Canonical redirects for Apache, lighttpd and nginx
## Canonical redirect for Apache
# BEGIN Canonical Redirect
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC] ## will match any domain that's not our main domain
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
</IfModule>
# END Canonical Redirect
@hoasung01
hoasung01 / SOLID.markdown
Created November 1, 2016 07:19 — forked from emaraschio/SOLID.markdown
SOLID Principles with ruby examples

#SOLID Principles with ruby examples

##SRP - Single responsibility principle A class should have only a single responsibility.

Every class should have a single responsibility, and that responsibility should be entirely encapsulated. All its services should be narrowly aligned with that responsibility, this embrace the high cohesion.

##OCP - Open/closed principle Software entities should be open for extension, but closed for modification.

// information made available through the dataLayer is easily used in Google Tag Manager.
// GTM-XXXXXX has to be changed to the actual GTM-code as shown in the implementation document
dataLayer = [{
'pageTitle': 'page title variable', //example
'loggedIn': 'TRUE', //example
'CLV': '2249.50', //example (only use . seperator for cents)
'userID': 'AB12345678' //example
}];
<!-- Google Tag Manager -->