Skip to content

Instantly share code, notes, and snippets.

@ssheduardo
ssheduardo / ScheduleList.php
Created December 16, 2021 22:53 — forked from nvahalik/ScheduleList.php
PHP Artisan command that lists all scheduled tasks: php artisan schedule:list (Credit: https://stackoverflow.com/a/35559970/2714126)
<?php
namespace App\Console\Commands;
use Carbon\Carbon;
use Cron\CronExpression;
use Illuminate\Console\Command;
use Illuminate\Console\Scheduling\CallbackEvent;
use Illuminate\Console\Scheduling\Schedule;
@ssheduardo
ssheduardo / gist:55cbb13154a39f7853ea03a42c7d488f
Last active October 24, 2021 15:09
Localtunnel + laravel + docker + hostname
lt --port 80 --local-host "demo.local" --subdomain anything
#demo.local is configurated in your hosts
#127.0.0.1 -> demo.local
#subdomain -> this subdomain will create in localtunnel
#Localtunnel return: https://anything.loca.lt for example.
@ssheduardo
ssheduardo / openssl_encrypt_decrypt.php
Created November 26, 2019 12:55 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@ssheduardo
ssheduardo / openssl_encrypt_decrypt.php
Created November 26, 2019 12:55 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
@ssheduardo
ssheduardo / .gitlab-ci.yml
Last active November 30, 2019 20:21
Deploy react to server with gitlab
build site:
image: node:12.13.0-slim
stage: build
before_script:
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
- yarn install --pure-lockfile --cache-folder .yarn
cache:
paths:
- node_modules/
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
@ssheduardo
ssheduardo / config.yml
Created November 12, 2018 15:13
Circleci - laravel
version: 2 # use CircleCI 2.0
jobs:
build:
branches:
only:
- master
- develop
docker:
- image: circleci/php:7.1-node-browsers
server {
listen 80;
server_name proyecto.dev;
root /home/xxx/public_html/proyecto.dev/public;
index index.php index.html index.htm;
11,1 All
server {
listen 80;
listen 443 ssl http2;
server_name web.dev;
root "/home/vagrant/code/web.dev/public";
index index.html index.htm index.php;
charset utf-8;
<?php
namespace App\DataTables;
use App\User;
use Yajra\Datatables\Services\DataTable;
class UsersDataTable extends DataTable
{
/**