Skip to content

Instantly share code, notes, and snippets.

View oolong32's full-sized avatar
💭
🏓

Josef Renner oolong32

💭
🏓
View GitHub Profile
@oolong32
oolong32 / touchFileInFolder.sh
Created April 25, 2017 10:56
shellscript – create file in a list of folders
for i in `ls -1`
do touch $i/filename.txt && echo "https://www.bla.com“ >> $i/filename.txt
done
newPage(1000, 1000)
# grid is defined by dimension of a single cell
cell = 80
rows = int(height() / cell)
cols = int(width() / cell)
offset_x = width() % cell / 2
offset_y = height() % cell / 2
// set up grid in p5
var rows;
var cols;
var cell_w = 72;
var cell_h = 77;
function setup() {
createCanvas(500, 500);
background(0);
@oolong32
oolong32 / rasterOfThings.py
Last active November 22, 2016 21:55
Rasterize Page for Drawbot, Fill Raster with Instances of Object
import time
from random import randrange
# create new page
newPage('A3Landscape')
# set margins for RISO
margin_x = 23
margin_y = 37

Keybase proof

I hereby claim:

  • I am oolong32 on github.
  • I am oolong (https://keybase.io/oolong) on keybase.
  • I have a public key ASAQKaFxS6Kz3c4Lo6Duger_2aJbpQgaCueTnw6tASyP-Qo

To claim this, I am signing this object:

@oolong32
oolong32 / sketch.js
Created March 14, 2016 23:21
p5.js code for the bouncing ball example in Dan Shiffman’s video ‘PVector class (The Nature of Code)’ <https://vimeo.com/58943395>
var b;
function Ball() {
this.location = createVector(width/2, height/2);
this.velocity = createVector(2.5, -2);
this.move = function() {
this.location = this.location.add(this.velocity);
};
this.bounce = function() {
if (this.location.x > width || this.location.x < 0) {
@oolong32
oolong32 / 8-bit-colors-float
Last active January 25, 2016 23:10
8 bit numbers in a list as values from 0 to 1. Because I have a hard time getting the RGB colors right in Drawbot.
# 8 bit colors as values from 0 to 1 in a list,
# usage: fill(c[255], c[239], c[213]) = papaya whip
c = [0, 0.00392156862745, 0.0078431372549, 0.0117647058824, 0.0156862745098, 0.0196078431373, 0.0235294117647, 0.0274509803922, 0.0313725490196, 0.0352941176471, 0.0392156862745, 0.043137254902, 0.0470588235294, 0.0509803921569, 0.0549019607843, 0.0588235294118, 0.0627450980392, 0.0666666666667, 0.0705882352941, 0.0745098039216, 0.078431372549, 0.0823529411765, 0.0862745098039, 0.0901960784314, 0.0941176470588, 0.0980392156863, 0.101960784314, 0.105882352941, 0.109803921569, 0.113725490196, 0.117647058824, 0.121568627451, 0.125490196078, 0.129411764706, 0.133333333333, 0.137254901961, 0.141176470588, 0.145098039216, 0.149019607843, 0.152941176471, 0.156862745098, 0.160784313725, 0.164705882353, 0.16862745098, 0.172549019608, 0.176470588235, 0.180392156863, 0.18431372549, 0.188235294118, 0.192156862745, 0.196078431373, 0.2, 0.203921568627, 0.207843137255, 0.211764705882, 0.21568627451, 0.219607843137, 0.22352941
@oolong32
oolong32 / .gitignore
Last active December 24, 2015 23:31 — forked from nicoleslaw/1_Tiny_Content_Framework.md
Tiny Content Framework
*.swp