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
FROM postgres:16 | |
RUN set -eux; \ | |
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \ | |
apt-get update; \ | |
apt-get install -y --no-install-recommends ca-certificates wget; \ | |
wget -O /usr/share/keyrings/pgxman-cli.gpg https://apt.pgxman.com/pgxman-keyring.gpg; \ | |
echo "deb [arch=${dpkgArch} signed-by=/usr/share/keyrings/pgxman-cli.gpg] https://apt.pgxman.com/cli stable main" > /etc/apt/sources.list.d/pgxman-cli.list; \ | |
apt-get update; \ | |
apt-get install -y --no-install-recommends pgxman; \ |
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
#!/usr/bin/env bash | |
set -o errexit | |
set -o pipefail | |
set -o nounset | |
# Requirememnts: | |
# - curl | |
# - jq | |
# - cut |
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
// TS Playground link: https://tsplay.dev/wRJl5w | |
interface Props { | |
baseKey: string | |
} | |
const withCustomKey = <K extends string>(customKey: K) => { | |
return <P>(props: P): P & { [k in K]: boolean } => { | |
return { ...props, [customKey]: true } as P & { [k in K]: boolean } | |
} |
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
Computer Information: | |
Manufacturer: Unknown | |
Model: Unknown | |
Form Factor: Desktop | |
No Touch Input Detected | |
Processor Information: | |
CPU Vendor: GenuineIntel | |
CPU Brand: Intel(R) Core(TM) i7-2600K CPU @ 3.40GHz | |
CPU Family: 0x6 |
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
require 'sidekiq/api'; [Sidekiq::RetrySet.new, Sidekiq::ScheduledSet.new, Sidekiq::DeadSet.new, Sidekiq::Stats.new.queues].each(&:clear); Sidekiq::Stats.new.reset |
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
# It supports queries like: | |
# ModelName.where(ModelName.arel_table[:columnname].lower.matches 'searchterm') | |
class PostgresqlLikeIIndex < ActiveRecord::Migration | |
def up | |
enable_extension 'pg_trgm' | |
execute <<~SQL | |
CREATE INDEX index_tablename_on_columnname_lower | |
ON tablename USING gin (lower(columnname) gin_trgm_ops) | |
SQL |
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 | |
# It assumes [asdf](https://github.com/asdf-vm/asdf) to be installed | |
# and asdf plugin for Ruby to be added | |
set -exuo pipefail | |
sudo apt install libreadline-dev | |
wget https://www.openssl.org/source/old/1.0.2/openssl-1.0.2u.tar.gz | |
tar -xzf openssl-1.0.2u.tar.gz |
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 | |
# GNU Guix --- Functional package management for GNU | |
# Copyright © 2017 sharlatan <[email protected]> | |
# Copyright © 2018 Ricardo Wurmus <[email protected]> | |
# Copyright © 2018 Efraim Flashner <[email protected]> | |
# | |
# This file is part of GNU Guix. | |
# | |
# GNU Guix is free software; you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License as published by |
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
<?xml version="1.0"?> | |
<!DOCTYPE tsung SYSTEM "/usr/share/tsung/tsung-1.0.dtd" [] > | |
<tsung loglevel="info"> | |
<clients> | |
<client host="localhost" use_controller_vm="true" maxusers="60000"/> | |
</clients> | |
<servers> | |
<server host="localhost" port="3334" type="tcp"></server> | |
</servers> |
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
$(document).on 'ready turbolinks:load', -> | |
SirTrevor.config.language = 'it' | |
SirTrevor.setDefaults( | |
language: 'it' | |
focusOnInit: false | |
blockTypes: ['Text', 'Image', 'List', 'Heading', 'Quote', 'Video'] | |
defaultType: 'Text' | |
iconUrl: "<%= asset_path('sir-trevor/build/sir-trevor-icons.svg') %>" | |
uploadUrl: "/admin/uploads/images" |
NewerOlder