Skip to content

Instantly share code, notes, and snippets.

View DamonOehlman's full-sized avatar

Damon Oehlman DamonOehlman

View GitHub Profile
@DamonOehlman
DamonOehlman / Makefile
Created December 7, 2014 13:56
A simple makefile to process a number of input png files into ebook optimised pdf files in a dist directory.
inputfiles = $(patsubst %.png,dist/%.pdf,$(wildcard *.png))
rebuild: clean build
build: prepare $(inputfiles) postbuild
dist/%.pdf:
@convert $(patsubst dist/%.pdf,%.png,$@) tmp/$@
@gs -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -sOutputFile=$@ tmp/$@
@rm tmp/$@
@DamonOehlman
DamonOehlman / PAGE-SCRIPTS.md
Last active July 30, 2021 01:34
Interesting webpage injection scripts

Youtube -> Imgur Screenshot Helper (copy and paste into your browser console when on a video site)

var clientId = ''; // insert your imgur application client id here
var videos = document.getElementsByTagName('video'), canvas = document.createElement('canvas'), context = canvas.getContext('2d'), http = new XMLHttpRequest();
canvas.width = videos[0].videoWidth; canvas.height = videos[0].videoHeight;
context.drawImage(videos[0], 0, 0);

var data = JSON.stringify({
  image: canvas.toDataURL('image/jpeg', 0.9).split(',')[1]

Keybase proof

I hereby claim:

  • I am damonoehlman on github.
  • I am damon (https://keybase.io/damon) on keybase.
  • I have a public key whose fingerprint is 1B42 BE6F C898 1A15 C4EC 60E8 C339 3670 6647 3070

To claim this, I am signing this object:

@DamonOehlman
DamonOehlman / README.md
Created August 5, 2014 11:25
Ideas for getting WebRTC running on embedded devices
@DamonOehlman
DamonOehlman / index.js
Created August 4, 2014 10:11
requirebin sketch
var quickconnect = require('rtc-quickconnect');
var randomName = require('random-name');
var opts = {
room: 'quickconnect-demo-chat-room',
iceServers: require('freeice')()
};
quickconnect('http://switchboard.rtc.io', opts)
.createDataChannel('chat')
.on('channel:opened:chat', function(id, dc) {
@DamonOehlman
DamonOehlman / README.md
Last active August 29, 2015 14:03
IN PROGRESS: Connecting Standard Components to LEGO Technic
@DamonOehlman
DamonOehlman / README.md
Created July 10, 2014 12:07
IN PROGRESS: Installation of node-webrtc on an Intel Galileo board

I'm working from the Intel IOT Developer Kit as a starting point and created an SD image using the provided 200Mb zipped image:

http://iotdk.intel.com/images/iot-devkit-201402201605-mmcblkp0.direct.bz2

This can be installed onto an SD card through decompressing the file and using the dd utility. If you are unfamiliar with the process, then search around for some info as there is plenty out there on how to do this.

Set the Time

The baseline image for the Intel IOT Developer Kit does not include an ntp client so you will need to set this manually for the time being. The format is a little strange (MMDDhhmmYYYY.ss) so something like the following will work:

var Polygon = require('polygon');
var fc = require('fc');
var Vec2 = require('vec2');
var ndarray = require('ndarray');
var sn = require('surface-nets');
var cwise = require('cwise');
var fill = require('ndarray-fill');
var poly = new Polygon([
@DamonOehlman
DamonOehlman / index.js
Created June 4, 2014 10:42
requirebin sketch
// require the media capture helper from rtc.io
var media = require('rtc-media');
// capture the local media, letting rtc-media know it can use
// the temasys plugin
var localMedia = media({
plugins: [
require('rtc-plugin-temasys')
]
});