Skip to content

Instantly share code, notes, and snippets.

View jeffcrouse's full-sized avatar

Jeff Crouse jeffcrouse

View GitHub Profile
@jeffcrouse
jeffcrouse / poco_http_post_headers.cpp
Last active February 9, 2023 03:36
Poco HTTPPOST request with headers
#include <Poco/Net/HTTPClientSession.h>
#include <Poco/Net/HTTPRequest.h>
#include <Poco/Net/HTTPResponse.h>
#include <Poco/StreamCopier.h>
#include <Poco/Path.h>
#include <Poco/URI.h>
#include <Poco/Exception.h>
using namespace Poco::Net;
using namespace Poco;
@jeffcrouse
jeffcrouse / Hover.cs
Created January 29, 2018 23:34
A handy script for making a Unity GameObject rotate and "wobble" with exposed parameters for speed and amount.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/**
* Lessons:
* 1. Scripts are mini-programs that operate on a GameObject in your scene.
* 2. How to get a component of the GameObject this script is attached to?
* 3. How to modify that component over time.
* 4. FIX IN CLASS: There is actually a shortcut to get the transform of the GameObject.
const path = require('path');
const { exec } = require('child_process');
// https://www.nirsoft.net/utils/dump_edid.html
const exe = path.resolve(__dirname, "bin", "DumpEDID.exe");
const regex = /\*{65}([^\*]+)\*{65}/gm;
var _displays = [];
var _first = true;
@jeffcrouse
jeffcrouse / SteamVR_TrackedObject_Plus.cs
Last active July 1, 2022 07:46
SteamVR_TrackedObject_Plus
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: For controlling in-game objects with tracked devices.
// Update jeff at seethrouhlab
// - Added ability to specify a serial number to assign to the TrackedObject
// - Added a configurable lag value.
// - use with GameManager https://gist.github.com/jeffcrouse/6419e84d7060c08c17cf97b9c41ddd14
//=============================================================================
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.XR.ARSubsystems;
using UnityEditor.XR.ARSubsystems;
public class MakeImageLibrary
{
[MenuItem("Assets/Create/AR Image Library")]
using System.Collections;
using System.Collections.Generic;
using System.Text;
using UnityEngine;
using Valve.VR;
public class GameManager : MonoBehaviour
{
[Range(10, 1000)]
public long LagMillis = 100;
@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"
#include "ofApp.h"
string input;
string valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ()";
//--------------------------------------------------------------
void ofApp::setup(){
ofBackground(0);
}
@jeffcrouse
jeffcrouse / App.cpp
Created October 13, 2017 19:34
End point code for Week 6
#include "ofApp.h"
#define NUM_PARTICLES 100
class Particle {
public:
void setup(ofPoint _pos, ofPoint _vel) {
pos = _pos;
vel = _vel;
}
@jeffcrouse
jeffcrouse / ofApp.cpp
Created October 13, 2017 19:26
mid-point code for Week 6
#include "ofApp.h"
#define NUM_PARTICLES 100
float radius = 5;
vector<ofPoint> pos;
vector<ofPoint> vel;
vector<float> alpha;
ofPoint lastMousePos;