Skip to content

Instantly share code, notes, and snippets.

@joshhunt
joshhunt / .babelrc
Last active August 29, 2015 14:27
Babel test repo
{
"stage": 0
}
/* eslint-disable */
var path = require('path');
var _ = require('underscore');
var CLIENT_ENTRY = './src/client/index.js';
var SERVER_ENTRY = './src/server/index.js';
var HOST = '__fill_in_host__';
var PORT = '__fill_in_port__';
@joshhunt
joshhunt / genreView.js
Last active November 30, 2015 04:22
Routing in TVML app using Page.js
import genreTemplate from 'templates/genre.tvml.jade';
import get from 'lib/api/get';
import tvOS from 'lib/tvOS';
export default function tvSeriesView({params}) {
get(`/genres/${params.genreSlug}`).then((viewData) => {
const doc = genreTemplate(viewData);
tvOS.pushDocument(doc);
});
}
@joshhunt
joshhunt / index.js
Last active August 29, 2017 07:45
Socket.io live reload for Apple TV TVML app
import 'babel-polyfill';
import firstView from 'views/first';
import * as liveReload from 'lib/liveReload';
App.onLaunch((launchOptions) => {
firstView();
liveReload.connect(launchOptions);
});
@joshhunt
joshhunt / .tmux
Last active December 8, 2015 02:43
configs
#
# -- Init -------------------------------------------------
#
# Set proper character encoding
set -g utf8
set -g status-utf8 on
set-window-option -g utf8 on
# Make tmux display things in 256 colors
@joshhunt
joshhunt / .babelrc
Last active December 9, 2015 06:24
Babel Arrow Function bug
{
"presets": ["es2015", "stage-0"]
}
@joshhunt
joshhunt / webpackLog.txt.js
Last active January 3, 2016 06:18
Webpack Extract Text log spam
[ { test: /\.(styl)$/,
loaders:
[ '/project/node_modules/extract-text-webpack-plugin/loader.js?{"omit":0,"extract":true,"remove":true}',
'css-loader?modules&importLoaders=2&sourceMap&localIdentName=[path]--[local]---[hash:base64:5]',
'autoprefixer?browsers=last 2 version',
'stylus' ] },
{ test: /\.(css)$/,
loaders:
[ '/project/node_modules/extract-text-webpack-plugin/loader.js?{"omit":0,"extract":true,"remove":true}',
'css-loader' ] } ]
@joshhunt
joshhunt / WriteManifestPlugin.js
Created March 11, 2016 00:19
Webpack asset manifest plugin
import fs from 'fs';
import path from 'path';
import mkdirp from 'mkdirp';
import noop from 'lodash/noop';
import groupBy from 'lodash/groupBy';
import reduce from 'lodash/reduce';
const BACK_TO_ROOT = path.resolve(__dirname, '../../../');
const getAssetsByChunk = (webpackData, publicPath) => {
onPanResponderRelease: (e, gestureState) => {
this.props.dismissVal.flattenOffset();
if (gestureState.dy > 100) {
this.lolActuallyClose(gestureState);
} else {
// Spring back
Animated.spring(this.props.dismissVal, {
toValue: 0
}).start();
mkdir work
# Generate the project file. Note -f, the hFOV of 81.27 degrees
pto_gen *.JPG -o work/project.pto -f 81.27
# Find the control points between the images - what to align with
cpfind --fullscale --multirow -o work/cpPoints.pto work/project.pto
# Remove junk control points from the sky
celeste_standalone -i work/cpPoints.pto -o work/cpPointsCleaned.pto -d ~/Dropbox/DRONE/data/celeste.model