Skip to content

Instantly share code, notes, and snippets.

View dthtien's full-sized avatar
🎯
Focusing

The Tiến dthtien

🎯
Focusing
View GitHub Profile

Typical rails setup with docker+puma+nginx+postgres

Zaid Annas

Devsinc inc. 30/08/2018

Overview

@dthtien
dthtien / post_to_slack.rb
Created March 28, 2020 16:47 — forked from jlecour/post_to_slack.rb
How to post alerts from Monit to Slack
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|
@dthtien
dthtien / gist:0501c725af1b8a5a0125f35dcb1ad166
Last active November 5, 2024 11:59
Show Ruby and Node versions in ZSH terminal.
function ruby_version()
{
  if which rvm-prompt &> /dev/null; then
    rvm-prompt i v g
  else
    if which ruby &> /dev/null; then
      ruby -v | sed -E 's/.*ruby ([0-9]+\.[0-9]+\.[0-9]+).*/\1/'
 fi