Skip to content

Instantly share code, notes, and snippets.

Mel van Londen mvanlonden

Block or report user

Report or block mvanlonden

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View insulation_cost.py
labor_factor = .15
insulation_cost = 2 # per surface sqft
surface_area = width * length * 2 + length * height * 2 + height * width * 2
cost = surface_area * insulation_cost * (1 + labor_factor)
View glazing_cost.py
labor_factor = .13
window_cost = 1600
sliding_door_cost = 10000
window_spacing = 15 # ft per window
windows = perimeter / window_spacing * stories
sliding_doors_per_story = 2
sliding_doors = stories * sliding_doors_per_story
@mvanlonden
mvanlonden / structural_cost.py
Last active Feb 3, 2019
Structural system cost
View structural_cost.py
floor_columns = (width / floor_column_grid_spacing) * \
(length / floor_column_grid_spacing)
columns = floor_columns * stories + \
(width / roof_column_grid_spacing) * (length / roof_column_grid_spacing)
columns_length = columns * ceiling_height
beams = length / joist_spacing * (stories + 1)
beams_length = beams * width
structural_framing_cost = (decking_cost * decking_area + column_cost * columns_length +
View keybase.md

Keybase proof

I hereby claim:

  • I am mvanlonden on github.
  • I am mvanlonden (https://keybase.io/mvanlonden) on keybase.
  • I have a public key ASBgC1OymRWNqsU0aOM-24v6zMujo6UCgRdm7ykMDLvAAAo

To claim this, I am signing this object:

@mvanlonden
mvanlonden / prerenderPersistStorage.js
Created Aug 27, 2017
Combines prender.cloud and redux-persist to rehydrate your redux state. Use as your redux-persist storage.
View prerenderPersistStorage.js
import storage from 'redux-persist/es/storage'
const isPrerendering = window.prerenderCloudIsServerSideRendering
export default {
getItem: (key, cb) => {
storage.getItem(key, (err, item) => {
if (err) {
return cb(err)
}
@mvanlonden
mvanlonden / withForm.js
Last active Oct 3, 2017
React HOC for form submission
View withForm.js
import { isArray, keys, isEmpty, values } from 'lodash'
import { compose, curry, map, mapValues, mergeWith, get, pickBy, set, pick, every } from 'lodash/fp'
import { withState, mapProps } from 'recompose'
const makePredicate = ([test, errorMsg]) => a =>
test(a) ? null : errorMsg
const makePredicates = map(makePredicate)
const runPredicates = ({ input, validations }) =>
View Refactor promise to async await
function moveModuleIntoBoard(module, board) {
return new Promise((resolve, reject) => {
const mutation = `
{
moveModuleToBoard(input: {
clientMutationId: "${new Date().getTime()}",
boardId: "${board.id}",
moduleId: "${module.id}"
}) {
viewer {
View Error Log Docker
Successfully built c7bc39858b1f
➜ occamz-razor-dev-env OC-31_docker_dev_environment_a_new_hope ✓
➜ occamz-razor-dev-env OC-31_docker_dev_environment_a_new_hope ✓ docker-compose up
Creating occamzrazordevenv_sync_client_1
Creating occamzrazordevenv_sync_api_1
Creating occamzrazordevenv_client_1
Creating occamzrazordevenv_test_api_1
Creating occamzrazordevenv_api_1
Creating occamzrazordevenv_test_client_1
Attaching to occamzrazordevenv_sync_client_1, occamzrazordevenv_sync_api_1, occamzrazordevenv_client_1, occamzrazordevenv_test_api_1, occamzrazordevenv_api_1, occamzrazordevenv_test_client_1
@mvanlonden
mvanlonden / index.html
Created May 30, 2014
Panning within a perspective
View index.html
<!DOCTYPE HTML>
<html>
<head>
<title>famo.us App</title>
<meta name="viewport" content="width=device-width, maximum-scale=1, user-scalable=no" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- shims for backwards compatibility -->
@mvanlonden
mvanlonden / demo.html
Created Oct 17, 2013
jquery-svgpandragsnap
View demo.html
<!DOCTYPE HTML>
<html>
<head>
<!-- jQuery -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- d3 -->
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
You can’t perform that action at this time.