Skip to content

Instantly share code, notes, and snippets.

View andrew310's full-sized avatar

Andrew Brown andrew310

View GitHub Profile
@billykong
billykong / fixing-script-for-updated-aws-cli-ecr-login.md
Created March 19, 2020 02:39
Uses `aws ecr get-login-password` after `aws ecr get-login` depreciation

aws ecr get-login depreciated

$ aws ecr get-login --region ap-southeast-1
usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
 aws   help
@zhang-shengping
zhang-shengping / typeorm column type
Created February 26, 2019 12:15
typeorm column type
import {Entity} from "../../../../../../src/decorator/entity/Entity";
import {PrimaryColumn} from "../../../../../../src/decorator/columns/PrimaryColumn";
import {Column} from "../../../../../../src/decorator/columns/Column";
@Entity()
export class Post {
@PrimaryColumn()
id: number;
@miguelmota
miguelmota / Makefile
Last active June 11, 2024 00:17
Makefile docker push to AWS Elastic Container Registry (ECR)
# Login to AWS registry (must have docker running)
docker-login:
$$(aws ecr get-login --no-include-email --region us-east-1 --profile=mycompany)
# Build docker target
docker-build:
docker build -f Dockerfile --no-cache -t mycompany/myapp .
# Tag docker image
docker-tag:
@madsleejensen
madsleejensen / circle.yml
Created June 12, 2017 13:21
circleci docker-compose laravel example
machine:
pre:
- curl -sSL https://s3.amazonaws.com/circle-downloads/install-circleci-docker.sh | bash -s -- 1.10.0
- sudo curl -L -o /usr/local/bin/docker-compose https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m`
- sudo chmod +x /usr/local/bin/docker-compose
services:
- docker
dependencies:
override:
# generate a .env file by interpolating the template (.env.example) with environment variables (defined in circleci)
@ustroetz
ustroetz / service.py
Last active November 5, 2023 21:30
Lambda function to trigger dependent AWS Batch jobs
def handler(event, context):
client = boto3.client('batch', 'us-east-1')
analyzer_job = client.submit_job(
jobName='ma-analyzer',
jobQueue='ma',
jobDefinition='ma-analyzer:1',
containerOverrides={
'command': ['python', 'service.py']
})
@ehernandez-xk
ehernandez-xk / upload-file-s3.go
Last active January 31, 2021 00:56
Uploading a file to AWS S3 using aws-sdk-go
/*
https://www.youtube.com/watch?v=iOGIKG3EptI
https://github.com/awslabs/aws-go-wordfreq-sample/blob/master/cmd/uploads3/main.go
https://docs.aws.amazon.com/sdk-for-go/api/aws/
- first configure your aws credentials run: aws configure
- go get -u github.com/aws/aws-sdk-go/aws
- login to UI web aws s3 interface
- go to S3 service
import { EditorState, Modifier, Entity, SelectionState } from 'draft-js'
import linkifyIt from 'linkify-it'
import tlds from 'tlds'
const linkify = linkifyIt()
linkify.tlds(tlds)
const linkifyEditorState = (editorState) => {
const contentState = editorState.getCurrentContent()
@tonywhittaker
tonywhittaker / Query Copy Example.py
Last active February 24, 2022 02:01
Move data from MSSQL to Redshift with Luigi
class SomeExport(luigi.Task):
date = luigi.DateParameter(default=datetime.date.today())
def output(self):
return luigi.s3.S3Target(self.date.strftime('s3://mybucket/%Y%m%d.txt.gz'))
def requires(self):
return None
def run(self):
@rajarsheem
rajarsheem / GDrive.py
Last active March 9, 2023 20:58
Python terminal client for Google Drive for easy uploading, deleting, listing, sharing files or folders. (See usage in the comment)
from __future__ import print_function
import sys
import io
import pip
import httplib2
import os
from mimetypes import MimeTypes
@fredbenenson
fredbenenson / kickstarter_sql_style_guide.md
Last active October 14, 2025 15:32
Kickstarter SQL Style Guide
layout title description tags
default
SQL Style Guide
A guide to writing clean, clear, and consistent SQL.
data
process

Purpose