Skip to content

Instantly share code, notes, and snippets.

Gemma Black gemmadlou

Block or report user

Report or block gemmadlou

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gemmadlou
gemmadlou / .autorc
Last active Apr 5, 2020
Auto docker image release
View .autorc
{
"plugins": [
"git-tag",
"conventional-commits",
[
"exec",
{
"afterVersion": "publish"
}
]
@gemmadlou
gemmadlou / .bash_profile
Last active Mar 26, 2020
AWS reassigning IP addresses automatically
View .bash_profile
function renew_aws_ip {
SECURITY_GROUP=$1
NAME_OF_RULE=$2
echo "Remove security group rule for $SECURITY_GROUP"
aws ec2 describe-security-groups \
--group-ids $SECURITY_GROUP \
--query "SecurityGroups[0].IpPermissions[*].IpRanges" \
| jq 'flatten | .[] | select(.Description == "'$NAME_OF_RULE'") | .CidrIp ' \
@gemmadlou
gemmadlou / db-connect-test.php
Created Mar 12, 2020 — forked from M165437/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
View db-connect-test.php
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
View mysql_imports.sh
mysql --defaults-group-suffix=_products --database data_analysis -e "load data local infile 'data/file.csv' into table table_name fields terminated by ',' enclosed by '\"' lines terminated by '\n'"
mysql --defaults-group-suffix=_products --database data_analysis < file.sql
# Dump
mysqldump --defaults-group-suffix=_local_products --column-statistics=0 --no-create-info --set-gtid-purged=OFF --insert-ignore rentr > test.sql
@gemmadlou
gemmadlou / 1.md
Last active Jan 6, 2020
Development-Team-Philosophy
View 1.md

Dev Philosophies - Dream

Making quality software fast.

Trust and autonomy {#trust-and-autonomy}

Trust one another to do the right thing for the right reason. At your company, you are part of a talented tech team. Ideas cannot go to waste, so share and try them out. Feel confident that you have the power to innovate. Encourage others to grow and become better developers.

Work wherever is most comfortable

View artefact
#!/usr/bin/env bash
# Usage
# artefact 1.5.6
rm ../$1.zip
(zip -r9 ../$1.zip . -x \*.git\* \*coverage\* \*tests\* \*__tests__\*)
@gemmadlou
gemmadlou / publish.js
Created Dec 30, 2019
Publishes new release (no branches)
View publish.js
/**
* Publishes new release
*
* @param {object} inject
* @param {GetLastCommit} inject.getLastCommit
* @param {GetPackage} inject.getPackage
* @param {UpdatePackage} inject.updatePackage
* @param {CommitNewVersion} inject.commitNewVersion
* @param {TagNewVersion} inject.tagNewVersion
* @param {PushCommit} inject.pushCommit
@gemmadlou
gemmadlou / publish.js
Created Dec 30, 2019
Publishes new release
View publish.js
/**
* Publishes new release
*
* @param {object} [inject]
* @param {GetLastCommit} [inject.getLastCommit]
* @param {GetPackage} [inject.getPackage]
* @param {UpdatePackage} [inject.updatePackage]
* @param {CommitNewVersion} [inject.commitNewVersion]
* @param {TagNewVersion} [inject.tagNewVersion]
* @param {PushCommit} [inject.pushCommit]
@gemmadlou
gemmadlou / artefact.sh
Created Dec 18, 2019
Simple artefact creation script
View artefact.sh
# Simple deploy script for this project
# 1. Zips project. 2. Deploys to S3. It doesn't delete or remove packages.
if ["$1" = ""]; then
echo "$(basename -- $0) <VERSION> Semver (v1.0.0)"
exit;
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ARTEFACT_NAME="project-name"
@gemmadlou
gemmadlou / lambda.js
Created Dec 18, 2019
Severless lambda port of express js
View lambda.js
const app = require("./app")
const serverless = require('aws-serverless-express')
const server = serverless.createServer(app)
module.exports.handler = (event, context) => {
return serverless.proxy(server, event, context)
}
You can’t perform that action at this time.