Skip to content

Instantly share code, notes, and snippets.

View patriciogonzalezvivo's full-sized avatar

Patricio Gonzalez Vivo patriciogonzalezvivo

View GitHub Profile
@jkosoy
jkosoy / gist:5379904
Last active June 20, 2023 14:06
Raspberry Pi setup

Raspberry Pi setup

Just wanted a quick start guide for myself so that I wouldn't have to keep rooting through Google to remember all this stuff. Hopefully it helps other people.

If you had other ideas or suggestions please leave a comment.

Useful things to own before you buy a Pi

The first time I bought a Pi I was enormously frustrated with myself because I didn't own all of this stuff. Kept having to order things off of Amazon and wait to get started... very irritating. This is all good stuff to have laying around anyway:

@danomatika
danomatika / Makefile.osx
Created July 2, 2013 17:13
FreeImage Makefile for Mac OSX updated to build 32/64 bit fat libs, tested with OSX 10.8 & XCode 4.6
# Configuration for Max OSX, builds fat 32/64 bit static & dynamic libs
include Makefile.srcs
# Update this based on your installed SDKs
MACOSX_SDK = 10.8
MACOSX_MIN_SDK = 10.6
# Find SDK path via xcode-select, backwards compatible with Xcode vers < 4.5
MACOSX_SYSROOT = $(shell xcode-select -print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOSX_SDK).sdk
@danomatika
danomatika / Makefile.iphone
Created July 2, 2013 17:15
FreeImage Makefile for iOS updated for newer version of XCode, tested with OSX 10.8 & XCode 4.6
# Configuration for iPhone OS, builds static libs for iOS and the iOSSimulator
#
# You can make a fat lib (iOS + iOSSimulator) using lipo:
# lipo -c libfreeimage-simulator.a libfreeimage-armv7.a -o libfreeimage.a
#
# Example: build & link fat lib for armv6, armv7, armv7s, & simulator
#
# make -f Makefile.iphone
# sed -i tmp "s|ARCH_PHONE =.*|ARCH_PHONE = armv7s|" Makefile.iphone
# make -f Makefile.iphone
@tealtan
tealtan / instructions.md
Last active December 30, 2016 15:07
Custom Twitter stylesheet

Custom Twitter Stylesheet

Craig Mod does a bigger overhaul with Twitter for Minimalists, but this will only do the following:

  • Hides promoted tweets and trends
  • Hides the useless “Expand” link that appears under every tweet
  • Tones down the blue conversation line to a barely-visible gray
  • Hides all numbers

You can add this CSS in Safari with this extension. The URL to target is twitter.com/*.

@jvcleave
jvcleave / distccd-rpi.plist
Last active April 30, 2024 06:27
mac distcc install instructions
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>distccd-rpi</string>
<key>Program</key>
<string>/Users/YOUR_USER_NAME/Scripts/launchd-distccd.sh</string>
<key>RunAtLoad</key>
<true/>
@rcolinray
rcolinray / gl_ffmpeg.cpp
Created November 19, 2013 20:54
OpenGL-FFMpeg integration
// Use OpenGL 3.0+, but don't use GLU
#define GLFW_INCLUDE_GL3
#define GLFW_NO_GLU
#include <GL/glfw.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
extern "C" {
@larsberg
larsberg / ClosestPointOnLine for openframeworks
Last active May 19, 2021 00:28
closest point on line in OF.
//closest point on line
//http://paulbourke.net/geometry/pointlineplane/
ofVec3f closestPointOnLine(ofVec3f p, ofVec3f l0, ofVec3f l1 )
{
if(l0 == l1) return ofVec3f();
float u = (((p.x-l0.x) * (l1.x-l0.x)) + ((p.y-l0.y) * (l1.y-l0.y)) + ((p.z-l0.z) * (l1.z-l0.z))) / l1.distanceSquared( l0 );
if( u < 0.0f )
return l0;
@larsberg
larsberg / Svg2Mesh
Created August 1, 2014 21:53
OF svg to ofMesh
static void addSvgToMesh(string dir, ofMesh& m)
{
ofxSVG svg;
svg.load(dir);
for ( auto i=0; i<svg.getNumPath(); i++ )
{
auto& path = svg.getPathAt(i);
path.simplify();
@larsberg
larsberg / Mesh2Points.h
Created August 4, 2014 20:49
evenly distributed random points on a mesh
//
// Mesh2Points.h
//
// Created by lars berg on 8/1/14.
//
#pragma once
#include "ofMain.h"
@companje
companje / globe.cpp
Created September 24, 2014 13:31
getting Longitude/Latitude when clicking on a rotated sphere
#include "ofMain.h"
class ofApp : public ofBaseApp {
public:
ofImage earth;
ofQuaternion qTo;
float angle;
ofVec3f axis;
ofPoint green;