This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sed -i '' 's/#2bc2dd/#2cc4ea/g' *.scss | |
| find . -type f -name "*.html.erb" -exec sed -i '' 's/#2bc2dd/#2cc4ea/g' '{}' \; | |
| # ref: https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d | |
| # https://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-have-been-merged |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ref: https://www.digitalocean.com/community/tutorials/how-to-manage-log-files-with-logrotate-on-ubuntu-12-10 | |
| # for ROR application | |
| /home/*/current/log/*.log { | |
| daily | |
| missingok | |
| rotate 7 | |
| compress | |
| delaycompress | |
| notifempty |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| expect(mail.from).to include 'sender@example.com' | |
| expect(mail.to).to include 'receiver@example.com' | |
| expect(mail.subject) | |
| .to eq 'Test Email Subject' | |
| expect(mail.reply_to).to include 'reply_to@example.com' | |
| expect(mail.attachments.size).to eq 1 | |
| attachment = mail.attachments[0] | |
| expect(attachment).to be_a_kind_of Mail::Part | |
| expect(attachment.content_type).to match %r(application/pdf) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ref: https://stackoverflow.com/questions/4099409/ | |
| # ruby-how-to-chain-multiple-method-calls-together-with-send? | |
| # answertab=active#tab-top | |
| # | |
| # This helper is to create a custom method to send a chain | |
| # of string to the active record | |
| module ChainMethodHelper | |
| def send_chain(arr) | |
| arr.inject(self) {|o, a| o.send(:try, a) } | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ref: https://stackoverflow.com/questions/11773544/nginx-different-domains-on-same-ip | |
| upstream your_app { | |
| server unix:///home/your_app/shared/tmp/sockets/puma.sock fail_timeout=0; | |
| } | |
| # Redirect from http to https | |
| server { | |
| listen 80; | |
| server_name domain1.com www.domain1.com; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var formatMoney = function(price) { | |
| var formatter = new Intl.NumberFormat('en-US', { | |
| style: 'currency', | |
| currency: 'USD', | |
| minimumFractionDigits: 0, | |
| }); | |
| if (price > 999999) { | |
| var roundedPrice = (price / 1000000).toFixed(1) | |
| return formatter.format(roundedPrice) + 'mm'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd ~ | |
| git clone https://github.com/letsencrypt/letsencrypt | |
| cd ~/letsencrypt | |
| sudo service nginx stop | |
| ./letsencrypt-auto certonly --standalone -d new_website.com | |
| sudo service nginx start |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if [ -f "$rvm_path/scripts/rvm" ] && [ -f ".rvmrc" ]; then | |
| source "$rvm_path/scripts/rvm" | |
| source ".rvmrc" | |
| fi |
NewerOlder