Skip to content

Instantly share code, notes, and snippets.

@fsantini
fsantini / deleteGroup.FCMacro
Created January 10, 2015 20:33
FreeCAD macro for deleting a group object together with its children
import Part, FreeCAD, math, PartGui, FreeCADGui
from FreeCAD import Base, Console
def delWithChildren(obj):
doc = FreeCAD.ActiveDocument
for o in obj.OutList:
delWithChildren(o)
doc.removeObject(obj.Name)
sel = FreeCADGui.Selection.getSelection() # " sel " contains the items selected
@fsantini
fsantini / download.php
Created July 19, 2013 12:31
This page can be used as a "proxy" file download page that counts the downloads of every file storing them in a MySQL/MariaDB database.
<?php
/* File download counter.
* This code is copyright of Francesco Santini <francesco.santini _at_ gmail.com> and can be used and distributed freely,
* provided that you cite the author, according to the Creative Commons 3.0 - Attribution (cc-by) license.
*
* This page can be used as a "proxy" file download page that counts the downloads of every file storing them in a MySQL/MariaDB database.
* Whenever you want to let the user download a specific file, say "files/arch.tgz", use the link download.php?path=files/arch.tgz.
* This can be made transparent to the user by using the .htaccess file (see below)
* To read the statistics, call the page with the parameters show=true and your password, like this: download.php?show=true&pass=page_password.
*