Skip to content

Instantly share code, notes, and snippets.

Avatar

CJ Harries thecjharries

View GitHub Profile
View vscode-settings.json
{
"terminal.integrated.shell.linux": "/bin/zsh",
"terminal.external.linuxExec": "/usr/bin/terminator",
"terminal.integrated.fontFamily": "DroidSansMono Nerd Font",
"editor.fontLigatures": true,
"editor.fontFamily": "Fira Code",
"markdown.extension.toc.omittedFromToc": {
// Use a path relative to your workspace.
"README.md": [
"# *"
View .editorconfig
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
@thecjharries
thecjharries / terragrunt-gcp-remote-state.md
Created Aug 12, 2020
Using terragrunt to manage GCP remote state with a JSON creds file
View terragrunt-gcp-remote-state.md

Terragrunt provides a remote state example for S3. I started this morning by adapting that to GCS.

# root/terragrunt.hcl
remote_state {
  backend = "gcs"
  generate = {
    path      = "backend.tf"
    if_exists = "overwrite_terragrunt"
  }
@thecjharries
thecjharries / images.xml
Created Jul 12, 2018 — forked from kitwalker12/images.xml
Amazon MWS Beauty Product Feed XML Sample
View images.xml
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>AXXXXXXXXXX</MerchantIdentifier>
</Header>
<MessageType>ProductImage</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
@thecjharries
thecjharries / !init-repo-via-github-api.md
Created May 29, 2018
A quick tutorial on how to use curl to set up a new repo
View !init-repo-via-github-api.md

Setup

git can automatically register scripts that are in your $PATH that begin with git-. This will set up and download the included scripts.

Note: you'll have to replace [gist_id with the ID in the URL for now. I haven't updated this yet with the published URL.

$ mkdir -p ~/bin
$ export PATH=$HOME/bin:$PATH
$ curl -fLo ~/bin/git-github-create-pat https://gist.github.com/thecjharries/[gist_id]/raw/git-github-create-pat.sh
@thecjharries
thecjharries / color-demo.py
Created Feb 11, 2018
Quick demo for an SO thread
View color-demo.py
try:
from tkinter import Button, Tk
except ImportError:
from Tkinter import Button, Tk
MASTER = Tk()
MASTER.wm_title("Color Demo")
MASTER.attributes('-type', 'utility')
MASTER.configure(background='#272822')
Button(
@thecjharries
thecjharries / standard-vs-arrow.js
Last active May 14, 2017
This is a simple working demo to illustrate the difference between the scopes of function(){} and ()=>{}
View standard-vs-arrow.js
// Scopes: {title (for checkInnerScopeAgainstCallingScope), name, scope}
function determineObjectScope(inner, outer) {
console.log(` ${outer.name === 'global' ? '' : 'nested '}${inner.name} this === ${outer.name} this: ${inner.scope === outer.scope}`);
}
function functionFactory(calling) {
if (calling.name && calling.scope) {
return (function() {
return function() {
@thecjharries
thecjharries / change-kde-4-screen-locker-background.sh
Last active Apr 26, 2017
change-kde-4-screen-locker-background.sh
View change-kde-4-screen-locker-background.sh
#!/bin/bash
# I sourced most of this stuff (i.e. both the commands but sed instead of leafpad) from
# https://www.maketecheasier.com/customize-kde-lock-screen/
# Gotta be using KDE 4 because this probaably doesn't work on other versions
# Image needs to be in Desktop because I'm too lazy to make it dynamic
# TODO: make this a help option
# usage: