Restore a deleted file in Git

# Find in which commit it's been deleted
$ git rev-list -n 1 HEAD -- 
4058ef780d2f6c4c6d57cfd7fd4ebe14c9dc28b3
# Restore it back
$ git checkout 4058ef780d2f6c4c6d57cfd7fd4ebe14c9dc28b3^ -- 


Ali

Cleanup stale formulas on brew

Use brew cleanup to get some spaces back!

Use brew cleanup -n to list what's gonna get cleanup

Use brew cleanup to clean only that particular formula

<3

Tino

make a pr from command line using hub

install hub first with brew: brew install hub then use a simple command, like at the example below: hub pull-request -m "best pr ever" -b oozou:develop -h feature/awesome-improvements

or even smarter:

hub pull-request -m "best pr ever" -b oozou:develop -h $(git rev-parse --abbrev-ref HEAD)


for more detailed info how to make pull requests see at hub pull-request --help

Stan

Shallow clone a old repo

If you don't need the full git history for a repo you will be working on you can supply a clone depth to only clone x revisions of the repo.

git clone --depth=1 https://github.com/my/repo.git

Joe

Use minItems/maxItems in collection JSON schemas

To make your collection JSON schemas more reilable use minItems and maxItems so that you can trust your API.

{
  "type": "array",
  "minItems": 1,
  "items": {
    "$ref": "subscription_notification.json"
  }
}


instead of

{
  "type": "array",
  "items": {
    "$ref": "subscription_notification.json"
  }
}


If your API returns [] empty array that last one would pass if you make an assertion in your specs.

expect(response).to match_response_schema(:subscription_notifications)


But not the first one

The property '#/' did not contain a minimum number of items 1 in schema


https://json-schema.org/understanding-json-schema/reference/array.html

Ali