Skip to content

Instantly share code, notes, and snippets.

View alixcan's full-sized avatar
💭
I may be slow to respond.

Alican alixcan

💭
I may be slow to respond.
View GitHub Profile
@alixcan
alixcan / Laravel-Scheduler-Windows.md
Created June 12, 2020 13:56 — forked from Splode/Laravel-Scheduler-Windows.md
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.
@alixcan
alixcan / .env
Created May 30, 2020 22:24
Laravel BackBlaze Adapter
BB_KEY=
BB_SECRET=""
BB_REGION=
BB_BUCKET=
BB_ENDPOINT=
@alixcan
alixcan / AppServiceProvider.php
Created October 29, 2019 07:03 — 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()

Laravel-websockets, SSL Certificate, Let's Encrypt, Certbot, Supervisor, Digitalocean Ubuntu

I did two days work to run laravel-websockets on my server. It will be nice to share with you.

Steps

Step1 - Laravel Websockets Installation with composer

Laravel WebSockets can be installed via composer:

@alixcan
alixcan / custom.js
Created April 18, 2019 10:48
jQuery Get every form element's value
$(()=>{
$('input[type=submit]').on('click', e =>{
e.preventDefault();
$.each($('#SomeForm')[0].elements, function(index, elem){
var e = $(elem).val();
console.log(e);
});
@alixcan
alixcan / gist:24dbf99c3d8d6e0d1f9c4011f920be7b
Created February 24, 2019 14:32 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@alixcan
alixcan / git-aliases
Created November 12, 2018 12:24 — forked from lukalopusina/git-aliases
GIT Aliases
# GIT
# --------------------------------------------
alias ga="git add"
alias gaa="git add ."
alias gc="git commit -m "
alias gp="git push github"
alias gs="git status"
alias nah="git reset --hard; git clean -df;"
# --------------------------------------------
@alixcan
alixcan / .nginx
Created September 25, 2018 13:10
Laravel nginx GoPanel Settings
location / {
try_files $uri $uri/ /index.php?$query_string;
}
@alixcan
alixcan / index.php
Created September 6, 2018 11:00 — forked from xDimGG/index.php
Populated Discord WebHook
<?php
$url = 'https://discordapp.com/api/webhooks/402545221445091348/Cu8aLPPtgGMTyINj-DOjy91NCdnDMKczdFmsJmO2u4I6l7fzyNV_YYtezwwU7QF4CkrD';
$image = 'https://via.placeholder.com/400x400';
$data = json_encode([
// These 2 should usually be left out
// as it will overwrite whatever your
// users have set
// 'username' => 'Test WebHook',
// 'avatar_url' => $image,
@alixcan
alixcan / LogAfterRequest.php
Created September 6, 2018 10:50 — forked from Shelob9/LogAfterRequest.php
Log all request to Laravel app. Based on http://blog.phakeapps.com/2015/06/23/log-every-request-and-response-in-laravel-5/ updated for Laravel 5.3
namespace App\Http\Middleware;
use Illuminate\Support\Facades\Log;
class LogAfterRequest {
public function handle($request, \Closure $next)
{
return $next($request);
}