Skip to content

Instantly share code, notes, and snippets.

@golanlevin
golanlevin / modulo_example.js
Created October 24, 2017 15:04
Modulo Example from Golan's Coding Train
var nElements = 7;
var myCounter = 0;
var ping = 0;
function setup() {
createCanvas(600, 500);
}
function draw() {
background((255*(1-(ping*=0.95))), 255,255);
import peasy.*;
import peasy.org.apache.commons.math.*;
import peasy.org.apache.commons.math.geometry.*;
PeasyCam cam;
float x,y,z;
void setup(){
size(800,800,P3D);
cam = new PeasyCam(this,100);
x=random(-800,800);
y=random(-800,800);
@cnelson
cnelson / procnetdev.py
Last active February 27, 2024 14:45
Parses /proc/net/dev into a usable python datastructure
from datetime import datetime
class ProcNetDev(object):
"""Parses /proc/net/dev into a usable python datastructure.
By default each time you access the structure, /proc/net/dev is re-read
and parsed so data is always current.
If you want to disable this feature, pass auto_update=False to the constructor.