Skip to content

Instantly share code, notes, and snippets.

View netuoso's full-sized avatar
💥
Programming...

Andrew Chaney netuoso

💥
Programming...
View GitHub Profile
@netuoso
netuoso / export-mm.py
Created February 8, 2023 22:02
Export Mattermost Chats
/*
Export MatterMost Chats
How to use:
- Install python3 dependencies: getpass, mattermostdriver
- Log into MatterMost
- Click the security icon to the left of address bar
- Click Cookies
- Find MMAUTHTOKEN cookie and click on it to view value
- Copy this value for use in next steps
- Create working directory and enter it
@netuoso
netuoso / rails-jsonb-queries
Created May 26, 2022 00:40 — forked from mankind/rails-jsonb-queries
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")