Skip to content

Instantly share code, notes, and snippets.

@mattfelsen
mattfelsen / gist:9dce6913b4e034045a13
Last active August 21, 2016 02:06
Useful OS X command line system stuff

Number of connected displays

system_profiler SPDisplaysDataType | grep Resolution | wc -l | sed 's/ //g'

Whether the system is sleeping or not

1 is alseep, 4 is not sleeping

ioreg -n IODisplayWrangler | grep -i IOPowerManagement | perl -pe 's/^.*DevicePowerState\"=([0-9]+).*$/\1/'

Set or check scheduled sleep/shutdown/wake settings

var builder = require('botbuilder');
var botbuilder_azure = require('botbuilder-azure');
var azure_storage = require('azure-storage');
var blobService = azure_storage.createBlobService();
var useEmulator = (process.env.NODE_ENV == 'development');
var connector = useEmulator ? new builder.ChatConnector() : new botbuilder_azure.BotServiceConnector({
appId: process.env['MicrosoftAppId'],
appPassword: process.env['MicrosoftAppPassword'],
@mattfelsen
mattfelsen / gist:8484e1d8ec26ef5443616dd80b10813e
Created December 7, 2017 13:36
Rotate point cloud into proper world space
// Transforms to move point cloud into correct world space
folder->addSlider("Camera tilt", -75, 75, 0)->bind(cameraTilt);
folder->addSlider("Camera roll", -30, 30, 0)->bind(cameraRoll);
folder->addSlider("Camera height", -60, 60, 0)->bind(cameraHeight);
// Shift around the rotated point cloud so its center sits on the origin
folder->addSlider("Shift X", -10, 10, 0)->bind(sceneShiftX);
folder->addSlider("Shift Y", -10, 10, 0)->bind(sceneShiftY);
folder->addSlider("Shift Z", -10, 10, 0)->bind(sceneShiftZ);
folder->addSlider("Floor plane", -100, 100, 0)->bind(floorPlane);
@mattfelsen
mattfelsen / VideoView-DrawMode.diff
Last active August 21, 2018 22:37
Bluecadet Views VideoView DrawMode for unwrapping a video in bands
diff --git a/apps/CentralStandard/src/Video/VideoView.cpp b/apps/CentralStandard/src/Video/VideoView.cpp
index c0c574e..750afab 100644
--- a/apps/CentralStandard/src/Video/VideoView.cpp
+++ b/apps/CentralStandard/src/Video/VideoView.cpp
@@ -13,7 +13,7 @@ using namespace bluecadet::utils;
namespace bluecadet {
namespace views {
-VideoView::VideoView() {
+VideoView::VideoView() : mDrawMode(DrawMode::Normal) {