Skip to content

Instantly share code, notes, and snippets.

View sergix44's full-sized avatar
⚗️
Experimenting

Sergio Brighenti sergix44

⚗️
Experimenting
View GitHub Profile
<?php
namespace App\Http\Controllers;
use App\Http\Controllers\Conversations\DummyConvo;
use Mpociot\BotMan\BotMan;
class BotManController extends Controller {
@sergix44
sergix44 / dummy.php
Created July 12, 2017 19:54
Infinite download script
<?php
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="dummy.bin"');
set_time_limit(0);
$random_data = random_bytes(1000000);
while(true) {
if(connection_aborted() === 1) {
@sergix44
sergix44 / deploy_update.sh
Last active September 24, 2018 11:32
Laravel deploy script
#!/usr/bin/env bash
# Laravel deploy script
PHP_PATH=php
$PHP_PATH artisan down
$PHP_PATH composer.phar install --no-dev
$PHP_PATH artisan cache:clear
@sergix44
sergix44 / deploy_install.sh
Created September 24, 2018 11:32
Laravel install script
#!/usr/bin/env bash
# Laravel install script
PHP_PATH=php
cp .env.example .env
nano .env
$PHP_PATH composer.phar install --no-dev
group: Treni
TRENO = {
num_treno:number, categoria:string, partenza:number, arrivo:number, destinazione:string
9716, frecciarossa, 10.02, 11.15, milano
9728, frecciarossa, 13.02, 14.15, milano
9732, frecciarossa, 14.02, 15.15, milano
2068, regionale, 12.45, 14.35, milano
group: EsameFebbraio2018
TORNEO = {
Nome:string, Citta:string, Stato:string
Wimbledon, Wimbledon, Inghilterra
"Fed Cup", Napoli, Italia
"Coppa Davis", Parigi, Francia
}
<?php
# -- config --
$INTERVAL = 5; // sec
$CODE = '1801sk20';
$COUNTRY = 'it';
$BUY_URL = "https://www.kimsufi.com/it/ordine/kimsufi.xml?reference=$CODE";
# ------------
function notify() {
global $CODE, $BUY_URL;
@sergix44
sergix44 / deb.ps1
Last active November 4, 2020 08:31
deb.ps1
##########
# Tweaked Win10 Initial Setup Script
# Primary Author: Disassembler <disassembler@dasm.cz>
# Primary Author Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
# Tweaked Source: https://gist.github.com/alirobe/7f3b34ad89a159e6daa1/
#
# Note from author: Never run scripts without reading them & understanding what they do.
#
# Addition: One command to rule them all, One command to find it, and One command to Run it!
#
<?php
use JsonMapper\Cache\ArrayCache;
use JsonMapper\Handler\PropertyMapper;
require 'vendor/autoload.php';
function bench($what = 'Bench', $echo = true)
{
global $DEBUG_TIME;
@sergix44
sergix44 / bench.php
Created January 23, 2022 12:06
comparing json mapping libraries
<?php
use EventSauce\ObjectHydrator\DefinitionDumper;
use EventSauce\ObjectHydrator\DefinitionProvider;
use EventSauce\ObjectHydrator\ObjectHydrator;
use EventSauce\ObjectHydrator\ObjectHydratorDumper;
use JsonMapper\Cache\ArrayCache;
use JsonMapper\Handler\PropertyMapper;
require 'vendor/autoload.php';