Skip to content

Instantly share code, notes, and snippets.

View hurrifan1's full-sized avatar
🌇

Austin Spivey hurrifan1

🌇
View GitHub Profile
TMPDIR="/gisdata/temp/"
UNZIPTOOL=unzip
WGETTOOL="/usr/bin/wget"
export PGBIN=/usr/lib/postgresql/14/bin
export PGPORT=5432
export PGHOST=localhost
export PGUSER=$1
export PGPASSWORD=$2
export PGDATABASE=osm
PSQL=${PGBIN}/psql
@hurrifan1
hurrifan1 / mapping-1.yaml
Last active November 7, 2022 16:07
New mapping file for OSM import, includes infrastructure elements
tags:
load_all: true
tables:
power:
columns:
- name: osm_id
type: id
- name: geometry
type: geometry
- key: name
@hurrifan1
hurrifan1 / mapping.yaml
Created October 28, 2022 13:16
Mapping YAML file for OSM import
areas:
area_tags: [building, landuse, leisure, natural, aeroway]
linear_tags: [highway, barrier]
generalized_tables:
landusages_gen0:
source: landusages_gen1
sql_filter: ST_Area(geometry)>500000.000000
tolerance: 200.0
landusages_gen1:
source: landusages
@hurrifan1
hurrifan1 / Open app from QMC.js
Last active October 15, 2022 16:58
JavaScript bookmarklet for opening an app in a new tab when that app is highlighted in the QMC
(async function run() {
/**
* Here we check to make sure we're on the Apps page of the QMC.
* If we aren't on the Apps page, we exit the script with an
* error message.
*/
if (window.location.pathname.includes("/qmc/apps") != true) {
let msg = "Only use this in the QMC!";
console.log("####", msg);
alert(msg);
<#
# Migrate data connections
# ========================
#
# Requirements:
# - Qlik CLI tool (🔗 - https://github.com/qlik-oss/qlik-cli)
# - The ID of the data connection to migrate
#
# Steps:
# 1. Login to origin Qlik env.
/* REST error retry loop */
/* - This script will try to execute a subroutine 3 times before it finally fails. */
Set ErrorMode = 0;
SUB MySub
LIB CONNECT TO 'Server test';
[MyTable]:
SQL SELECT
@hurrifan1
hurrifan1 / Creating link and date tables in Qlik Sense.qvs
Created February 24, 2022 17:08
Creating link and date tables in Qlik Sense
@hurrifan1
hurrifan1 / Update DataTransfer load script.ps1
Last active March 18, 2022 14:29
Update DataTransfer load script
# Update DataTransfer load script
# Location of datasets.json file
$ds_path = "C:\ProgramData\Qlik\DataTransfer\DataUpload\storage\datasets.json"
# Get file contents as PSObject
$ds = Get-Content $ds_path | ConvertFrom-Json -Depth 20
# Narrow to relevant data connection
$aws_con = $ds | ? { $_.name -eq "AWS SQL Server test 1" }
@hurrifan1
hurrifan1 / AssignNPrintingRoles.ps1
Created December 16, 2021 14:41
Assign nPrinting roles with nPrinting CLI using PowerShell
<#
# # # # Assign nPrinting roles with nPrinting CLI using PowerShell # # # #
- Created by: Austin Spivey (aspivey@copleycg.com)
- Uses: https://github.com/QlikProfessionalServices/QlikNPrinting-CLI
- Last updated: 12/16/2021
-License: MIT
Copyright 2021 Austin Spivey (aspivey@copleycg.com)
#>
@hurrifan1
hurrifan1 / Scrape protected site.py
Created October 27, 2021 16:24
Using Python to access a password-protected page and scrape the data therein
# Using Python to access a password-protected page and scrape the data therein
#
# Make sure to install the Selenium and BeautifulSoup packages before running this script.
#
# Also, you need to install the ChromeDriver that matches your Chrome version:
# - https://chromedriver.chromium.org/downloads
#
# Things you can do to adapt and improve this script:
# - Install and use the python-dotenv package to use a .env file for storing your login credentials
# without accidentally exposing them to code reviewers.