Skip to content

Instantly share code, notes, and snippets.

View iamdbc's full-sized avatar
:octocat:
life is coding

iamdbc

:octocat:
life is coding
View GitHub Profile
@iamdbc
iamdbc / [macOS] not index node_modules
Created December 8, 2020 08:41
[macOS] not index node_modules to spotlight
find . -type d -name "node_modules" -exec touch "{}/.metadata_never_index" \;
@iamdbc
iamdbc / logrotate-puma-rails
Last active September 20, 2023 14:57
logrotate for puma on rails
# file location: /etc/logrotate.d
/home/deploy/app/your-app/shared/log/*.log {
daily
missingok
rotate 14
compress
delaycompress
dateext
notifempty
@iamdbc
iamdbc / deploy.rb
Last active August 9, 2017 02:13
mina 1.x config file
require 'mina/rails'
require 'mina/git'
require 'mina/rvm' # for rvm support. (https://rvm.io)
require 'mina/puma'
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
# branch - Branch name to deploy. (needed by mina/git)
functin formatMoney (value) {
if (!value) return '0';
var num = value.toString().split('.')[0];
var dot = value.toString().split('.')[1];
var num = (num || 0).toString(), result = '';
while (num.length > 3) {
result = ',' + num.slice(-3) + result;