Skip to content

Instantly share code, notes, and snippets.

@pato
pato / SwipeableTabView.ContentView.swift
Last active May 8, 2020 21:48
Creating a TabView that responds to horizontal swipe gestures to change tabs
//
// ContentView.swift
// SwipeableTabView
//
// Created by Patricio Lankenau on 5/8/20.
// This is free and unencumbered software released into the public domain.
//
import SwiftUI
@pato
pato / Couch.java
Created August 24, 2017 06:42
Couch depreciation and payment calculator for nerd roomates
package main;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
public class Couch {
public static void main(final String... args) {
final float original = 800;
final float dpm = .02f;
@pato
pato / encrypt_recorder.py
Created April 14, 2016 04:58
Script to be run whenever USB recorder is plugged in, copy the files, encrypt them using GPG, and shred the plain file
#!/usr/bin/python
from os import listdir, system
from os.path import isfile, join, getmtime
from shutil import move
from datetime import date
from subprocess import call
encryptEmail = "youremail@here.com"
src = "/media/RECORD/RECORD/VOICE"
@pato
pato / keybase.md
Created December 5, 2014 05:28
Keybase Proof

Keybase proof

I hereby claim:

  • I am pato on github.
  • I am pato (https://keybase.io/pato) on keybase.
  • I have a public key whose fingerprint is 8B68 3168 8239 F072 6F8A B76F 97D6 B03D 821C 0CE9

To claim this, I am signing this object:

@pato
pato / ipmail.py
Created February 6, 2014 06:31
Python script to email Raspberry Pi on boot
'''
Rasberry Pi IP Emailer
Save this script somewhere
Add the following to /etc/rc.local (if using Raspbian)
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
@pato
pato / name.java
Last active January 2, 2016 11:09
Example of getting variable names in java
import java.lang.reflect.Field;
public class name {
public int myint = 5;
public Integer myInteger = new Integer(44);
public String pato = "Lankenau";
public boolean mybool = false;
@pato
pato / emClock.py
Created August 6, 2013 17:24
emClock - Raspberry Pi Clock + email checker using Adafruit's LED matrices and a piface
#!/usr/bin/python
import time
import datetime
import feedparser
import threading
from Adafruit_8x8 import EightByEight
import piface.pfio as pfio
pfio.init()
@pato
pato / compile.java
Created May 11, 2013 21:08
Java class which builds various versions of the same project by modifying a settings file accordingly
class Compile {
private static Runtime rt = Runtime.getRuntime();
private static final String version = "1.4.2";
public static void main(String[] args) throws IOException{
modify(false,false,true);
build();dist("Full");
modify(false,true,true);
build();dist("Trial");
}