Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View patriciogonzalezvivo's full-sized avatar

Patricio Gonzalez Vivo patriciogonzalezvivo

View GitHub Profile
@patriciogonzalezvivo
patriciogonzalezvivo / install.sh
Last active August 30, 2016 14:39
HTTPS to HTTP in Amazon Linux server
#!/bin/bash
sudo yum update -y
# Install packages
sudo yum install -y httpd24 mod24_ssl php56 mysql55-server php56-mysqlnd
# Start the Apache web server
sudo service httpd start
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@patriciogonzalezvivo
patriciogonzalezvivo / multistep functions
Last active December 5, 2016 18:43
Multistep functions
```glsl
float mix4smoothstep(float a, float b, float c, float d, float x ) {
return mix(mix(a,b,smoothstep(0.,.33,x)),
mix(b,
mix(c,d,smoothstep(.66,.99,x)),
smoothstep(.33,.66,x)),
step(.33,x));
}
float mix4linear(float a, float b, float c, float d, float x ) {
@patriciogonzalezvivo
patriciogonzalezvivo / index.html
Last active February 14, 2017 16:17
territory
<!doctype html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Territory</title>
<!-- 3rd party libraries -->
<!-- Leaflet -->
// Resources
// - http://blog.packagecloud.io/debian/debuild/packaging/2015/06/08/buildling-deb-packages-with-debuild/
// - https://linuxconfig.org/easy-way-to-create-a-debian-package-and-local-package-repository
// - http://santi-bassett.blogspot.com/2014/07/how-to-create-debian-package.html
sudo apt-get install dh-make build-essential
sudo apt-get install devscripts fakeroot debootstrap pbuilder autotools-dev
# Create the packaging skeleton (debian/*)
# dh_make -s --indep --createorig
@patriciogonzalezvivo
patriciogonzalezvivo / rpi.md
Last active March 25, 2018 09:28
RaspberryPi post-installation

THE BASIC

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install avahi-daemon 

Apache Server

@patriciogonzalezvivo
patriciogonzalezvivo / load-files-dir.md
Last active July 14, 2018 06:42
Load all files on a folder with OF
ofDirectory dir(_path);
if(dir.exists()){
	dir.listDir();
    int total = dir.getFiles().size();
    for (int i = 0; i < total; i++) {
        cout << "Loading " << dir.getName(i) << endl;
    }
}
void rotateTo(ofPoint _dir){
ofVec3f newTarget = _dir;
newTarget.normalize();
ofVec3f up( 0, -1, 0 );
ofVec3f axis = up.crossed( newTarget );
axis.normalize();
float angle = up.angle( newTarget );
ofRotate( angle, axis.x, axis.y, axis.z );
}
@patriciogonzalezvivo
patriciogonzalezvivo / billboards.md
Last active July 14, 2018 06:43
Billboards on OF
void billBoard(){
	ofVec3f objectLookAt = ofVec3f(0,0,1);
	ofVec3f objToCam = cam.getGlobalPosition();
	objToCam.normalize();
	float theta = objectLookAt.angle(objToCam);
	
	ofVec3f axisOfRotation = objToCam.crossed(objectLookAt);
	axisOfRotation.normalize();
 
@patriciogonzalezvivo
patriciogonzalezvivo / toxic
Created June 27, 2015 12:55
Compiling a Tox Client in RPi
git clone git://github.com/jedisct1/libsodium.git
cd libsodium
git checkout tags/1.0.0
./autogen.sh
./configure && make check
sudo checkinstall --install --pkgname libsodium --pkgversion 1.0.0 --nodoc
sudo ldconfig
cd ..
git clone git://github.com/irungentoo/toxcore.git