Skip to content

Instantly share code, notes, and snippets.

View ssistemas's full-sized avatar

Santiago L.M ssistemas

View GitHub Profile
@ssistemas
ssistemas / DatabaseQueueMonitorCommand.php
Created March 7, 2025 13:24 — forked from BenCavens/DatabaseQueueMonitorCommand.php
Laravel queue monitoring on shared hosting
<?php
namespace App\Queue;
use Carbon\Carbon;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
class DatabaseQueueMonitorCommand extends Command
{
@ssistemas
ssistemas / AppServiceProvider.php
Created October 20, 2021 02:39 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@ssistemas
ssistemas / paginate.php
Created October 20, 2021 01:05 — forked from ctf0/paginate.php
Laravel Paginate Collection or Array
<?php
// use Illuminate\Support\Collection;
// use Illuminate\Pagination\Paginator;
// use Illuminate\Pagination\LengthAwarePaginator;
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
@ssistemas
ssistemas / generate all combinations.php
Created September 12, 2021 12:59 — forked from ehsanhoushmand/generate all combinations.php
php algorithm to generate all combinations of a specific size from a single set
function sampling($chars, $size, $combinations = array()) {
# if it's the first iteration, the first set
# of combinations is the same as the set of characters
if (empty($combinations)) {
$combinations = $chars;
}
# we're done if we're at size 1
if ($size == 1) {
// Include javascript file in chrome console
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'script.js';
document.head.appendChild(script);
@ssistemas
ssistemas / auto_sync_git.sh
Created April 3, 2017 03:12 — forked from gnumoksha/auto_sync_git.sh
Does the git pull of all subdirectories
#!/bin/bash
# This script syncs (i.e. makes git pull) on a specified directory or, se no
# parameter was specified, in all the subdirectories that are git projects.
#
# Usage:
# ./auto_sync_git.sh directory_of_my_project
# ./auto_sync_git.sh
# An alias to the git binary
#Linux
#If your Dropbox folder is not in the default location, you'll need to change ~/Dropbox to your location.
#Close Sublime Text
#Open Terminal
#First Machine
#On your first machine, use the following instructions.
**********************************************************************************************
**********************************************************************************************
************************ * ****** ** ** ****** ************************
************************ * * * * * * * * ************************
************************ * ****** * * * * ****** ************************
************************ * * * * * * * ************************
************************ ****** ****** * * * * ************************
**********************************************************************************************
**********************************************************************************************
@ssistemas
ssistemas / 01_Laravel 5 Simple ACL manager_Readme.md
Created October 2, 2016 13:08 — forked from amochohan/01_Laravel 5 Simple ACL manager_Readme.md
Laravel 5 Simple ACL - Protect routes by an account / role type

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

/*
Mini CNC Plotter firmware, based in TinyCNC https://github.com/MakerBlock/TinyCNC-Sketches
Send GCODE to this Sketch using gctrl.pde https://github.com/damellis/gctrl
Convert SVG to GCODE with MakerBot Unicorn plugin for Inkscape available here https://github.com/martymcguire/inkscape-unicorn
More information about the Mini CNC Plotter here (german, sorry): http://www.makerblog.at/2015/02/projekt-mini-cnc-plotter-aus-alten-cddvd-laufwerken/
*/
#include <Servo.h>
#include <AFMotor.h>