Skip to content

Instantly share code, notes, and snippets.

View MECU's full-sized avatar

Michael Hoppes MECU

View GitHub Profile
/Users/mecu/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/steep-1.3.0/lib/steep/server/base_worker.rb:90:in `join': No live threads left. Deadlock? (fatal)
2 threads, 2 sleeps current:0x00007f9e697043f0 main thread:0x00007f9e697043f0
* #<Thread:0x000000010b4fccf0 sleep_forever>
rb_thread_t:0x00007f9e697043f0 native:0x00000002031752c0 int:0
* #<Thread:0x00000001108f9218 /Users/mecu/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/steep-1.3.0/lib/steep/server/base_worker.rb:42 sleep_forever>
rb_thread_t:0x00007f9df976a6b0 native:0x000000030b13b000 int:0
depended by: tb_thread_id:0x00007f9e697043f0
from /Users/mecu/.rbenv/versions/3.1.3/lib/ruby/gems/3.1.0/gems/steep-1.3.0/lib/steep/server/base_worker.rb:90:in `ensure in block in run'
@MECU
MECU / Vagrantfile
Created July 23, 2019 02:44
ruby dev
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
config.vm.network "forwarded_port", guest: 3000, host: 3000
config.vm.network "forwarded_port", guest: 33060, host: 3306
config.vm.network "forwarded_port", guest: 54320, host: 5432
config.vm.synced_folder "E:\\code\\rubyground", "/code"
config.vm.provider "virtualbox" do |vb|
vb.memory = "4096"
end
end
@MECU
MECU / implode.php
Created December 28, 2018 18:16
PHP implode improvement
<?php
// Propose:
// Add a "$wrap" or "$prefix" and "$suffix" parameters to the implode() function.
// https://secure.php.net/manual/en/function.implode.php
// So something like this:
$array = ['a', 'b', 'c'];
$output1 = '"' . implode(',', $array) . '"';
@MECU
MECU / gist:556b2351d347113774a5097a20930f35
Created April 7, 2017 19:40
Laravel Pivot multiple updated
$lane = $race->teams()->wherePivot('lane', $row[2])->find($team->id);
// See status before saving input results
Log::debug($lane->pivot);
// Update the place and result (time)
$lane->pivot->place = $row[0];
$lane->pivot->result = $row[6];
// Output changes
@MECU
MECU / example.txt
Last active May 19, 2016 09:21
OneToMultipleMany DB Schema
(Simplified schema)
CREATE TABLE season
(
id INT(10) UNSIGNED PRIMARY KEY NOT NULL AUTO_INCREMENT,
year YEAR(4) NOT NULL,
teamid SMALLINT(5) UNSIGNED NOT NULL,
levelid TINYINT(3) UNSIGNED,
divid MEDIUMINT(9),
district TINYINT(4),
);