Skip to content

Instantly share code, notes, and snippets.

View fontenele's full-sized avatar

Guilherme Fontenele fontenele

View GitHub Profile
@Splode
Splode / Laravel-Scheduler-Windows.md
Last active November 18, 2024 13:12
Laravel Scheduler on Windows

Run Laravel Scheduled Tasks on Windows

The following are instructions for running scheduled tasks defined in a Laravel project on Windows. The Laravel documentation provides instructions for running scheduled tasks using cron jobs on Linux systems. However, cron jobs are not available on Windows. The built-in Windows Task Scheduler can be used to run scheduled tasks instead.

Create a Scheduled Task

  1. Open Task Scheduler
  2. Select Create Task...
  3. Give the task a name and description
  4. To run the task in the background, select Run whether the user is logged on or not and check the Hidden checkbox.
@walkeralencar
walkeralencar / Envoy.blade.php
Last active September 6, 2018 00:49 — forked from boris-glumpler/Envoy.blade.php
Envoy.blade.php
{{-- Define all our servers --}}
@servers(['staging' => '', 'production' => ''])
@setup
{{-- The timezone your servers run in --}}
$timezone = 'Europe/Amsterdam';
{{-- The base path where your deployments are sitting --}}
$path = '/var/www/site.com/htdocs';
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;
@mcaskill
mcaskill / Function.Array-Group-By.php
Last active January 3, 2024 10:15
PHP : Groups an array by a given key
<?php
if (!function_exists('array_group_by')) {
/**
* Groups an array by a given key.
*
* Groups an array into arrays by a given key, or set of keys, shared between all array members.
*
* Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function.
* This variant allows $key to be closures.
@nostah
nostah / gist:d610459d50564c729c56
Created April 13, 2015 07:42
php swagger 2.0 api sample
<?php
use Swagger\Annotations as SWG;
/**
* @SWG\Swagger(
* basePath="/v1",
* host="api.local",
* schemes={"http"},
* produces={"application/json"},
@dnozay
dnozay / README.md
Last active July 4, 2024 15:06
Collection of useful stuff for interacting with gitlab.

Reset root/admin password

Lost the root/admin password? You can reset it using the command-line. Recipe adapted from gitlab issue #308.

# start the console
sudo gitlab-rails console
@ricardozea
ricardozea / ie67891011-css-hacks.txt
Last active February 2, 2023 15:17
IE CSS hacks - IE6, 7, 8, 9, 10, 11
IE6 Only
==================
_selector {...}
IE6 & IE7
==================
*html or { _property: }
IE7 Only
==================
@ijmorgado
ijmorgado / create_thumbnail_function.php
Last active February 12, 2019 01:49
This is a function to create thumbnail image(png, jpeg, jpg or gif) with specific height...is useful when we need to make tables with the same height for each row with image previews...if you really need the same width and whatever height, just change the order of params in the aspect ratio operations (lines 17 and 18)...
public function createThumbnail($source_folder, $thumbs_folder, $source_file, $extension, $thumbHeight){
if ($extension == 'gif') {
$imgt = "ImageGIF";
$imgcreatefrom = "ImageCreateFromGIF";
}else if($extension == 'jpg' || $extension == 'jpeg'){
$imgt = "ImageJPEG";
$imgcreatefrom = "ImageCreateFromJPEG";
}else if ($extension == 'png') {
$imgt = "ImagePNG";
$imgcreatefrom = "ImageCreateFromPNG";