Skip to content

Instantly share code, notes, and snippets.

Roberto Andreoni robertoandreoni

  • Milano
Block or report user

Report or block robertoandreoni

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cli-arguments-parser.php
<?php
function arguments() {
global $argv;
$arguments = array();
$tmpIndex = null;
foreach ($argv as $indexOfArgv => $valueOfArgv) {
if ($indexOfArgv == 0)
continue;
@robertoandreoni
robertoandreoni / api-example.php
Created Apr 4, 2019
A Flask/Sinatra/Slim super minimal alternative of mine in PHP. With modular functionalities with the use of 'use'.
View api-example.php
<?php
require_once "classes.php";
header('Content-Type: application/json');
function default_json_error()
{
echo json_encode(array(
'error' => 500,
@robertoandreoni
robertoandreoni / mysql_split.py
Created Mar 8, 2019
python script to split mysql dump into tables files
View mysql_split.py
#!/usr/bin/python
import re
import sys
import os
filename_path = os.path.abspath(sys.argv[1])
filename = os.path.basename(filename_path)
filename_tables_path = os.path.dirname(filename_path) + "/" + filename + "_tables"
View django_models2admin.py
#!/usr/bin/python
import sys, re
file = open(sys.argv[1]).read()
classes = re.split(r'^class',file,flags=re.MULTILINE)
templ = """
class %sAdmin(admin.ModelAdmin):
fieldsets = [
You can’t perform that action at this time.