Install puma-dev as described in the official documentation
brew install puma/puma/puma-dev
# Configure some DNS settings that have to be done as root
| #!/bin/bash | |
| set -euo pipefail | |
| # Definition of colors for terminal output | |
| readonly RED_COLOR="\e[31m" | |
| readonly GREEN_COLOR="\e[32m" | |
| readonly YELLOW_COLOR="\e[33m" | |
| readonly BLUE_COLOR="\e[34m" | |
| readonly MAGENTA_COLOR="\e[35m" |
| begin | |
| c = IRB::Color | |
| token_seq_exprs = IRB::Color::const_get(:TOKEN_SEQ_EXPRS) | |
| # TODO: italics; see https://github.com/microsoft/vscode/issues/49236 | |
| # TODO: how to customize method names (cyan or bold cyan I think?) | |
| # TODO: what about TOKEN_SEQ_KEYWORDS? do we care? | |
| one_dark = { | |
| on_comment: [c::CLEAR], # needs italics | |
| on_const: [c::YELLOW, c::BOLD], |
Install puma-dev as described in the official documentation
brew install puma/puma/puma-dev
# Configure some DNS settings that have to be done as root
| # Set the control character to Ctrl+Spacebar (instead of Ctrl+B) | |
| set -g prefix C-space | |
| unbind-key C-b | |
| bind-key C-space send-prefix | |
| # Set new panes to open in current directory | |
| bind c new-window -c "#{pane_current_path}" | |
| bind '"' split-window -c "#{pane_current_path}" | |
| bind % split-window -h -c "#{pane_current_path}" |
| # config/initializers/active_admin.rb | |
| # ...rest of the initializer here... | |
| module AdminPageLayoutOverride | |
| def build(*args) | |
| # you can move the call to super at the end, if you wish | |
| # to insert things at the begining of the page | |
| super |
| # app deps | |
| sudo yum install git | |
| # erlang deps | |
| sudo yum groupinstall "Development Tools" | |
| sudo yum install ncurses-devel openssl-devel | |
| # erlang | |
| wget http://www.erlang.org/download/otp_src_19.2.tar.gz | |
| tar -zxvf otp_src_19.2.tar.gz |
| // see for screenshot: | |
| // https://twitter.com/paul_irish/status/829090506084749312 | |
| const http = require('http'); | |
| function requestHandler(request, response) { | |
| const headers = { | |
| 'Server-Timing': ` | |
| sql-1;desc="MySQL lookup Server";dur=100, | |
| sql-2;dur=900;desc="MySQL shard Server #1", |
| http://stackoverflow.com/questions/22667401/postgres-json-data-type-rails-query | |
| http://stackoverflow.com/questions/40702813/query-on-postgres-json-array-field-in-rails | |
| #payload: [{"kind"=>"person"}] | |
| Segment.where("payload @> ?", [{kind: "person"}].to_json) | |
| #data: {"interest"=>["music", "movies", "programming"]} | |
| Segment.where("data @> ?", {"interest": ["music", "movies", "programming"]}.to_json) | |
| Segment.where("data #>> '{interest, 1}' = 'movies' ") | |
| Segment.where("jsonb_array_length(data->'interest') > 1") |
| secret_key = "secret-key" | |
| text = "This is a secret" | |
| hmac = :crypto.hmac(:sha, secret_key, text) | |
| |> Base.encode16 | |
| |> String.downcase | |
| IO.puts "HMAC is #{hmac}" # HMAC is 08dc7014b3e778a44af52ea7a16a973a9b48f0dd |
| # app deps | |
| sudo yum install git | |
| # erlang deps | |
| sudo yum groupinstall "Development Tools" | |
| sudo yum install ncurses-devel | |
| # erlang | |
| wget http://www.erlang.org/download/otp_src_18.1.tar.gz | |
| tar -zxvf otp_src_18.1.tar.gz |