Skip to content

Instantly share code, notes, and snippets.

View rubiesonthesky's full-sized avatar
🐙

rubiesonthesky

🐙
  • Finland
View GitHub Profile
@jamesmishra
jamesmishra / README.md
Last active March 25, 2024 20:02
Using Terraform to run a docker-compose.yml file directly on an Amazon EC2

Introduction

This is a Hashicorp Terraform module that provisions an AWS EC2 instance for the purpose of running a given docker-compose.yml file.

Usage

# ===== OUR MAGIC DOCKER-COMPOSE.YML FILE HERE =====
# It is also possible to get Terraform to read an external `docker-compose.yml`
# file and load it into this variable.
# We'll be showing off a demo nginx page.
/**
* Jest Conversion script
* This script isn't the cleanest, and uses two different methods for performing global replaces... but it gets the job done.
* We switched from using the `replace` method to the `advancedReplace` about 70% of the way through, and couldn't go and retrofit
* `advancedReplace` everywhere with 100% confidence. However, should you use this script as a base for your own migration,
* I would definitely suggest using `advancedReplace`, which uses the node-replace library.
*/
import {sync as globSync} from 'glob'
import {execSync} from 'child_process'
import fs from 'fs'
@benjamincharity
benjamincharity / mockActivatedRoute.ts
Created April 12, 2017 16:23
Mock ActivatedRoute with params, data and snapshot.
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [
MdToolbarModule,
],
providers: [
{
provide: Router,
useClass: MockRouter,
},
@shsteimer
shsteimer / gist:7257245
Created October 31, 2013 21:10
Tip to delete tags by pattern
#delete all the remote tags with the pattern your looking for, ie. DEV-
git tag | grep <pattern> | xargs -n 1 -i% git push origin :refs/tags/%
#delete all your local tags
git tag | xargs -n 1 -i% git tag -d %
#fetch the remote tags which still remain
git fetch
@havenwood
havenwood / dna-struct.rb
Created October 25, 2012 19:28
Ruby Struct for Storing DNA
DNA = Struct.new(:name, :dna, :protein)
array = []
array << DNA.new('H2', 'aaactg', 'IVL')
array << DNA.new('f9', 'ccctga', 'MET')
array[0].name
#=> "H2"
array[0].dna