warning: ignoring broken ref refs/remotes/origin/HEAD
➜ ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜ ✗ g fetch --prune
➜ ✗ g gc
warning: ignoring broken ref refs/remotes/origin/HEAD
➜ ✗ g symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/develop
➜ ✗ g fetch --prune
➜ ✗ g gc
Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.
This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would
Ansible playbook to setup HTTPS using Let's encrypt on nginx. | |
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS. | |
The server pass A rating on [SSL Labs](https://www.ssllabs.com/). | |
To use: | |
1. Install [Ansible](https://www.ansible.com/) | |
2. Setup an Ubuntu 16.04 server accessible over ssh | |
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain | |
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder) |
By the way, I'm available for tutoring and code review :)
new Promise
?.then
callback yet?](https://gist.github.com/joepie91/4c3a10629a4263a522e3bc4839a28c83#6-but1 - Download the RDS certificates (root plus region-specific intermediate ones) bundle:
wget -O config/rds-combined-ca-bundle.pem https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem
2 - Add config/rds-combined-ca-bundle.pem
to the repository and redeploy to Heroku.
3 - Update the DATABASE_URL
env var:
# ATTENTION: This is now supported in plug_cowboy as of 2.1.0: | |
# https://hexdocs.pm/plug_cowboy/Plug.Cowboy.Drainer.html | |
defmodule DrainStop do | |
@moduledoc """ | |
DrainStop Attempts to gracefully shutdown an endpoint when a normal shutdown | |
occurs. It first shuts down the acceptor, ensuring that no new requests can be | |
made. It then waits for all pending requests to complete. If the timeout | |
expires before this happens, it stops waiting, allowing the supervision tree | |
to continue its shutdown order. |
# Monkey Patch Knapsack to merge reports instead of overwrite | |
begin | |
class Knapsack::Report | |
alias_method :save_without_leading_existing_report, :save | |
def save | |
Knapsack::Presenter.existing_report = open | |
save_without_leading_existing_report | |
end | |
end |
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174): | |
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it. | |
Using git config core.autocrlf true can help, but not on a multi-developpers project. | |
This command has to be the same on each developper machine, and that's not always the case. | |
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root) | |
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened) |
-- An alternative GildedRose using an immutable approach. | |
-- Context on the GildedRose: | |
-- * http://blog.lunarlogic.io/2015/what-ive-learned-by-doing-the-gilded-rose-kata-4-refactoring-tips/ | |
-- * my comment in the linked blog post | |
-- One could take this GildedTulip approach and encapsulate a similar "immutable API" | |
-- to re-create the "mutable API" of the GildedRose. | |
-- | |
-- This example is written in Haskell. This example uses three notable features (available in other languages): | |
-- - pattern matching: a way to hide a lot of "if" |