Skip to content

Instantly share code, notes, and snippets.

View jeffcrouse's full-sized avatar

Jeff Crouse jeffcrouse

View GitHub Profile
@jeffcrouse
jeffcrouse / camcrawler.js
Last active August 15, 2018 12:20
A quick node-crawler that looks for open surveillance cameras worldwide. Inspired by, and using URL patterns found at http://i.document.m05.de/surveillancesaver/
var Crawler = require("crawler").Crawler; // https://github.com/sylvinus/node-crawler
var S = require('string');
var fs = require('fs');
// A list of some patterns that will show up in webcam URLs
var patterns = ["jpg/image.jpg\?r="
, "mjpg/video.mjpg"
, "record/current.jpg"
, "cgi-bin/faststream.jpg"
, "oneshotimage.jpg"
@jeffcrouse
jeffcrouse / blocks.cpp
Created November 2, 2013 21:11
compile with g++ -o blocks blocks.cpp
#include <iostream>
using namespace std;
int main ()
{
int foo[4];
double bar[4];
// Print out the memory addresses of all 4 elements of "foo"
for(int i=0; i<4; i++)
// tostring2.cpp
#include <iostream>
using namespace std;
class Rectangle {
public:
void init(float _x, float _y, float _width, float _height) {
x = _x;
y = _y;
width = _width;
// tostring.cpp
#include <iostream>
using namespace std;
class Rectangle {
public:
void init(float _x, float _y, float _width, float _height) {
x = _x;
y = _y;
width = _width;
#include <iostream>
using namespace std;
int foo; // static memory allocation
void f()
{
int bar; // automatic memory allocation
cout << "&bar = " << &bar << endl;
#include <iostream>
using namespace std;
class Player {
public:
string name;
float xPos;
float yPos;
double timeAlive;
};
@jeffcrouse
jeffcrouse / size.cpp
Last active December 25, 2015 06:49
1. save this program as size.cpp 2. compile it: g++ -o size size.cpp 3. run it: ./size
#include <iostream>
using namespace std;
int main ()
{
int foo;
cout << "sizeof(foo) = " << sizeof(foo) << endl;
}
@jeffcrouse
jeffcrouse / Snowman.cpp
Created October 29, 2012 21:56
drawSnowman, drawBoat, drawWater
void drawSnowman()
{
ofPushStyle();
// Head
ofFill();
ofSetColor(255,255,255);
ofCircle(50, 50, 25);
ofCircle(50, 90, 30);
ofCircle(50, 160, 50);