Skip to content

Instantly share code, notes, and snippets.

View hazmatzo's full-sized avatar

Zoe Madden-Wood hazmatzo

View GitHub Profile
@hazmatzo
hazmatzo / postgres_command.txt
Created September 19, 2019 18:24
Commands for uploading a local downloaded database, because I do that all the time and always forget the parameters
heroku pg:backups:capture --app some-website-acceptance
heroku pg:backups:download --app some-website-acceptance
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U postgres -d some_website_development latest.dump

Common Reasons Reviewers Block a PR

Intro

Each team has their own tolerance for what is and is not a reason to reject a PR. This may be rooted in process, fairness, and expediency, and may be a company or team decision. Below is a list of reasons you might want to reject a PR. As a team, you can move through the checklist and decide your own reasons for rejecting a PR. Remember too, that there are multiple ways to handle PRs and your team may be more comfortable with comments and conversations than rejections. It’s up to each team’s individual style

User-facing reasons for rejection

  • Breaks the app
  • Fails to compile
  • Introduces a bug
  • Is likely to introduce a bug in the future
// String literal example
type Easing = "ease-in" | "ease-out";
@hazmatzo
hazmatzo / attaching_a_file_from_url.rb
Created June 26, 2018 16:56
This is how to attach a file from a URL in Active Storage.
filename = "resume.pdf"
uri = URI.parse(“https://someresume.com/resume.pdf”)
candidate.resume.attach(io: uri.open, filename: filename)
@hazmatzo
hazmatzo / credentials.rb
Created June 26, 2018 16:39
Shows the standard way to display credentials in Rails
access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
@hazmatzo
hazmatzo / function-binding.js
Created April 1, 2016 17:59
Function Binding
function() { }.bind(this)
@hazmatzo
hazmatzo / arrow-mapping-example.js
Created April 1, 2016 17:58
Arrow Mapping Example
var someArray = [1, 2, 3, 4]
someArray.map( num => num + 1);
@hazmatzo
hazmatzo / implicit-return-example.js
Created April 1, 2016 17:57
Implicit Return Example
(param1, param2) => expression
// equivalent to: { return expression; }
@hazmatzo
hazmatzo / people-function-in-es6.js
Created April 1, 2016 17:56
People Function in ES6
function People() {
this.size = 0;
setInterval(() => {
this.size++;
}, 1000);
}
@hazmatzo
hazmatzo / people-function-in-es5.js
Created April 1, 2016 17:55
People Function in ES5
function People() {
var self = this; // Some choose `that` instead of `self`.
self.size = 0;
setInterval(function addMorePeople() {
// The callback refers to the `self` variable of which
// the value is the expected object.
self.size++;
}, 1000);
}