CREATE TABLE users(
id serial not null primary key,
username text not null
);
CREATE TABLE tweets(
id serial not null primary key,
content jsonb default('{}')
);
This file contains 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
flags: {} | |
packages: | |
- . | |
extra-deps: | |
- language-glsl-0.3.0@sha256:85c1e7bf2cf5d6e604b7a2899c27e2935033425944db200798e57849e64d4c81 | |
- time-1.9.2@sha256:874e07fb970531b9dcd814f74e00f253ce2f22ccd8272a6c4c137ee9040237fb | |
resolver: lts-12.14 |
This file contains 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
-- Get size of database | |
SELECT pg_size_pretty(pg_database_size('database-name')); | |
-- Set the current session as read only | |
SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; | |
-- Locks | |
-- https://www.postgresql.org/docs/10/functions-admin.html#FUNCTIONS-ADVISORY-LOCKS | |
SELECT pg_try_advisory_lock(123123213123) as lockObtained; |
This file contains 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
use crate::core::{Check, Error as CheckError}; | |
use iced::{Application, Command, Container, Element, Settings, Text}; | |
fn main() -> iced::Result { | |
Syscheck::run(Settings::default()) | |
} | |
#[derive(Debug)] | |
pub enum Syscheck { | |
Setup(SetupState), |
This file contains 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
# Requires git and docker | |
# clone bitwarden_rs | |
git clone https://github.com/dani-garcia/bitwarden_rs | |
cd bitwarden_rs | |
# Use rust docker container to build everything | |
docker run --rm -it -v `pwd`:/bitwarden rust bash | |
# Download pi tools and openssl |
This file contains 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
# JSON diff and patch for jq (https://stedolan.github.io/jq/) | |
# Author: Srinath Sankar | |
# | |
# Usage: | |
# diff: jq -sS 'include "diff-patch"; diff' a.json b.json > patch.json | |
# patch: jq -sS 'include "diff-patch"; patch' a.json patch.json | |
# | |
# Caveats: tested only with top level objects using jq 1.6 | |
def flatten_obj: |
This file contains 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
#!/bin/bash | |
# Dynamic bracket expansion | |
eval echo "{1..3}" | |
eval echo "foo-{bar,baz}-{1..3}" | |
# Merge JSON objects | |
merged="$(jq -ers '.[0] * .[1]' <(echo '{"name": "foo"}') <(echo '{"age": "baz"}') 2>/dev/null)" | |
# Check if string is valid JSON |
This file contains 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
local function key_patterns() | |
local uniq = {} | |
for _, key in ipairs(redis.call('keys', '*')) do | |
local pattern = string.match(key, "(.-):") | |
if pattern ~= nil and pattern ~= "" then | |
if uniq[pattern] == nil then | |
table.insert(uniq, pattern) | |
uniq[pattern]=1 | |
else | |
uniq[pattern]=uniq[pattern]+1 |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Fit canvas to viewport for mobile devices</title> | |
<style> | |
* { | |
margin: 0; | |
padding: 0; | |
} |
This file contains 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
neolink | [2023-05-01T06:39:38Z INFO neolink::rtsp::states::loggedin] backyard: Camera time is already set: 2023-05-01 16:39:31.0 -10:00:00 | |
neolink | [2023-05-01T06:39:39Z INFO neolink::rtsp::states::loggedin] backyard: Camera reports firmware version v3.0.0.1045_22061301 | |
neolink | [2023-05-01T06:39:39Z INFO neolink::rtsp::states::streaming] backyard: Starting video stream Sub Stream (Fluent) | |
neolink | [2023-05-01T06:39:39Z DEBUG neolink::rtsp::gst::sender] New IFrame for buffer @ 3.608911s | |
neolink | [2023-05-01T06:39:39Z DEBUG neolink::rtsp::gst::sender] Pushed iFrame to buffer at 3.608911s | |
neolink | [2023-05-01T06:39:39Z DEBUG neolink::rtsp::gst::sender] Iframes left in the buffer: 1 | |
neolink | [2023-05-01T06:39:39Z DEBUG neolink::rtsp::gst::sender] New PFrame for buffer @ 3.675577s | |
neolink | [2023-05-01T06:39:39Z DEBUG neolink::rtsp::gst::sender] New PFrame for buffer @ 3.742247s | |
neolink | [2023-05-01T06:39:39Z DEBUG neolink::rtsp::gst::sender] New PFrame for buffer @ 3.80891s | |
neolink | [2023-0 |