PHP | Laravel | Web Scraping
A curated list of amazingly awesome PHP libraries, resources and shiny things.
import asyncio | |
import time | |
import datetime | |
import pytz # Ensure you have pytz installed | |
from bleak import BleakScanner, BleakClient # Ensure you have bleak installed | |
from bleak.exc import BleakError | |
# Define the MAC address and characteristic UUID | |
DEVICE_ADDRESS = "xx:xx:xx:xx:xx:xx" | |
CHARACTERISTIC_UUID = "00001f1f-0000-1000-8000-00805f9b34fb" |
<?php | |
namespace App\Http\Livewire\App\Organizers\Forms; | |
use App\Http\Livewire\Traits\Form; | |
use App\Models\Organizer; | |
use Livewire\Component; | |
class People extends Component | |
{ |
<?php | |
// 1. Register the routes | |
Route::get('test/{lorem}', function ($lorem) { | |
sleep(3); | |
return response()->json([ | |
'message' => $lorem, | |
'token' => Str::random(), | |
]); |
# | |
# REQUIRES: | |
# - server (the forge server instance) | |
# - site_name (the name of the site folder) | |
# - sudo_password (random password for sudo) | |
# - db_password (random password for database user) | |
# - event_id (the provisioning event name) | |
# - callback (the callback URL) | |
# |
// Routes | |
Route::group(array('domain' => '{account}.primarydomain.com', 'before' => 'getSubdomain'), function() | |
{ | |
Route::get('/', function() | |
{ | |
if (Auth::guest()) { | |
return Redirect::guest('login'); | |
} else { | |
return Redirect::to('secure/dashboard'); | |
} |
PHP | Laravel | Web Scraping
A curated list of amazingly awesome PHP libraries, resources and shiny things.
<?php | |
namespace App\Http; | |
/** | |
* Description of VideoStream | |
* | |
* @author Rana | |
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069 | |
*/ |
/* | |
Exemples : | |
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}"> | |
- Or, request confirmation in the process - | |
<a href="posts/2" data-method="delete" data-token="{{csrf_token()}}" data-confirm="Are you sure?"> | |
*/ | |
(function() { | |
# stop script on error signal | |
set -e | |
# remove old deployment folders | |
if [ -d "/home/forge/deploy" ]; then | |
rm -R /home/forge/deploy | |
fi | |
if [ -d "/home/forge/backup" ]; then | |
rm -R /home/forge/backup | |
fi |
sources: | |
/tmp: https://github.com/kr/beanstalkd/archive/v1.10.tar.gz | |
commands: | |
01_make_beanstalkd: | |
cwd: /tmp/beanstalkd-1.10 | |
command: make | |
02_install_beanstalkd: | |
cwd: /tmp/beanstalkd-1.10 |