Skip to content

Instantly share code, notes, and snippets.


Lou Franco loufranco

View GitHub Profile
loufranco /
Created Jul 17, 2017
A Python script to make red/cyan 3D photos
from PIL import Image
import sys
# Check arguments
if len(sys.argv) < 3:
print "Usage: python <leftimage> <rightimage> <3doutputname>"
# Open the left and right images
imLeft =[1])
View simplify.cpp
#include <iostream>
using namespace std;
struct Const {
Const(int c) : c(c) {}
int c;
struct One : Const {
One() : Const(1) {}
loufranco / WrapPatternMatching.swift
Last active Aug 29, 2015
Wrapping Swift Pattern Matching in a Closure
View WrapPatternMatching.swift
import Foundation
import Darwin
// Given Box and Result definitions from "Functional Programming in Swift"
// Buy it here:
// You need Box because Swift can't handle generics in Enums directly
public class Box<T> {
let unbox:T
init(_ value:T) { self.unbox = value }
loufranco / capper.c
Created Apr 4, 2014
Capitalize the first uncapped word
View capper.c
char* capper(char* s, char* outs) {
strcpy(outs, s);
for (char* s2=outs; *s2; ++s2) {
if (islower(*s2) && (s2==outs || isspace(*(s2-1)))) {
return outs;