Skip to content

Instantly share code, notes, and snippets.

View steveblamey's full-sized avatar

steveblamey

View GitHub Profile
@steveblamey
steveblamey / gsheet-contacts.py
Created March 11, 2022 15:27
Example using the gspread python API for Google Sheets
"""Example using the gspread python API for Google Sheets
This code demonstrates how data can be acquired from a PosgreSQL database
and put into a Google Sheet.
Prerequisites:
* A project on GCP with access to the Google Sheets API and Google Drive API
* A service account in the project
* A spreadsheet in Drive, shared with the service account
@steveblamey
steveblamey / report.latex
Created October 10, 2019 09:21
Latex report template for pandoc
\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
\PassOptionsToPackage{hyphens}{url}
$if(colorlinks)$
\PassOptionsToPackage{dvipsnames,svgnames*,x11names*}{xcolor}
$endif$$if(dir)$$if(latex-dir-rtl)$
\PassOptionsToPackage{RTLdocument}{bidi}
$endif$$endif$%
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$babel-lang$,$endif$$if(papersize)$$papersize$paper,$endif$$if(beamer)$ignorenonframetext,$if(handout)$handout,$endif$$if(aspectratio)$aspectratio=$aspectratio$,$endif$$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
$if(beamer)$
$if(background-image)$
@steveblamey
steveblamey / documentation.ajs
Last active October 9, 2019 17:18 — forked from rich-biker/documentation.ajs
Generate Markdown documentation from a driving view in Archi using jArchi scripting.
/*
Script: Documentation Generation
Purpose: To generate architecture output based on a driving view
Author: Richard Heward - Tame Blue Lion Ltd
This generates a markdown file with the embedded images and text based upon a driving view in Archi of groups that trigger each other and embedded views.
See my blog for a more detailed explaination. https://www.tamebluelion.co.uk/archimate-documentation
Setting embed to false will have the images saved to file and references placed in the document. It's then up to your markdown engine. This isn't that well tested.
@steveblamey
steveblamey / 95gnome-screenlock
Created May 1, 2014 11:24
NetworkManager script to turn off Gnome screensaver auto-lock on a specifc wireless network
#!/bin/sh -e
# Turn off gnome auto screen-lock when connected to specific wireless networks
# USAGE
# This script must be placed in /etc/NetworkManager/dispatcher.d
# with an appropriate name, e.g. 95gnome-screenlock.
# Hat tip, original idea - md, http://blog.bofh.it/debian/id_444
@steveblamey
steveblamey / pam_auth_inhibit_lock
Last active August 29, 2015 14:00
Turn off gnome auto screen-lock when connected to specific wireless networks
#!/bin/sh -e
# Turn off gnome auto screen-lock when connected to specific wireless networks
# USAGE
# Add the following to /etc/pam.d/gdm-password, just after pam_gnome_keyring.so in the auth block:
# auth optional pam_exec.so quiet /usr/local/sbin/pam_auth_inhibit_lock
# Hat tip - md, http://blog.bofh.it/debian/id_444