Skip to content

Instantly share code, notes, and snippets.

View roberto-arista's full-sized avatar

Roberto Arista roberto-arista

View GitHub Profile
@roberto-arista
roberto-arista / hapaxator.py
Last active August 29, 2015 14:09
This script is able to reorder by occurrences a txt file. It returns two different txt files, words and punctuation. It is possible to choose the direction of the ordering action: increasing or decreasing.
# Copyright (c) 2013, Federico Antonini e Roberto Arista
# MIT License
# Hapax script
### Opening libraries
import string
import re
import sys
from operator import itemgetter
@roberto-arista
roberto-arista / gazePosition_visualization.py
Last active August 29, 2015 14:02
A Python/Drawbot script able to visualize gaze_position.npy by Pupil Capture eye-tracker
################################
# Gaze positions visualization #
################################
### Modules
import numpy
import sys
from operator import itemgetter
### Functions
@roberto-arista
roberto-arista / dominanti_cromatiche.py
Last active August 29, 2015 14:02
This script helps you dividing raster images by dominant colors. You can modify the benchmark_colors dictionary as you wish. Dependencies: PIL
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#################################################
# Organizing images by dominant colors with PIL #
#################################################
### Modules
from PIL import Image, ImageStat
import os
@roberto-arista
roberto-arista / typefaceOrientedGrid.py
Last active September 12, 2020 23:51
Typeface Oriented Grid Generator – open with Drawbot and launch!
####################################
# Typeface oriented grid generator #
####################################
"""
Usage:
- open .py file with Drawbot (drawbot.readthedocs.org) and launch
- use what the script prints out to set your InDesign document
"""
@roberto-arista
roberto-arista / fromUfoToDrawbot.py
Last active August 29, 2015 14:01
From UFO Robofab to Drawbot context
### Module
from robofab.world import OpenFont
### Functions
def drawCon(con):
bezierPath = BezierPath()
# Iteration over segments
for seg in con:
@roberto-arista
roberto-arista / drawPoly.pde
Last active August 29, 2015 13:59
drawPoly.pde
void drawPoly(float x, float y, float radius, int numEdges) {
float arc = TWO_PI / numEdges;
beginShape();
for (int i=0; i<numEdges; i++) {
float a = arc * i;
float px = x + cos(a) * radius;
float py = y + sin(a) * radius;