Skip to content

Instantly share code, notes, and snippets.

View cmarangu's full-sized avatar
📚
studying

Chase Marangu cmarangu

📚
studying
View GitHub Profile
anonymous
anonymous / gist:7200880
Created October 28, 2013 17:20
Processing motion blur
/* passable motion blur effect using frame blending
* basically move your 'draw()' into 'sample()', time runs from 0 to 1
* by dave
* http://beesandbombs.tumblr.com
*/
int samplesPerFrame = 32; // more is better but slower. 32 is enough probably
int numFrames = 48;
float shutterAngle = 2.0; // this should be between 0 and 1 realistically. exaggerated for effect here
int[][] result;
set theProcessName to "iOS Simulator"
set theWindowNumber to 1
tell application "System Events"
tell process theProcessName
activate
tell window theWindowNumber
set thePosition to position
set theSize to size
end tell
@antiboredom
antiboredom / index.html
Created December 15, 2014 16:36
A simple example showing how to save animated gifs from p5.js sketches, using https://github.com/jnordberg/gif.js
<html>
<head>
<script src="gif.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.11/p5.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/p5.js/0.3.11/addons/p5.dom.js"></script>
<script src="sketch.js"></script>
</head>
<body>
<p>First, allow camera access.<p><p>Then click once to start recording, and another time finish recording and make a gif.</p>
</body>
@companje
companje / map.glsl
Created January 23, 2018 22:46
map() function for GLSL known from Processing & openFrameworks
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
@LadyScream
LadyScream / inside.pde
Created September 29, 2018 04:00
I'm still learning Java and Processing so this is in no way the best way to achieve this, but this is the way I've done it!
float time = 0;
int frame = 1;
boolean record = false;
Cube cube;
void setup(){
size(600, 600, P3D);
cube = new Cube(new PVector(0,0,0), 150);
}
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
@gregzanch
gregzanch / convert-base.ts
Created November 12, 2019 06:38
Base Conversion
function base_10_to_base_n(v: number,b: number,r:number[]=[]): number[]{
if(b==0) return;
if (Math.floor(v) != v || Math.floor(b) != b) return;
const div = Math.floor(v / b);
const rem = v - div * b
r.push(rem);
return div == 0 ? r.reverse() : base_10_to_base_n(div, b, r);
}
function base_n_to_base_10(val: number[], base: number) {
if (base == 0) return;
@nixin72
nixin72 / against-online-proctoring.md
Last active June 15, 2021 06:14
Proctored exams will not be tolerated

Dear Concordia University,

I am writing to you on behalf of the Concordia student body regarding the final exams and the decision to use online proctoring. We are urging you to change your decision about having online proctored exams. For many, this is an appalling invasion of privacy, a security risk, a demand for students to trade their morals for a grade, and discrimination against the less fortunate among the student body. In addition, over 7000 thousand Concordia students are against online proctoring.

  1. An invasion of privacy Forcing cameras and microphones into the homes of students is a violation of everyone's online privacy. For some, this might not be a huge concern, but for many others it's spying on