I hereby claim:
- I am mmacia on github.
- I am mmacia (https://keybase.io/mmacia) on keybase.
- I have a public key ASBLfiU7oxcAil_oR-5N7787Ho_guNkB56-24ZwCXP6Tawo
To claim this, I am signing this object:
| #!/bin/env sh | |
| echo -e "\n\nInstalling common packages ...\n\n" | |
| sudo yum check-update && sudo yum update -y | |
| sudo yum install -y htop jq sqlite-devel openssl-devel zsh git | |
| sudo yum groupinstall -y "Development Tools" | |
| sudo amazon-linux-extras install postgresql14 | |
| sudo yum install postgresql-devel -y |
I hereby claim:
To claim this, I am signing this object:
| # get the merchant name of a product in a shopping cart | |
| @cart.items.first.purchasable.user.merchant.first_name | |
| # => NoMethodError (undefined method for nil:NilClass) | |
| @cart.items.first.purchasable.user.merchant.first_name | |
| # ^ | |
| # \------ This item not exists (disposed, destroyed, ...) | |
| # But any method in the chain could also be nil! |
| <?php | |
| /** | |
| * This snippet shows a PHP neat trick: build a file into memory without use the filesystem. | |
| */ | |
| $fp = fopen('php://memory', 'rw'); // open an in-memory handler | |
| for ($i = 0; $i < 100; ++$i) { // write some data to handler | |
| fwrite($fp, $i."\n"); |
| <?php | |
| /** | |
| * this class shows how to override default PHP handler to catch undefined index errors | |
| * and throw it as native exceptions, much more convenient way to work with object | |
| * oriented programs. | |
| * | |
| * @author Moisés Maciá <[email protected]> | |
| * @see http://codeup.net | |
| */ |