Skip to content

Instantly share code, notes, and snippets.

@piac
piac / list_to_tree.py
Last active October 31, 2022 20:01
Transforms DataTrees in Grasshopper to nestings of lists, and vice versa
def list_to_tree(input, none_and_holes=True, source=[0]):
"""Transforms nestings of lists or tuples to a Grasshopper DataTree"""
from Grasshopper import DataTree as Tree
from Grasshopper.Kernel.Data import GH_Path as Path
from System import Array
def proc(input,tree,track):
path = Path(Array[int](track))
if len(input) == 0 and none_and_holes: tree.EnsurePath(path); return
for i,item in enumerate(input):
if hasattr(item, '__iter__'): #if list or tuple
@vibragiel
vibragiel / papeles_barcenas.json
Last active December 12, 2015 02:48
JSON con los papeles de Bárcenas publicados por EL PAÍS en http://elpais.com/especiales/2013/caso_barcenas/todos_los_papeles.html
[
{
"forma": "Efectivo",
"debe_unidad": "(\u00bf?)",
"debe": 8.0,
"concepto": "Saldo inicial (entrega R. N.)",
"haber": null,
"anyo": 1990,
"saldo": 8.0,
"saldo_unidad": "(\u00bf?)",
@bmander
bmander / dotmap.pde
Created December 27, 2012 04:26
Generate dotmap tiles
/* I, Brandon Martin-Anderson, release this into the public domain or whatever. */
BufferedReader reader;
double ll, bb, rr, tt;
float A = 1000.0;
GlobalMercator proj = new GlobalMercator();
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->