Skip to content

Instantly share code, notes, and snippets.

@ratzo
ratzo / Laravel-Container.md
Created August 20, 2020 22:53
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@ratzo
ratzo / codepipeline.yaml
Created August 7, 2020 20:56
Cloudformation template to create a CodePipeline and register a webhook on Github
AWSTemplateFormatVersion: '2010-09-09'
Description: 'CI/CD Pipeline'
Parameters:
ArtifactsBucket:
Type: String
GithubOwner:
Type: String
GithubRepository:
Type: String
@ratzo
ratzo / dist-upgrade.yml
Last active May 7, 2020 05:51
Ansible playbook to upgrade packages on Ubuntu/Debian distributions and reboot the server if needed
---
- hosts: all
become: true
tasks:
- name: Update apt repo and cache
apt:
update_cache: yes
force_apt_get: yes
cache_valid_time: 3600
- name: Upgrade all packages
@ratzo
ratzo / LetsEncrypt_HTTPS_plex.MD
Created June 30, 2019 22:58 — forked from churro-s/LetsEncrypt_HTTPS_plex.MD
Setup Let's Encrypt certificate for use with Plex Media Server on Ubuntu
@ratzo
ratzo / makeapp.sh
Created August 23, 2018 05:46
Create application shortcuts in Google Chrome on a Mac. Thanks to Less Annoying CRM (https://www2.lessannoyingcrm.com/blog/2010/08/149/Create+application+shortcuts+in+Google+Chrome+on+a+Mac)
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name=$inputline
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url=$inputline
@ratzo
ratzo / botcoin.js
Created March 2, 2017 18:54
A bot to buy low and sell high bitcoins through Coinbase
/**
* Based on the code from Martijn Frazer
* http://pastebin.com/eZ25L9yw
*/
var fs = require('fs');
var Client = require('coinbase').Client;
var client = new Client({
'apiKey': '',
'apiSecret': ''

Keybase proof

I hereby claim:

  • I am ratzo on github.
  • I am ratzo (https://keybase.io/ratzo) on keybase.
  • I have a public key whose fingerprint is AA3A 14F3 B7B0 B423 FE38 21CA 229B B318 2114 0A7E

To claim this, I am signing this object: