Skip to content

Instantly share code, notes, and snippets.

View scottgwald's full-sized avatar

Scott W. Greenwald scottgwald

View GitHub Profile
@scottgwald
scottgwald / README.md
Created February 15, 2016 20:40
bash examples that illustrate use of various constructs

README

asdf

@scottgwald
scottgwald / glass.html
Last active November 14, 2015 04:33
[wearscript] Light Sensor
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
@scottgwald
scottgwald / glass.html
Last active November 14, 2015 04:14
[wearscript] minimal camera image streaming on/off
<html style="width:100%; height:100%; overflow:hidden">
<head>
<!-- You can include external scripts here like so... -->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/zepto/1.0/zepto.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.5.2/underscore-min.js"></script>-->
</head>
<body style="width:100%; height:100%; overflow:hidden; margin:0" bgcolor="#000">
<canvas id="canvas" width="640" height="360" style="display:block"></canvas>
<script>
@scottgwald
scottgwald / .gitignore
Last active December 13, 2019 16:11
basic node-redis blocking push/pop
/node_modules
@scottgwald
scottgwald / myip.sh
Last active August 29, 2015 14:27
get ip address on local 192 network (cross-platform is TODO, mac os x for now)
#! /bin/bash
ipline=$(ifconfig | grep inet | grep " 192")
ip=$(echo $ipline | sed 's/inet \([^ ]*\).*/\1/g')
echo $ip

Installing PDFtk Server edittion on your Mac

Edit by scottgwald: run
./pdftk-install.sh

To do everything described below in one fell swoop.

@scottgwald
scottgwald / requirements.txt
Last active November 10, 2017 22:24
wmctrl in python
gevent
wmctrl
@scottgwald
scottgwald / app.py
Created August 14, 2014 00:06 — forked from saghul/app.py
import os
from autobahn.resource import WebSocketResource, WSGIRootResource
from autobahn.websocket import WebSocketServerFactory, WebSocketServerProtocol
from flask import Flask, render_template
from twisted.application import internet, service
from twisted.internet import reactor
from twisted.python.threadpool import ThreadPool
from twisted.web.server import Site
@scottgwald
scottgwald / glass.html
Created July 30, 2014 22:03
[wearscript] update Media syntax
<html style="width:100%; height:100%; overflow:hidden">
<body style="width:100%; height:100%; overflow:hidden; margin:0">
<script>
function main() {
if (WS.scriptVersion(1)) return;
WS.cameraVideo(function (x) {
setTimeout(function () {
new WS.Media('file://' + x, false);
}, 5000);
});