Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘
GSD. Just ping me, I'll get back at ya.

Adron Hall Adron

🤘
GSD. Just ping me, I'll get back at ya.
View GitHub Profile
@Adron
Adron / install-terraform-packer-os-x.sh
Last active Jun 22, 2021
Install Terraform & Packer on Linux
View install-terraform-packer-os-x.sh
#!/usr/bin/env bash
# Script prerequisite > install jq > https://stedolan.github.io
# ********************************************************************************************
# UPDATE: Check out Robert's repo here https://github.com/robertpeteuil/terraform-installer
# Robert's repo is more built out and has more options around the installation process.
# Cheers! -Adron
# ********************************************************************************************
cd ~
@Adron
Adron / docker-commands.sh
Last active Apr 26, 2021
Docker Commands : Killing/Stopping/Removing Containers and Images
View docker-commands.sh
# Stopping a single container that is running.
docker stop 0bd1f4ccb52d
# Stopping two or more containers that are running.
docker stop 0bd1f4ccb52d 0bd1f4ccb52d
# Showing a list of all containers.
docker ps -a
# Showing a list of the container IDs that are actively running.
@Adron
Adron / primary-key-and-data-types.md
Created Apr 26, 2021
Primary Keys and Data Types
View primary-key-and-data-types.md

Postgres Types Mapped to JavaScript via GraphQL with Hasura

Hello all, Adron here, your host on Hasura Coding. Today I've collected together a number of video shorts, extra details, and information about primary keys, primary key data types, and data types in general. In this post I've included links to mapping from Postgres types to JavaScript types via GraphQL and Hasura.

Primary Keys

Primary Key: A primary key in a relational database uniquely identifies the record among many records stored in a table.

Primary keys can be made up of one or more columns, of existing data, or made up data that serves only the purpose to identify the record itself. The following are the kinds of primary keys a table can have.

@Adron
Adron / short-url-safe-ids.sql
Created Apr 26, 2021
Short URL Safe IDs for Postgres
View short-url-safe-ids.sql
CREATE OR REPLACE FUNCTION gen_unique_short_id() returns text
language plpgsql
as $$
DECLARE
id text;
BEGIN
id := encode(gen_random_bytes(6), 'base64');
id := replace(id, '/', '_');
id := replace(id, '+', '_');
RETURN id;
@Adron
Adron / install-golang-apt-get.sh
Last active Apr 1, 2021
Installing golang via apt-get
View install-golang-apt-get.sh
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install golang
# Usually this is good to install golang, but alas the apt-get repo is usually out of sync with the latest.
@Adron
Adron / gist:e42a69307e1a889444db327859a09474
Created Dec 7, 2020
Bash file to publish (build) C# CLI to multiple OSs
View gist:e42a69307e1a889444db327859a09474
#!/usr/bin/env bash
dotnet restore
dotnet build
function publish {
echo $1
CASSIEPATH=$1
RID=$1
CASSIEPATH=release/v0/$CASSIEPATH
@Adron
Adron / disable-hyper-v.ps1
Created Feb 4, 2019
Disabling/Enabling Hyper-V via Powershell ("Run As Administrator")
View disable-hyper-v.ps1
# Remember, all of these commands need executed via Powershell that is started/opened with "Run As Administrator".
# Disabling Hyper-V
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-Hypervisor
# Enabling Hyper-V
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
View adrons-ecosystem-dev-env-docker-compose.yaml
version: '3.6'
services:
postgres:
image: postgres:12
restart: always
volumes:
- db_data:/Users/adron/Codez/databases
environment:
POSTGRES_PASSWORD: ${PPASSWORD}
ports:
@Adron
Adron / gist:6d7cb4be3a22429d0ff8c8bd360f3ce2
Created Sep 9, 2020
adrons-ecosystem-terraform-main.tf
View gist:6d7cb4be3a22429d0ff8c8bd360f3ce2
provider "azurerm" {
version = "=2.20.0"
features {}
}
resource "azurerm_resource_group" "adronsrg" {
name = "adrons-rg"
location = "westus2"
}
@Adron
Adron / pass-parameter.sh
Created Apr 16, 2016
Pass Parameters to Bash Script
View pass-parameter.sh
name=$1
if [[ -n "$name" ]]; then
echo "Got $name Parameter."
else
echo "argument error"
fi