Skip to content

Instantly share code, notes, and snippets.

View riccardocossu's full-sized avatar

Riccardo Cossu riccardocossu

  • Freelance
  • Bologna, Italy
View GitHub Profile
@ls-dac-chartrand
ls-dac-chartrand / swagit.php
Last active August 7, 2024 12:08
Swag It: Reverse engineer Swagger-PHP annotations from an existing JSON payload
<?php
// -------------------------------------------------------------------------------------
// Add your JSON in the $input to generate Swagger-PHP annotation
// Inspired by: https://github.com/Roger13/SwagDefGen
// HOWTO:
// php -S localhost:8888 -t .
// http://localhost:8888/swagit.php
// -------------------------------------------------------------------------------------
@dpoggi
dpoggi / homebrew.mxcl.autossh.plist
Last active December 11, 2022 00:00
launchd plist for Homebrewed autossh (local tunnel)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>homebrew.mxcl.autossh</string>
<key>KeepAlive</key>
<true/>
@blister
blister / gist:740829
Created December 14, 2010 18:19
Bash script to add a delay to the localhost interface on Linux machines
#!/bin/bash
# Copyright 2010 Eric Ryan Harrison <me@ericharrison.info>
# Inspired by:
# http://daniel.haxx.se/blog/2010/12/14/add-latency-to-localhost/
if [ -n "$1" ]
then
if [ "$1" = "off" ]
then
tc qdisc del dev lo root