Skip to content

Instantly share code, notes, and snippets.

View arisawali2014's full-sized avatar
💢
Depressed

Muhamad Ari Sawali arisawali2014

💢
Depressed
View GitHub Profile
@arisawali2014
arisawali2014 / RunScheduler.php
Created September 23, 2021 02:14 — forked from robbydooo/RunScheduler.php
Heroku Laravel Scheduler
<?php
/**
This Scheduler will run once every minute unlike the Heroku scheduler which only runs every 10 mintues.
To use this scheduler with Laravel 5.4+ add this file to /app/Console/Commands/RunScheduler.php
Register this file in app/Console/Kernel.php
@arisawali2014
arisawali2014 / telegraph.php
Last active February 25, 2024 07:00
Upload Image to Telegraph with Curl
<?php
public function uploadMedia($file)
{
$target_url = "https://telegra.ph/upload";
$file_name_with_full_path = $file;
if (function_exists('curl_file_create')) { // php 5.5+
$cFile = curl_file_create($file_name_with_full_path);
} else { //
$cFile = '@' . realpath($file_name_with_full_path);