Skip to content

Instantly share code, notes, and snippets.

View raymadrona's full-sized avatar

Ray Anthony Madrona raymadrona

View GitHub Profile
@raymadrona
raymadrona / SignatureExample.php
Created February 2, 2022 08:02 — forked from jonneroelofs/SignatureExample.php
Wrapping SignaturePad and storing base-64 with Alpine.js and Laravel Livewire
<?php
namespace App\Http\Livewire;
use Illuminate\Support\Str;
use Livewire\Component;
class SignatureExample extends Component
{
public $signature;
@raymadrona
raymadrona / git-cleanup-repo
Created January 15, 2021 00:36 — forked from robmiller/git-cleanup-repo
A script for cleaning up Git repositories; it deletes branches that are fully merged into `origin/master`, prunes obsolete remote tracking branches, and as an added bonus will replicate these changes on the remote.
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <rob@bigfish.co.uk>
# Adapted from the original by Yorick Sijsling
git checkout master &> /dev/null
# Make sure we're working with the most up-to-date version of master.
git fetch
@raymadrona
raymadrona / gist:76daa8f4c33ff8b6517e49d7b0ab6c0c
Created December 4, 2020 08:55 — forked from somandubey/gist:52bff8c7cc8639292629
How to increase ulimit in Linux

How to increase ulimit in Linux:

  • Step 1 (ulimit): open the sysctl.conf and add this line fs.file-max = 65536

      vi /etc/sysctl.conf   
    

    add following at end of file in above file:

      fs.file-max = 65536
    

save and exit.

@raymadrona
raymadrona / cmder.md
Last active April 17, 2020 14:36 — forked from nickautomatic/cmder.md
Setting up Cmder to use bash by default

Set up cmder to use msysgit / bash by default

  • Install cmder_mini (msysgit is already installed, so no need for full version)
  • In Cmder, open settings: Win + Alt + P
  • Under Startup > Tasks, add a task called {bash} with the following settings:
    • Task parameters (set icon):
      • For Cmder icon: /icon "%CMDER_ROOT%\cmder.exe"
      • For Git icon: /icon "C:\Program Files\Git\mingw64\share\git\git.ico"
    • Commands (open Git's bash shell):
  • "C:\Program Files\Git\bin\sh.exe" -l -new_console:d:%USERPROFILE%
@raymadrona
raymadrona / forge.sh
Created May 4, 2018 00:15
Laravel Forge Setup Script
#
# REQUIRES:
# - server (the forge server instance)
# - event (the forge event instance)
# - sudo_password (random password for sudo)
# - db_password (random password for database user)
# - callback (the callback URL)
#
@raymadrona
raymadrona / no-bom.ps1
Created May 2, 2018 06:32 — forked from arebee/no-bom.ps1
PowerShell script to save as UTF-8 without a BOM
gci . -recurse -filter *.ps* | % {
$MyFile = gc $_.Fullname -raw
$MyPath = $_.Fullname
[System.IO.File]::WriteAllLines($MyPath, $MyFile, [System.Text.UTF8Encoding]($False))
}
@raymadrona
raymadrona / 1_phpunit-api.md
Created November 20, 2017 12:20 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@raymadrona
raymadrona / imagick-3.4.0-PHP7-forge.sh
Created February 1, 2017 07:29 — forked from pascalbaljet/imagick-3.4.0-PHP7-forge.sh
Install Imagick 3.4.0 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz
@raymadrona
raymadrona / socket-cheatsheet.js
Created January 20, 2017 12:55 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@raymadrona
raymadrona / a.md
Created December 15, 2016 07:58 — forked from danharper/a.md
Laravel Queue Supervisor

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.