Skip to content

Instantly share code, notes, and snippets.

@alexbepple
alexbepple / index.js
Last active November 2, 2018 12:46
Background image and scrollview on React Native, based on http://stackoverflow.com/questions/35013573
import React, {AppRegistry, Text, View, Dimensions, ScrollView, Image} from 'react-native'
const window = Dimensions.get('window')
const imageDimensions = {
height: window.height,
width: window.width
}
var SampleApp = React.createClass({
render: function () {
@alexbepple
alexbepple / index.md
Last active April 25, 2016 14:32
Notes for session "Ramda: a functional utility belt" at JSUnconf 2016

Keybase proof

I hereby claim:

  • I am alexbepple on github.
  • I am alexbepple (https://keybase.io/alexbepple) on keybase.
  • I have a public key ASBdw56lzV7h9ZxALGF8lnRCN9yMtP57Dk2PuIWkARvSAgo

To claim this, I am signing this object:

@alexbepple
alexbepple / deckset.md
Last active April 22, 2018 09:26
Simple reactive programming with S.js

autoscale: true

Simple reactive programming with S.js

Alex Bepple


Getting started with S.js

@alexbepple
alexbepple / index.md
Last active May 29, 2018 22:38
Stricter stubs for better dev experience

Most modern test-double libraries create stubs with default behavior. Now, if the code under test uses the stub differently, the test will fail late  – and even more importantly with an error that might be hard to interpret. Strict stubs help to avoid this problem and thus provide a better experience. testdouble-only-when is a helper for strict stubs for use with testdouble.js.


What's the problem, again?

Most stubs come with a default behavior. In Java land, Mockito stubs return null, false, etc. when no specific behavior has been rehearsed for the call. In JavaScript land, both testdouble.js stubs and Sinon stubs return undefined, if you call them in unrehearsed fashion.

LP solvers in JS
jsLPSolver, https://github.com/JWally/jsLPSolver, https://www.npmjs.com/package/javascript-lp-solver
++ no trouble whatsoever with 10000 constraints, however I got tired of waiting for 20000 (multiple minutes)
there is quite a lot on optimizing the problem formulation at http://lpsolve.sourceforge.net/5.5/lp-format.htm
SOS (special ordered sets) look interesting: http://lpsolve.sourceforge.net/5.5/SOS.htm
https://www.npmjs.com/package/simple-simplex
! violated constraints in some instances
-- cumbersome that all variables have to be named everywhere
https://www.npmjs.com/package/simplex-solver
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alexbepple
alexbepple / # ask-cli - 2019-01-27_19-13-35.txt
Created January 27, 2019 18:19
ask-cli on macOS 10.14.2 - Homebrew build logs
Homebrew build logs for ask-cli on macOS 10.14.2
Build date: 2019-01-27 19:13:35