Skip to content

Instantly share code, notes, and snippets.

View yakubenko's full-sized avatar
👽
Eat. Sleep. Code.

Stanislav Yakubenko yakubenko

👽
Eat. Sleep. Code.
View GitHub Profile
@yakubenko
yakubenko / Laravel-Container.md
Created August 18, 2021 09:31
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).

@yakubenko
yakubenko / geonames_postgres.rb
Created June 9, 2018 17:25 — forked from kaspergrubbe/geonames_postgres.rb
Import files from Geonames.com into a PostgreSQL database that runs Postgis
#!/usr/bin/env ruby
require 'open3'
require 'fileutils'
def run_command(command)
puts("+: " + command)
Open3.popen2e(command) do |stdin, stdout_stderr, wait_thread|
Thread.new do
stdout_stderr.each {|l| puts l }