Skip to content

Instantly share code, notes, and snippets.

View AlanGabbianelli's full-sized avatar
🇪🇺
https://nohello.club/

Alan Gabbianelli AlanGabbianelli

🇪🇺
https://nohello.club/
View GitHub Profile
@AlanGabbianelli
AlanGabbianelli / associate_file_extensions.md
Last active July 27, 2023 12:19
Associate various file extensions with a specified application on macOS

Purpose

This script is designed to associate various file extensions with a specified application on macOS. By default, it associates the file extensions with Visual Studio Code - Insiders (because that's what I use).

Dependencies

  • Homebrew
  • duti
  • The application to associate the file extensions with

Usage

@AlanGabbianelli
AlanGabbianelli / urls.rb
Last active August 27, 2020 12:25
Get list of possible URLs for Settle in the UK smart answer and check that they all return 200
# To run in publisher in production
# $ gds govuk connect app-console -e production publisher
base_url = "https://www.gov.uk/settle-in-the-uk/y"; nil
@edition = SimpleSmartAnswerEdition.published.find_by(slug: "settle-in-the-uk"); nil
@urls = []; nil
def traverse(node, url)
if node.kind == "question"
node.options.each do |option|
@AlanGabbianelli
AlanGabbianelli / PostgreSQL_and_pgAdmin
Last active November 23, 2021 11:36
PostgreSQL and pgAdmin
Mac:
brew update
brew install postgresql
brew tap homebrew/services (if services not present)
brew services start postgresql
createdb `whoami`
psql postgres -c 'CREATE EXTENSION "adminpack";'
Download and install pgAdmin
Add new server
name: localhost

Problem

Failing to connect/pair the Caseflex BT Keyboard to a Laptop running Ubuntu MATE 16.04 via bluetooth

Solution

  • Restart bluetooth: sudo /etc/init.d/bluetooth restart
  • Start blueman as superuser: sudo blueman-assistant
  • Remove the keyboard if present in the list
  • Turn on the keybord
  • Press the connect button
  • Search for new devices on blueman gui
@AlanGabbianelli
AlanGabbianelli / base_doc.rb
Created January 12, 2017 12:06 — forked from iliabylich/base_doc.rb
Apipie concerns
# A common concern,include into all doc modules
#
module BaseDoc
include Apipie::DSL::Concern
def namespace(namespace, options = {})
@namespace = namespace
@namespace_name = options[:name]
end
attr_reader :namespace_name