Skip to content

Instantly share code, notes, and snippets.

View leslie-alldridge's full-sized avatar
😺
Coding with my cat - Looking for React / Python projects to contribute to.

Leslie Alldridge leslie-alldridge

😺
Coding with my cat - Looking for React / Python projects to contribute to.
View GitHub Profile
@leslie-alldridge
leslie-alldridge / main.tf
Created November 28, 2023 05:16
code example AWS tagging + Terraform
provider "aws" {
region = "us-east-1"
default_tags {
tags = {
app = "aws-tags"
owner = "tagging-team"
cost_centre = "platform"
slack_channel = "#help-tagging"
}
}
@leslie-alldridge
leslie-alldridge / main.tf
Created August 26, 2022 07:53
terraform substring contains
locals {
rg_string = "rg-d-lxr-aus-app1"
// Use split by - to create an array so we can use contains()
is_rg = contains(split("-", local.rg_string), "rg")
final_rg_string = local.is_rg ? replace(local.rg_string, "aus-", "") : local.rg_string
not_rg_string = "blah-d-lxr-aus-app1"
is_not_rg = contains(split("-", local.not_rg_string), "rg")
final_not_rg_string = local.is_not_rg ? replace(local.not_rg_string, "aus-", "") : local.not_rg_string
}
import React from "react";
import "./App.css";
import Table from "react-bootstrap/Table";
class App extends React.Component {
state = {
values: [
{ id: 1, name: "test", isActive: true },
{ id: 2, name: "test2", isActive: false },
{ id: 3, name: "test3", isActive: false },
{
"api.version":"v1",
"sources":[{
"name":"Test-Chef",
"category":"Chef",
"automaticDateParsing":true,
"multilineProcessingEnabled":false,
"useAutolineMatching":false,
"forceTimeZone":false,
"timeZone":"UTC",
import requests
import csv
from bs4 import BeautifulSoup
f = csv.writer(open('z-artist-names.csv', 'w'))
f.writerow(['Name', 'Link'])
url = 'https://web.archive.org/web/20121007172955/https://www.nga.gov/collection/anZ1.htm'
@leslie-alldridge
leslie-alldridge / server.js
Created March 27, 2019 08:40
server js for exercise
const express = require("express");
const hbs = require("express-handlebars");
var fs = require("fs");
const server = express();
// Middleware
server.engine(
"hbs",
hbs({
const data = {
houses: [{
1: 'big house',
2: 'small house',
3: 'medium house'
}],
people:[{
1: {
name: 'bethanie',
age: '22',
@leslie-alldridge
leslie-alldridge / gist:5b145c40034a087c86e22059028bf6c5
Created February 20, 2019 08:05
Google Cloud Deploy Commands
gcloud app deploy --version 1 --no-promote --project (projectname without brackets)
gcloud app browse
gcloud config set project (project name)
<PropsPage name="Chief" age="22" reset={this.resetClick} />
The information above is available in props, such as {props.age}, {props.name} and {props.reset}. This allows our child
components to communicate backwards to the Parent Component - all while listening and waiting for any changes in props that
happen as a result.
In short, my PropsPage component now has extra data being pushed into it from an external source (external to the component itself).
@leslie-alldridge
leslie-alldridge / React State
Created January 27, 2019 07:47
React State Example
state = {
string: "This is a message saved in state",
object: {
key: 1,
value: "My favourite car manufacturer is Honda"
},
number: 1,
array: [1, 2, 3],
function: () => {
alert("you run the function");