This is a generic guidline that applies mostly to Ruby on Rails and Postgres, but can be usefull for running any database migrations in CI.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "aws" { | |
region = "us-east-1" | |
} | |
data "aws_caller_identity" "current" {} | |
data "aws_vpc" "vpc" { | |
filter { | |
name = "tag:Name" | |
values = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Types::FoosType = GraphQL::ObjectType.define do | |
field :foos, !types[Types::FooType] do | |
timed true # enable New Relic trace_execution_scoped | |
description "Returns foos" | |
argument :per, types.Int, default_value: 20 | |
argument :page, types.Int, default_value: 1 | |
# Moving to cursor pagination would be better | |
resolve(...) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
packer build packer.json 2>&1 | sudo tee output.txt | |
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash |
This article is now published on my website: A one-off git repo server.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- example for the http://retinafy.me ebook --> | |
<style> | |
div.rss { | |
background: url(rss.svg); | |
width: 32px; | |
height: 32px; | |
} | |
body.no-svg div.rss { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get the Heroku db as detailed here: | |
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup | |
1. heroku pgbackups:capture | |
2. heroku pgbackups:url <backup_num> #=>backup_url | |
- get backup_num with cmd "heroku pgbackups" | |
3. curl -o latest.dump <backup_url> | |
Then locally do: | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a short collection of tools that are useful for managing your | |
# known_hosts file. In this case, I'm using the '-f' flag to specify the | |
# global known_hosts file because I'll be adding many deploy users on this | |
# system. Simply omit the -f flag to operate on ~/.ssh/known_hosts | |
# Add entry for host | |
ssh-keyscan -H github.com >> /etc/ssh/ssh_known_hosts | |
# Scan known hosts | |
ssh-keygen -f /etc/ssh/ssh_known_hosts -F github.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin ie6 { * html & { @content } } | |
#logo { | |
background-image: url("/images/logo.png"); | |
@include ie6 { background-image: url("/images/logo.gif"); } | |
} |
NewerOlder