Skip to content

Instantly share code, notes, and snippets.

View vanderlin's full-sized avatar

Vanderlin vanderlin

View GitHub Profile
@vanderlin
vanderlin / Sublime Text 3 Command
Last active March 21, 2023 07:49
Create a Sublime Text 3 symbolic link to open a file via command line. paste this into terminal and now you can run `subl .` to open the directory in sublime or `subl file.html`
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@vanderlin
vanderlin / ofApp.cpp
Created August 5, 2019 18:19
Color Palette from image (OpenCV KMeans)
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
video.setDeviceID(0);
video.setup(320, 240);
}
//--------------------------------------------------------------
@vanderlin
vanderlin / gist:cb905bafc6e9aa5b84eca050e65d06b7
Created January 21, 2021 17:49
vector of ofxBox2d Circles
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup() {
// first init box2d
box2d.init();
// set the gravity
box2d.setGravity(0, 10);
@vanderlin
vanderlin / gist:f12e891435f5c43da1d55400330741b7
Last active January 21, 2021 15:51
basic ofxBox2d circle
//--------------------------------------------------------------
void ofApp::setup() {
// first init box2d
box2d.init();
// set the gravity
box2d.setGravity(0, 10);
// create bounds x,y,w,h
@vanderlin
vanderlin / main.cpp
Last active July 2, 2019 17:11
using a shader and texture OF+iOS
#include "ofApp.h"
int main() {
// here are the most commonly used iOS window settings.
//------------------------------------------------------
ofiOSWindowSettings settings;
settings.enableRetina = true; // enables retina resolution if the device supports it.
settings.enableDepth = false; // enables depth buffer for 3d drawing.
settings.enableAntiAliasing = false; // enables anti-aliasing which smooths out graphics on the screen.
@import url(./reset.css);
@import url(./fonts.css);
@import './colors.scss';
@import './typography.scss';
/* apply a natural box layout model to all elements, but allowing components to change */
html {
box-sizing: border-box;
user-select: none;
-webkit-tap-highlight-color: transparent;
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(246, 189, 208);
gui.setup();
gui.add(value.set("value", 2.5, 0.00001, 3));
gui.add(speed.set("speed", 0.045, 0.00001, 3));
{
"total_cars": 6,
"spots": {
"spot_13": {
"is_open": false,
"color": [
{
"r": 78,
"g": 78,
"b": 61,
@vanderlin
vanderlin / Rotate Box2d Rect
Last active April 24, 2018 19:51
Rotate a box2d Rect
#include "testApp.h"
#include "ofxBox2d.h"
ofxBox2dRect centerRect;
ofxBox2d box2d;
vector <ofPtr<ofxBox2dCircle> > circles;
//--------------------------------------------------------------
void testApp::setup() {
#include "ofApp.h"
vector<ofVideoDevice> devices;
int deviceCount = 0;
ofVideoGrabber vidGrabber;
int camWidth;
int camHeight;
//--------------------------------------------------------------
void ofApp::setup() {
camWidth = 320;