h_analytics=# select name, default_version, installed_version from pg_available_extensions where installed_version is not null;
name | default_version | installed_version
-----------+-----------------+-------------------
uuid-ossp | 1.1 | 1.1
plpgsql | 1.0 | 1.0
(2 rows)
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
names = [ | |
'user a', | |
'user b', | |
'user c', | |
] | |
for (let i = 0; i < names.length; i++) { | |
Array.from(document.querySelectorAll('button')).filter(b => b.innerText == 'Add member')[0].click() | |
} |
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
import base64, uuid, binascii, traceback | |
ES_FLAKE_MAGIC_BYTE = ['e', '5'] | |
def _must_b64_decode(data, expected_size=None): | |
result = base64.urlsafe_b64decode(data) | |
if expected_size is not None and len(result) != expected_size: | |
raise TypeError('incorrect data size') | |
return result |
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
import aiopg, asyncio, psycopg2, sys, time | |
dsn = "dbname=db user=postgres" | |
async def listen(conn): | |
async with conn.cursor() as cur: | |
await cur.execute("LISTEN topic") | |
while True: | |
sec = time.gmtime().tm_sec | |
if sec % 5 == 0: |
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 lambda_sgs as ( | |
select | |
'Lambda' as service, | |
f.arn, | |
sg_id as security_group_id | |
from | |
aws_lambda_function as f, | |
jsonb_array_elements_text(f.vpc_security_group_ids) as sg_id | |
), | |
ec2_instance_sgs as ( |
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
select title, id, resource from | |
( | |
select | |
title, | |
key_pair_id as id, | |
'aws_ec2_key_pair' as resource, | |
tags | |
from | |
aws_ec2_key_pair | |
union |
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 filenames as ( | |
select | |
id, | |
jsonb_object_keys(files) as name | |
from github_my_gist | |
) | |
select | |
f.name, | |
g.files -> f.name ->> 'language' as language, | |
g.description as pattern |
I saw a use of the internal function glob(text)
and
couldn't find anything about it in the docs.
Thanks to https://gist.github.com/ianpgall/9492728#file-postgres-view-functions-sql:
> select * from showfunctions where function_definition ~ 'glob';
+---------+----------------------------+---------------------------------------------------------+
| lanname | function_definition | source |
+---------+----------------------------+---------------------------------------------------------+
File1
cd ~
git clone https://github.com/judell/steampipe-plugin-hello.git
cd ~/steampipe-plugin-hello