Skip to content

Instantly share code, notes, and snippets.

View vumanhcuongit's full-sized avatar

Cuong Vu vumanhcuongit

View GitHub Profile
@vumanhcuongit
vumanhcuongit / sublime_setting
Created October 14, 2019 15:57
sublime_setting
{
"bold_folder_labels": true,
"color_scheme": "Monokai.sublime-color-scheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 15,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
@vumanhcuongit
vumanhcuongit / workflow.md
Last active December 4, 2015 14:52
Mortgage Club Workflow

Mortgage Club workflow

Create issue

  • The more details in description is highly recommended. This not only helps the assignee, but also the reviewer may have a tight look on the issue, in order to closely reach the expectation.
  • We have these labels new, in progress, done, you can use them to describe status of the issue.

Create pull request

  • Even though your work have not been completed, you should create pull request ASAP because other team members can review it soon and you are able to update code quickly.
  • Please use a hashtag to tag an issue that the pull request belongs to.
@vumanhcuongit
vumanhcuongit / .rubocop_todo.yml
Created December 1, 2015 02:47
.rubocop_todo.yml
# This configuration was generated by `rubocop --auto-gen-config`
# on 2015-08-12 15:11:20 +0700 using RuboCop version 0.32.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 2
Lint/AmbiguousOperator:
Enabled: false
@vumanhcuongit
vumanhcuongit / .rubocop.yml
Last active December 1, 2015 02:48
.rubocop.yml
inherit_from: .rubocop_todo.yml
AllCops:
RunRailsCops: true
Include:
- '**/Rakefile'
- '**/config.ru'
Exclude:
- 'db/**/*'
- 'config/**/*'
@vumanhcuongit
vumanhcuongit / calculator.js
Created October 9, 2015 11:31
mortgage club calculator.js
var MortgageCalculatorMixin = {
monthlyPayment: function(amount, rate, numOfPeriods) {
var ratePerPeriod = rate / 12;
var numerator = ratePerPeriod * Math.pow((1 + ratePerPeriod), numOfPeriods);
var denominator = Math.pow((1 + ratePerPeriod), numOfPeriods) - 1;
var am = amount * (numerator / denominator);
return Math.round(am * 100) / 100;
},
totalInterestPaid: function(amount, rate, numOfPeriods, monthlyPayment) {
@vumanhcuongit
vumanhcuongit / references.md
Last active October 12, 2015 10:42
references.md

9 years, 8% investment return rates, 20% tax rates, Loan amount: 400000, Dow payment: 100000

apr: 2.765

down_payment: 100000

fees:

  • Appraisal fee: 400
  • Credit report fee: 17
@vumanhcuongit
vumanhcuongit / drag_drop_cucumber.rb
Last active January 29, 2021 02:10
Drag & Drop Cucumber
When /^I drag the file "([^\"]*)" to "([^\"]*)"$/ do |file, field|
# make an input field be visible
page.execute_script("document.getElementsByName('#{field}')[0].className = '';") # remove class .hidden
page.execute_script("document.getElementsByName('#{field}')[0].setAttribute('style', 'display:block;')") # remove style="display: none;"
patiently do
attach_file(field, File.expand_path(file)) # attach file to input
end
draggable = page.find(".topMenu") # whatever
droppable = page.find("##{field}") # an input where we'll drag file into
@vumanhcuongit
vumanhcuongit / parse_keys.md
Last active September 26, 2015 05:26
Parse Keys

Application ID

Def6BR2HfIbLhdNyYmXteGoqINyMLI6nl14Mfbr2

Client Key

dATiLnoda7htrrQkWSC5pjmTQkV6jVMGFQu2ACJG

JavaScript Key

Gl3bgiUDi8VYKjgEj7MzFncpTf8SxOD3PEPepOD6

Webhook Key

@vumanhcuongit
vumanhcuongit / wtt_api_response
Created May 25, 2015 04:50
WTT API's response
{
"result": {
"userid": "2072019",
"username": "kimcuongtim",
"avatarurl": "http://img.webtretho.com/forum/customavatars/avatar2072019_1.gif",
"profileurl": "http://www.webtretho.com/forum/member.php?u=2072019",
"joindate": "24/08/2014",
"posts": "120",
"thankedcount": "5"
},
@vumanhcuongit
vumanhcuongit / gist:a1daa595860e490dadcb
Created May 21, 2015 03:50
Sublime Text - Setting User
{
"bold_folder_labels": true,
"font_size": 13,
"highlight_line": true,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 1,
"line_padding_top": 1,