Skip to content

Instantly share code, notes, and snippets.

@Gimcrack
Gimcrack / bootstrap.js
Created December 9, 2020 20:26
Set up laravel-echo in bootstrap.js
/**
* Echo exposes an expressive API for subscribing to channels and listening
* for events that are broadcast by Laravel. Echo and event broadcasting
* allows your team to easily build robust real-time web applications.
*/
import Echo from "laravel-echo"
window.Echo = new Echo({
broadcaster: 'socket.io',
@Gimcrack
Gimcrack / RecipeSeeder.php
Created January 29, 2022 00:45
Recipe Seeder
<?php
class RecipeSeeder extends Seeder
{
protected $recipes = [
// alts done
// no byproducts
"Smelter" => [
"Iron Ingot" => [
"base_yield" => 1,
@Gimcrack
Gimcrack / RecipeQA.md
Created February 11, 2022 07:13
Recipe QA

ALUMINUM_SCRAP has different rate for output C__ALUMINUM_SCRAP (300.0 vs 360.0) -- 360 is correct

BLACK_POWDER_ALT_FINE_BLACK_POWDER has different rate for output C__COMPACTED_COAL (3.75 vs 3.8) -- 3.75 is correct

COMPUTER_ALT_CATERIUM_COMPUTER has different rate for output C__CIRCUIT_BOARD (26.25 vs 26.3)

@Gimcrack
Gimcrack / Win11ClassicContextMenu.reg
Created April 24, 2023 17:13
Windows 11 Classic Context Menu
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32]
@=""
@Gimcrack
Gimcrack / main.php
Created July 25, 2023 16:58
Get Products O(n)
<?php
$input = [-1,1,0,-3,3];
function getProducts(array $input) {
// initialize output array with 1s
$output = array_map(fn($el) => 1, $input);
$length = count($input);
// multiply each element by the elements before it
$temp=1;
@Gimcrack
Gimcrack / .bash_aliases
Created August 29, 2023 07:40
Composer on windows, ignore laravel horizon missing extensions
alias cmp="composer --ignore-platform-req=ext-posix --ignore-platform-req=ext-pcntl"