Skip to content

Instantly share code, notes, and snippets.

View rasim's full-sized avatar

Rasim ÖZDİNÇ rasim

  • KLE Tech
  • Istanbul / Turkey
View GitHub Profile
@akoivist
akoivist / settime.py
Created September 1, 2024 13:15
Python app to set the time of a ATC/PVVX BLE thermometers
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"
@tanthammar
tanthammar / LivewireSortable.php
Last active August 9, 2022 20:52
Livewire Sortable fix with array form
<?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
{
@tonysm
tonysm / concurrent-pool.php
Last active November 1, 2023 13:08
Concurrent Requests
<?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)
#
@opheliadesign
opheliadesign / l4-domain.php
Created November 2, 2015 22:25
Laravel 4 SaaS domain setter
// 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');
}
@matula
matula / awesm.md
Last active February 19, 2024 16:23
Awesome PHP stuff in one Gist
@vluzrmos
vluzrmos / App_Http_VideoStream.php
Last active October 22, 2024 21:47
Laravel VideoStream.
<?php
namespace App\Http;
/**
* Description of VideoStream
*
* @author Rana
* @link https://gist.github.com/vluzrmos/d5682ad426525196d069
*/
@soufianeEL
soufianeEL / laravel.js
Last active June 18, 2023 05:25 — forked from JeffreyWay/laravel.js
You use Laravel 5 and you want to send a DELETE request without creating a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. To use, import script, and create a link with the `data-method="DELETE"` and `data-token="{{csrf_token()}}"` attributes.
/*
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() {
@rap2hpoutre
rap2hpoutre / laravel-forge-deploy.sh
Last active March 28, 2024 15:45
Laravel Forge deploy script without downtime
# 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
@mattzuba
mattzuba / beanstalkd.config
Created January 5, 2015 17:56
beanstalkd.config
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