Skip to content

Instantly share code, notes, and snippets.

@mattfelsen
mattfelsen / gist:10221243
Created April 9, 2014 02:40
Web-related setup on Ubuntu/AWS
Ubuntu web-related setup
# Install mysql extension for php
sudo apt-get install php5-mysql
# Enable mod_rewrite in Apache
sudo a2enmod rewrite
# Allow .htaccess to do mod_rewrite rules
# in /etc/apache2/httpd.conf or /etc/apache2/apache.conf or /etc/apache2/sites-enabled/000-default
@mattfelsen
mattfelsen / sketch.pde
Last active August 29, 2015 13:57
Wall Drawing #271, Sol Lewitt, 1975
/*
Wall Drawing #271: Black circles, red grid, yellow arcs from four
corners, blue arcs from the midpoints of four sides
(ACG 195) 1975
Originally colored pencil on wall
Solomon R. Guggenheim Museum
New York
Recreated by Matt Felsen in Processing, 2014
@mattfelsen
mattfelsen / gist:9467420
Last active February 2, 2023 22:28
Splitting strings by a delimiter for Arduino
//
// This is tested and works!
//
String input = "123,456";
int firstVal, secondVal;
for (int i = 0; i < input.length(); i++) {
if (input.substring(i, i+1) == ",") {
firstVal = input.substring(0, i).toInt();
secondVal = input.substring(i+1).toInt();
@mattfelsen
mattfelsen / gist:e174f032fa10fa16cfb5
Last active March 2, 2016 22:36
Useful Git Commands

Commits

Undo last commit

git reset --soft HEAD~1

Add stuff to last commit

git add file.cpp
git commit --amend