Skip to content

Instantly share code, notes, and snippets.

View ELI7VH's full-sized avatar
💭
Doing a thing.

Elijah Lucian ELI7VH

💭
Doing a thing.
View GitHub Profile
@ELI7VH
ELI7VH / example-nginx-react-router-express-api-sockets-https.conf
Last active October 6, 2019 18:42
Example nginx create-react-app react router api socket.io with https
server {
server_name example.com;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
gzip on;
gzip_types text/css application/javascript application/json image/svg+xml;
@mankind
mankind / rails-jsonb-queries
Last active April 17, 2024 12:14
Ruby on Rails-5 postgresql-9.6 jsonb queries
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")