Skip to content

Instantly share code, notes, and snippets.

View fdesjardins's full-sized avatar
馃尨
Working from home

Forrest Desjardins fdesjardins

馃尨
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am fdesjardins on github.
  • I am fdesjardins (https://keybase.io/fdesjardins) on keybase.
  • I have a public key ASD_x8N6Q47cOpR-SXUE0YcfqUGdbwFvaYf5v5DWqHra_Qo

To claim this, I am signing this object:

@fdesjardins
fdesjardins / image-pyramids.m
Created May 14, 2019 19:19
image-pyramids.m
function [g_pyramid, l_pyramid] = pyramids(img, N)
% pyramids(N)
% Generates gaussian and laplacian pyramids of image
% described by location img to level N.
im1 = double(imread(img));
im1g = double(repmat(rgb2gray(imread(img)),[1 1 3]));
radius = 3;
sigma0 = 1;
@fdesjardins
fdesjardins / walter
Created January 25, 2019 00:51
walter
DataSource {
id: myDataSource
driver: MSSQL
server: myServerAddress
username: myDomain\myUsername
password: myPassword
initial_catalog: myDataBase
trusted_connection: true
integrated_security: SSPI
}
const defaultConfig = require('./config')()
const hue = require("node-hue-api")
module.exports = (config = defaultConfig) => {
return new hue.HueApi(config.hue.host, config.hue.username)
}
@fdesjardins
fdesjardins / utils.js
Created June 6, 2017 18:12
Hue utils
const hue = require("node-hue-api")
const k2rgb = require('kelvin-to-rgb')
const log = require('./log')()
exports.setTempK = (api, lamp, tempK, brightness) => {
log.debug(`setTempK:lamp ${lamp}:tempK ${tempK}:brightness ${brightness}`)
const state = hue.lightState.create()
.on()
.rgb(...k2rgb(tempK))
@fdesjardins
fdesjardins / fire.js
Created June 5, 2017 20:55
Phillips hue, arson, etc.
const k2rgb = require('kelvin-to-rgb')
const utils = require('./utils')
const api = require('./api')()
const log = require('./log')()
const shiftDistribution = x => x < 0.5 ? 2 * x : 2 * (1 - x)
const sample = () => shiftDistribution(Math.random())
{
"documents": {
"terminalProcedures": [
[
{
"name": "A/FD HOT SPOT (PDF)",
"type": "AHS",
"url": "http://aeronav.faa.gov/afd/27Apr2017/ak_hotspot.pdf"
},
{
[
{
"state": "AK",
"city": "ANCHORAGE",
"airport": "TED STEVENS ANCHORAGE INTL",
"ident": "ANC (PANC)",
"vol": "N/A",
"flag": "",
"type": "AHS",
"procedure": {
#!/bin/sh
CHARTS=/home/forrest/Workspace/rdi/FAA-WeatherCameraApp/services/database/resources/CanadianAirportCharts_Current.pdf
echo "reading in master list of charts..."
CHARTS_CONTENT=$(pdftotext $CHARTS -)
while read p; do
echo "searching for $p..."
page=$(echo $CHARTS_CONTENT | awk -vRS='\f' -vNAME="$p-AD" 'index($0,NAME){printf "%d\n", NR;}' | head -n 1)
if [ $page ] ; then
echo "extracting page $page...";
pdftk $CHARTS cat $page output ./canadian-airport-charts/$p.pdf;
var cornell_box = function(){
var lines = [
'(initgl)',
'(var plane)',
'(var torus)',
'(var sphere)',
'(var s)',
'(var cam (new-cam))',
'(load-OBJ (quote plane))',
'(load-OBJ (quote torus))',