Skip to content

Instantly share code, notes, and snippets.

View martio's full-sized avatar

Marcin Lewandowski martio

View GitHub Profile
@martio
martio / SetLocale.php
Created December 30, 2020 20:30
Detect language and set locale in Laravel using middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class SetLocale
{
/**
#!/usr/bin/env ruby
require 'yaml'
if ARGV.size < 1
puts "Usage: github-test.rb my-project.gemspec"
exit
end
require 'rubygems/specification'
data = File.read(ARGV[0])