Skip to content

Instantly share code, notes, and snippets.

@openp2pdesign
openp2pdesign / test01.ino
Created May 25, 2012 15:13
The file that is currently on an Arduino Uno with a serial number of 64935343633351E03172
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
@openp2pdesign
openp2pdesign / OKFestival-Tweets.py
Last active December 12, 2015 09:59
Convert a list of RT (in a .csv file) into a .gexf network
# Author: Massimo Menichinelli
# License: GPL v.3
import csv
import networkx as nx
ifile = open('okf2.csv', "rb")
reader = csv.reader(ifile)
g = nx.DiGraph()
@openp2pdesign
openp2pdesign / graph-tool installation on Mavericks.md
Last active February 19, 2020 09:20
Install graph-tool on Mac OS Mavericks with python installed with brew
@openp2pdesign
openp2pdesign / sync.py
Last active August 29, 2015 14:14
Fab Academy Git + Hg sync
# -*- encoding: utf-8 -*-
#
# Author: Massimo Menichinelli
# Homepage: http://www.openp2pdesign.org
# License: MIT
#
import subprocess
import os
import string
@openp2pdesign
openp2pdesign / renameillegalfiles.py
Last active June 30, 2021 04:02
Check and rename files with illegal chars
# -*- encoding: utf-8 -*-
#
# Author: Massimo Menichinelli
# Homepage: http://www.openp2pdesign.org
# License: MIT
#
import string
import os
@openp2pdesign
openp2pdesign / wxpython-serialdata.py
Last active July 24, 2018 07:48
A desktop app in wxPython that draws according data from a serial port
# -*- coding: utf-8 -*-
# Author: Massimo Menichinelli
# Homepage: http://www.openp2pdesign.org
# License: MIT
#
import wx
import serial
# A new custom class that extends the wx.Frame
@openp2pdesign
openp2pdesign / wxpython-serialdata-matplotlib.py
Created May 12, 2015 11:06
A desktop app in wxPython+Matplotlib that draws according data from a serial port
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import wx
import serial
# Import matplotlib for wxPython
import matplotlib
matplotlib.use('WXAgg')
@openp2pdesign
openp2pdesign / kivy-serialdata.py
Last active November 29, 2023 12:13
Drawing serial data with Kivy (Python)
# -*- coding: utf8 -*-
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.graphics import Line
from kivy.uix.label import Label
from kivy.core.window import Window
from kivy.clock import Clock
import serial
@openp2pdesign
openp2pdesign / template.py
Last active August 29, 2015 14:22
A wxGestalt template
# -*- coding: utf-8 -*-
# License: Public Domain (use it as you like!)
# Import main wxPython libraries
import wx
import wx.xrc
# Import the wxGestalt module for Gestalt Machines
import Machines.wxMachines as wxMachines
# -*- coding: utf-8 -*-
#
# Based on:
# https://code.google.com/p/gource/wiki/GravatarExample
# https://gist.github.com/macagua/5c2f5e4e38df92aae7fe
# Usage with Gource: gource --user-image-dir .git/avatar/
# Get list of authors + email with git log
# git log --format='%aN|%aE' | sort -u