Skip to content

Instantly share code, notes, and snippets.

View drewish's full-sized avatar

andrew morton drewish

View GitHub Profile
# This is a script to demonstrate some features of Recurly's V3 API. It shows
# how to use multiple clients for separate sites to copy plan and add-on data
# between them.
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'recurly', '3.0.0.beta.6'
gem 'pry'
end
@drewish
drewish / cinder_docs_todo.md
Last active January 24, 2016 17:42
Cinder Documentation To Do

Needs documentation

CameraUi

  • Should document the effects of the various mouse button presses
  • Is there a way to limit camera moves?

Geom::Plane

  • Explain what the axes params mean.
@drewish
drewish / polyline_area.cpp
Last active August 29, 2015 14:14
Area of a cinder::PolyLine2f
// Assumes line does not self intersecting
// Treats the line as closed (you wanted area right?)
// http://www.mathsisfun.com/geometry/area-irregular-polygons.html
float area( PolyLine2f line ) {
float sum = 0.0;
if ( line.size() > 1 ) {
PolyLine2f::iterator it;
Vec2f prev, curr;
for ( it = line.begin(), prev = *it++; it != line.end() ; it++ ) {
curr = *it;
@drewish
drewish / StarterApp.cpp
Created October 5, 2014 03:06
My Cinder StarterApp
#include "cinder/app/AppNative.h"
#include "cinder/Camera.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Utilities.h"
using namespace ci;
using namespace ci::app;
using namespace std;
@drewish
drewish / SquarePerspectiveApp.cpp
Last active October 21, 2015 16:00
SquarePerspectiveApp
// About this: https://drewish.com/2014/08/23/using-cinder's-cameraortho-and-vbomesh-to-draw-cubes/
// Inspired by: http://onepointperspective.tumblr.com/post/7805032561/the-perspective-of-a-square
// Use with Cinder 0.9.x
#include "cinder/app/App.h"
#include "cinder/app/RendererGl.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Utilities.h"
@drewish
drewish / TestMeshApp.cpp
Last active August 29, 2015 14:05
Simple demo to compare drawing 2D triangles with Cinder's VBO and TriMesh wrappers
// Simple demo to compare drawing 2D triangles with Cinder's VBO and TriMesh wrappers.
// https://drewish.com/2014/08/16/comparing-the-trimesh-and-vbomesh-in-cinder/
#include "cinder/app/AppBasic.h"
#include "cinder/gl/gl.h"
#include "cinder/gl/Vbo.h"
#include "cinder/Trimesh.h"
#include "cinder/params/Params.h"
using namespace ci;
@drewish
drewish / TrianglePaintApp.cpp
Created August 5, 2014 02:51
trying to figure out cinder screenToWorld
#include "cinder/app/AppNative.h"
#include "cinder/gl/gl.h"
#include "cinder/Camera.h"
#include "cinder/params/Params.h"
using namespace ci;
using namespace ci::app;
using namespace std;

Keybase proof

I hereby claim:

  • I am drewish on github.
  • I am drewish (https://keybase.io/drewish) on keybase.
  • I have a public key whose fingerprint is 4FFD A235 05DE 31CC E6C5 8F09 EC2E 7937 F120 9926

To claim this, I am signing this object:

cd DIRECTORY_WITH_.ruby-version_AND_Gemfile
brew update
brew upgrade ruby-build
rbenv install
gem install bundler
bundle install
@drewish
drewish / binding.gyp
Created September 11, 2012 07:51
gyp support for exiv2node
{
'targets': [
{
'target_name': 'exiv2',
'sources': [
'exiv2node.cc'
],
'xcode_settings': {
'OTHER_CFLAGS': [
'<!@(pkg-config --cflags exiv2)',