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 / buildspec.yml
Created Nov 8, 2019
Npm install private CodeCommit repositories using SSH
View buildspec.yml
version: 0.2
phases:
install:
commands:
- "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )"
pre_build:
commands:
- aws --version
- git --version
View slider-use-case.js
let baseState
= ({
page = 1,
totalPages = 1,
canGoNext = false,
canGoPrev = false,
position = 0,
direction = null
} = {}) => ({
page,
@gemmadlou
gemmadlou / MergeSHP.md
Created Oct 25, 2019 — forked from wuhland/MergeSHP.md
Merging Shapefiles From Command Line with GDAL\OGR2OGR
View MergeSHP.md

First put all the shapefiles you want merged in one directory than I run this bash script in the folder

#!/bin/bash

file="./final/merge.shp"

for i in $(ls *.shp)
do
@gemmadlou
gemmadlou / api-gateway.tf
Created Aug 21, 2019
Terraform Lambda setup
View api-gateway.tf
resource "aws_api_gateway_rest_api" "lambda" {
name = "some_lookup"
description = "Some lookup API service"
}
resource "aws_api_gateway_resource" "proxy" {
rest_api_id = "${aws_api_gateway_rest_api.lambda.id}"
parent_id = "${aws_api_gateway_rest_api.lambda.root_resource_id}"
path_part = "{proxy+}"
}
@gemmadlou
gemmadlou / dynamoose.js
Created Aug 21, 2019
Processing large file with backpressure
View dynamoose.js
const dynamoose = require('dynamoose');
dynamoose.AWS.config.update({
region: 'eu-west-1'
});
const schema = new dynamoose.Schema({
SOMEKEY: {
type: String,
hashKey: true,
@gemmadlou
gemmadlou / has-one-relation.js
Created Aug 2, 2019
Objection Js: Has One Relation (aka Many to one)
View has-one-relation.js
const {
Model
} = require('objection');
const Knex = require('knex');
const config = require('../config')
const Authority = require('./authority')
class Licence extends Model {
static get tableName() {
return 'licence';
View dynamoose-model.js
const dynamoose = require('dynamoose');
dynamoose.AWS.config.update({
region: 'eu-west-1'
});
const schema = new dynamoose.Schema({
entity: {
type: String,
hashKey: true,
@gemmadlou
gemmadlou / docker.sh
Created Jul 19, 2019
Run mysql import using docker
View docker.sh
docker run --rm -v ~/.my.cnf:/etc/my.cnf mysql:5.7 mysql --defaults-group-suffix=_accounts -e "show databases;"
@gemmadlou
gemmadlou / lower.js
Created Jul 12, 2019
Lower case keys
View lower.js
let lower = list.map((item) => (
Object.keys(item).reduce((obj, key) => {
obj[key.toLowerCase()] = item[key]
return obj
}, {})
))
You can’t perform that action at this time.