Skip to content

Instantly share code, notes, and snippets.

@houseofjeff
houseofjeff / listsarecool.py
Last active August 29, 2015 13:58
Python Intro - #1 - Lists
# Welcome to Jeff's first 5 minute intro to Python.
# More illustrative of a language than just the syntax, I think
# how a language handles data says a lot. So, I'm going to talk
# mostly about that, and let's start with lists.
# Since we all know how to program, I'm going to just leave a lot to
# be picked up by example rather than by exposition.
# --- save as 'listsarecool.py'
@houseofjeff
houseofjeff / tuplesalsocool.py
Last active August 29, 2015 13:58
Python Intro - #2 - Tuples
# Welcome back for Jeff's second 5 minute intro to Python.
# This time we'll talk about the list's immutable cousin, the tuple.
from collections import namedtuple
def main():
# tuples can be considered as immutable lists. A lot of what
# I'm going to show you here can also be done with lists, but
# it seems to fit better here.
@houseofjeff
houseofjeff / ir_capture.ino
Last active October 20, 2021 18:19
Capture/Record IR remote signals with an Arduino
//------------------------------------------------------------------------------
// Interrupt 0 fires on pin D2
#define IR_PIN 2
// the maximum pulse we'll listen for
#define MAX_PULSE 30000
// the largest message we expect to receive (in bits)
#define MAX_MSG_SIZE 50
@houseofjeff
houseofjeff / ir_identify.ino
Last active August 29, 2015 14:03
Identify a specific IR message with an Arduino
//------------------------------------------------------------------------------
// Interrupt 0 fires on pin D2
#define IR_PIN 2
// the maximum pulse we'll listen for
#define MAX_PULSE 30000
// the largest message we expect to receive (in bits)
#define MAX_MSG_SIZE 50
@houseofjeff
houseofjeff / scheduler_with_remote.ino
Last active August 29, 2015 14:03
Arduino Scheduler Framework w/ Remote-Control Sleep-mode
//------------------------------------------------------------------------------
//
// An Arduino Scheduler Framework with Remote-control Sleep Mode.
//
// For details, see my blog post:
// http://houseofjeff.com/2014/07/15/a-scheduling-framework-remote-control-sleep-mode-for-arduino/
//
// This sample is licensed under the MIT License (MIT)
// Copyright (c) 2014, by Jeff House
// Full text of license at the bottom of the file
@houseofjeff
houseofjeff / cron_parser.py
Last active August 29, 2015 14:15
An interesting look at how easy parsing & matching a cron-style schedule string can be.
from __future__ import division
import re
import random
from datetime import datetime, timedelta
def main():
timing_test(100000)
def simple_test():