Run a file with sql commands: \i /tmp/schema.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| yum -y update | |
| yum -y install gcc make | |
| cd /usr/local/src | |
| wget http://download.redis.io/releases/redis-5.0-rc4.tar.gz | |
| tar xzf redis-5.0-rc4.tar.gz | |
| cd redis-5.0-rc4 | |
| make distclean | |
| make |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| npm uninstall -g rtoinsider-cli | |
| npm i -g rtoinsider-cli@0.0.14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const got = require('got') | |
| const Canvas = require('canvas') | |
| const assert = require('assert') | |
| const AWS = require('aws-sdk') | |
| const PassThrough = require('stream').PassThrough | |
| require('pdftk-lambda') | |
| function NodeCanvasFactory () {} | |
| global.HTMLElement = class {} | |
| process.on('unhandledRejection', r => console.log(r)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH a AS ( | |
| INSERT INTO messages(user_id, thread_id) values('6a5afc90-2791-4905-813a-5397f15b8a3d', 'b10663fa-20a0-4445-9743-9319dffb962e') RETURNING id AS message_id | |
| ), | |
| b AS ( | |
| INSERT INTO entities(name) values('ben') RETURNING id AS entity_id | |
| ) | |
| INSERT INTO messages_entities(message_id, entity_id) SELECT a.message_id, b.entity_id FROM a, b; | |
| SELECT messages.id, messages_entities.entity_id, entities.name | |
| FROM messages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = ({ | |
| messageId, | |
| destination, | |
| source, | |
| subject, | |
| snippet, | |
| html, | |
| text | |
| }) => ` | |
| WITH data( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo su - | |
| yum install -y https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-redhat10-10-2.noarch.rpm | |
| yum install -y postgresql10 | |
| sed -i "s/rhel-\$releasever-\$basearch/rhel-latest-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo" | |
| ln -s /usr/pgsql-10/bin/psql /usr/bin/psql | |
| # test: https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/postgresql10-test-10.5-1PGDG.rhel7.x86_64.rpm | |
| # server: https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/postgresql10-server-10.5-1PGDG.rhel7.x86_64.rpm | |
| # contrib https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/postgresql10-contrib-10.5-1PGDG.rhel7.x86_64.rpm | |
| # docs: https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/postgresql10-docs-10.5-1PGDG.rhel7.x86_64.rpm |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TYPE label AS ENUM ('SENT', 'INBOX'); | |
| CREATE TYPE role AS ENUM ('ADMIN', 'USER', 'SESSION'); | |
| CREATE TYPE entity_type as ENUM ('DESTINATION', 'SENDER'); | |
| CREATE EXTENSION IF NOT EXISTS "pgcrypto"; | |
| CREATE TABLE IF NOT EXISTS users ( | |
| id UUID PRIMARY KEY DEFAULT gen_random_uuid(), | |
| created_at timestamp default current_timestamp, | |
| token varchar(300), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Tortor pretium viverra suspendisse potenti nullam ac tortor vitae purus. Massa enim nec dui nunc. Etiam non quam lacus suspendisse faucibus interdum posuere lorem ipsum. Orci sagittis eu volutpat odio facilisis mauris sit amet. Commodo viverra maecenas accumsan lacus vel facilisis volutpat. Urna et pharetra pharetra massa. Risus at ultrices mi tempus imperdiet nulla malesuada pellentesque. A erat nam at lectus urna. Id venenatis a condimentum vitae. Et netus et malesuada fames ac turpis egestas integer eget. Pharetra convallis posuere morbi leo urna molestie at. Quam elementum pulvinar etiam non quam. Viverra tellus in hac habitasse platea dictumst vestibulum. Gravida quis blandit turpis cursus in. Molestie nunc non blandit massa enim. Ultricies lacus sed turpis tincidunt id aliquet risus feugiat in. | |
| Pellentesque elit eget gravida cum sociis natoque. Odio eu feugiat pretium nibh ipsum. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WITH input(query) AS ( | |
| VALUES( | |
| text 'tabletop' | |
| ) | |
| ), | |
| decoded AS ( | |
| SELECT x.* FROM ( | |
| SELECT | |
| CONVERT_FROM( | |
| DECODE(files.data, 'BASE64'), 'UTF-8' |