Skip to content

Instantly share code, notes, and snippets.

Avatar
🤘

Brian Racer anveo

🤘
View GitHub Profile
View cloudwatch-event-to-slack-lambda.md

Sends Cloudwatch Event notifications to Slack

What is this?

AWS have released a new featue called CloudWatch Events, which lets you configure events fired by cloudwatch and direct them to SNS, Lambda functions, etc. Here's the blog post

Motivational image:

Here's the motivational image:

Slack image

@anveo
anveo / rw_ro_access.sql
Created Nov 26, 2018 — forked from checco/rw_ro_access.sql
How to create a read only user in AWS RDS PostgreSQL and a user with superuser privileges on AWS RDS PostgreSQL
View rw_ro_access.sql
--
-- Read only
--
-- Create a group
CREATE ROLE postgres_ro_group;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO postgres_ro_group;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_ro_group;
View gist:6d28f1721d9e71a464bb436952fd246c
{
"window.zoomLevel": 2,
"workbench.startupEditor": "newUntitledFile",
"gitlens.advanced.messages": {
"suppressCommitHasNoPreviousCommitWarning": false,
"suppressCommitNotFoundWarning": false,
"suppressFileNotUnderSourceControlWarning": false,
"suppressGitVersionWarning": false,
"suppressLineUncommittedWarning": true,
"suppressNoRepositoryWarning": false,
View iframe.html
<!DOCTYPE html>
<html>
<head>
<title>My Iframe</title>
</head>
<body>
<button>iframe</button>
<script type="text/javascript">
View san.rb
def sanitize(str)
# https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters
escaped_characters = Regexp.escape('\\+-&|!(){}[]^~*?:')
str = str.gsub(/([#{escaped_characters}])/, '\\\\\1')
# AND, OR and NOT are used by lucene as logical operators.
['AND', 'OR', 'NOT'].each do |word|
escaped_word = word.split('').map {|char| "\\#{char}" }.join('')
str = str.gsub(/\s*\b(#{word.upcase})\b\s*/, " #{escaped_word} ")
View pr-template.js
javascript:(function() {var e = document.getElementsByName("pull_request[body]")[0];if (e) {e.value += '#### What\'s this PR do?\n\n#### Where should the reviewer start?\n\n#### How should this be manually tested?\n\n#### Any background context you want to provide?\n\n#### What are the relevant tickets?\n\n#### Screenshots (if appropriate)\n\n#### Definition of Done:\n\n- [ ] Documentation updated as needed.\n- [ ] Unit tests added for new code.\n- [ ] Integration tests added for new functionality.\n';}})();
View gist:fe3f75b3617fd942ae26052002b67d51
@mixin vertical-align {
position: relative;
top: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
@mixin vertical-align-flex {
display: flex;
@anveo
anveo / vagrant-port-forwarding.md
Created Jun 2, 2016 — forked from karlhorky/vagrant-port-forwarding.md
Vagrant Port Forwarding on OS X Yosemite
View vagrant-port-forwarding.md

Vagrant Port Forwarding (8080 -> 80, 8443 -> 443) with pf on OSX Mavericks/Yosemite

This guide is a fork from this gist.

Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

1. Create the anchor file

Create an anchor file under /etc/pf.anchors/com.vagrant with your redirection rule like:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
View bootstrap guide guide
{"Default":{"name":"Default","sets":{"cbc5507de150aa324c323dea5246f8a7f2dd3618":{"name":"Bootstrap 1170","string":"$v = | 65px | 15px | 15px |\n$vC = | 65px |\n200px | 15px | 15px | $v*11 | $vC | 15px | 15px | 200px ( vlp, | ~ )","id":"cbc5507de150aa324c323dea5246f8a7f2dd3618"},"6a188b701a91b394b3c1608844c33ad416d21f25":{"name":"Bootstrap 970","string":"$v = | 48px | 15px | 15px |\n$vC = | 48px |\n200px | 17px | 15px | $v*11 | $vC | 15px | 17px | 200px ( vlp, | ~ )","id":"6a188b701a91b394b3c1608844c33ad416d21f25"},"fbfee59f64b58b94682597dc8e6cf67ba84a65af":{"name":"Bootstrap 750","string":"$v = | 30px | 15px | 15px |\n$vC = | 30px |\n200px | 15px | 15px | $v*11 | $vC | 15px | 15px | 200px ( vlp, | ~ )","id":"fbfee59f64b58b94682597dc8e6cf67ba84a65af"}}}}
View gist:0d3fef240cb1b46178e6
# Ignore project files in the root
*.sln
*.xcodeproj
*.sln
*.xcodeproj
# Ignore local user Visual Studio files in any folder
*.suo
*.opensdf
*.sdf