Skip to content

Instantly share code, notes, and snippets.

@mcmatrix
mcmatrix / Container.php
Created January 24, 2023 08:36 — forked from MustafaMagdi/Container.php
PHP Dependency Injection Container
<?php
/**
* Class Container
*/
class Container
{
/**
* @var array
*/
@mcmatrix
mcmatrix / bootstrap-infiniteScroll.js
Created June 17, 2023 18:28 — forked from andrewburgess/bootstrap-infiniteScroll.js
Twitter Bootstrap plugin that enables infinite scrolling
/* ============================================
* bootstrap-infiniteScroll.js
* ============================================ */
!function ($) {
'use strict';
var InfiniteScroll = function (el, options) {
this.$element = $(el);
this.$data = $(el).data();
this.$options = options;
<template>
<div
class="virtual-scroll"
ref="root"
:style="rootStyle"
@scroll="onScroll">
<div
class="virtual-scroll__viewport"
:style="viewportStyle">
<div
@mcmatrix
mcmatrix / README.md
Created April 18, 2024 13:57 — forked from maruel/README.md
Steps to connect your spools' remaining filament in the AMS to a Google Sheet

AMS to GSheet

Prerequisites

  • Bambulab printer
  • Home Assistant with experience how to use it.
  • Google account (i.e. Gmail)

Steps

@mcmatrix
mcmatrix / admin.py
Created July 23, 2024 13:20 — forked from uhop/admin.py
Adding Dojo's rich editor to Django's Admin.
# Example how to add rich editor capabilities to your models in admin.
from django.contrib.admin import site, ModelAdmin
import models
# we define our resources to add to admin pages
class CommonMedia:
js = (
'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js',
@mcmatrix
mcmatrix / admin.py
Created July 23, 2024 13:20 — forked from tomgruner/admin.py
Adding Dojo's rich editor with minimal plugins to Django's Admin that shows the editor on click and hides on blur
# Example how to add rich editor capabilities to your models in admin.
from django.contrib.admin import site, ModelAdmin
import models
# we define our resources to add to admin pages
class CommonMedia:
js = (
'https://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js',
@mcmatrix
mcmatrix / README.md
Created October 7, 2024 07:52 — forked from mohitmamoria/README.md
Inertia.js Form Helper for Axios/API calls

Inertia.js ships with a fantastic form helper but it falls short when also using API/Axios calls in your project.

Here's a composable, built on top of the Inertia's form helper that hooks into it to replace the API calls with Axios.

To use, just replace useForm with useAPIForm.

const form = useAPIForm({
    title: '',
});
@mcmatrix
mcmatrix / README.md
Created February 22, 2025 21:57 — forked from Manzadey/README.md
Deploy bash script for laravel project

Deploy bash script for laravel project

  1. Add deploy.sh and releases_clear.php to project folder
  2. Set variables in deploy.sh: repo, branch, path_user, path_composer, path_main
  3. Set variables in releases_clear.php: $path_releases
  4. Run bash script in folder project for deploy: bash deploy.sh
  5. Run php script for clear releases folders: php releases_clear.php