Skip to content

Instantly share code, notes, and snippets.

View thecjharries's full-sized avatar

CJ Harries thecjharries

View GitHub Profile
{
"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": [
"# *"
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 August 12, 2020 16:02
Using terragrunt to manage GCP remote state with a JSON creds file

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 July 12, 2018 20:51 — forked from kitwalker12/images.xml
Amazon MWS Beauty Product Feed XML Sample
<?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 04:32
A quick tutorial on how to use curl to set up a new repo

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 / !fedora-28-i3-gaps-polybar-compton.md
Last active June 20, 2020 08:45
Fedora 28: i3-gaps + polybar + compton
@thecjharries
thecjharries / color-demo.py
Created February 11, 2018 11:33
Quick demo for an SO thread
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 15:26
This is a simple working demo to illustrate the difference between the scopes of function(){} and ()=>{}
// 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 April 26, 2017 19:08
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: