Skip to content

Instantly share code, notes, and snippets.

Avatar

Damon Oehlman DamonOehlman

View GitHub Profile
@DamonOehlman
DamonOehlman / .bithoundrc
Created Mar 18, 2015
My default .bithoundrc file
View .bithoundrc
{
"ignore": [
"**/node_modules/**",
"**/dist/**",
"**/examples/**",
"**/test/**",
"**/Gruntfile.js",
"**/gulpfile.js"
]
}
@DamonOehlman
DamonOehlman / README.md
Last active Apr 24, 2018
Using nginx to proxy HTTPS to local non HTTPS servers
View README.md

An nginx configuration that can be added to your /etc/nginx/sites-enabled directory to proxy from the local nginx server through to other servers running on other ports. Primarily this is useful when you want to view a site using HTTPS but don't want to associate the certificate with that local server.

The following proxys work:

http://localhost/ => http://localhost:9966/
https://localhost/ => http://localhost:9966/

https://localhost/<port>/ => http://localhost:<port>/
https://localhost/<port>/ => http://localhost:<port>/
@DamonOehlman
DamonOehlman / index.js
Created Feb 23, 2015
requirebin sketch
View index.js
var console = require('demo-console');
var freeice = require('freeice');
var quickconnect = require('rtc-quickconnect');
var opts = {
room: 'qcexample-dctest',
// debug: true,
iceServers: freeice()
};
quickconnect('https://switchboard.rtc.io/', opts)
@DamonOehlman
DamonOehlman / index.js
Created Feb 11, 2015
requirebin sketch
View index.js
var quickconnect = require('rtc-quickconnect');
var mesh = require('rtc-mesh');
var console = require('demo-console');
// initialise the connection
var qc = quickconnect('https://switchboard.rtc.io/', {
room: 'meshdemo-simple'
});
// create the model
@DamonOehlman
DamonOehlman / Makefile
Created Dec 7, 2014
A simple makefile to process a number of input png files into ebook optimised pdf files in a dist directory.
View Makefile
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 / screenshot.js
Created Nov 14, 2014
Youtube -> Imgur Screenshot Helper (copy and paste into your browser console when on a video site)
View screenshot.js
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]
});
//Send the proper header information along with the request
@DamonOehlman
DamonOehlman / README.md
Created Nov 11, 2014
Testing with Buildbox.io and Docker
@DamonOehlman
DamonOehlman / index.js
Last active Aug 29, 2015
requirebin sketch
View index.js
var media = require('rtc-media');
var quickconnect = require('rtc-quickconnect');
var getUserMedia = require('getusermedia');
var attachmedia = require('attachmediastream');
var config = {
iceServers: require('freeice')(),
room: 'faq-changestream',
reactive: true
};
@DamonOehlman
DamonOehlman / index.js
Created Sep 15, 2014
requirebin sketch
View index.js
var getUserMedia = require('getusermedia');
var attach = require('attachmediastream');
var constraints = { audio: true, video: true };
getUserMedia(constraints, function(err, stream) {
if (err) {
return;
}
document.body.appendChild(attach(stream, null, {
View keybase.md

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: