Skip to content

Instantly share code, notes, and snippets.

@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
@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 / 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 / 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 / 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

<template>
<div
class="virtual-scroll"
ref="root"
:style="rootStyle"
@scroll="onScroll">
<div
class="virtual-scroll__viewport"
:style="viewportStyle">
<div
@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;
@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
*/
<?php
namespace Sensio\Bridge\Phpmig;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* The ContainerAdapter allows the Symfony DIC to be used with phpmig. Phpmig is the tool that's used for executing
* migrations on the application and expects a service container that implements \ArrayAccess. This is achieved by
* wrapping Symfony's DIC with an adapter that implements \ArrayAccess and proxies to the DIC.
@mcmatrix
mcmatrix / sendmail.bat
Created December 1, 2022 22:42 — forked from tomasfejfar/sendmail.bat
Windows fake sendmail to save mail to file
@echo off
::where do we store the messages
SET mailpath=c:\xampp\tmp\mail\
if not exist %mailpath% mkdir %mailpath%
::create filename
echo %date:~0,11%
SET filename=%date:~11,4%-%date:~7,2%-%date:~3,2%_%hours%-%time:~3,2%-%time:~6,2%_%time:~9,2%