This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Author: Murphy Randle | |
Just a very simple shallow water simulation. | |
Heavily helped by code from: Paul Lewis: http://aerotwist.com/ | |
*/ | |
var cam, scene, renderer, geo, mesh, mat, projector, grid; | |
// Params to change simulation: | |
var gridWidth = 65; | |
var gridRes = 58; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dict = ["a", "s", "d", "f"] | |
itoa = function (n) { | |
retstr = "" | |
while (n !== 0) { | |
digit = dict[(n % (dict.length + 1)) - 1] | |
retstr = digit + retstr | |
n = Math.floor(n / dict.length) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set up font: | |
self.fontDB = QtGui.QFontDatabase() | |
self.fontDB.addApplicationFont(":/resources/Bariol_Regular.otf") | |
self.setFont(QtGui.QFont("Bariol", 18)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open React; | |
let onChangeText = (updator, event) => { | |
let v = ReactEvent.Form.target(event)##value; | |
updator(_ => v); | |
}; | |
[@react.component] | |
let make = () => { | |
// State |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[@bs.module] external bent('headers, 'response) : ( | |
~method: @bs.string] [ | |
| `GET | |
| `POST | |
| `PUT | |
| `DELETE | |
], | |
~format: [@bs.string] [ | |
| `string | |
| `buffer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// These types enhance safety around binary data that we want to synthesize onto | |
// a record, but store in S3 instead of in Postgres. If the encoder for the | |
// wrapping type requires that a field has a type of `S3Data.Outgoing.t`, then | |
// the type system will ensure that the data has been loaded up from S3 before | |
// it gets sent back to the user. In the same way, if the wrapping type uses | |
// `Incoming.t` at the API layer, and just `t` at the database layer, then the | |
// type system ensures that some action has been taken to save the binary to S3 | |
// before writing to the database. | |
module Saved = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"keymap": [ | |
{ | |
"keyCode": 41, | |
"label": "Esc" | |
}, | |
{ | |
"keyCode": 30, | |
"label": "1" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type pomWithError('data, 'err) = Js.Promise.t(Result.t('data, 'err)); | |
type pom('data) = pomWithError('data, unit); | |
module JsPromise = { | |
let make = () => { | |
let resolver = ref(ignore); | |
let p = | |
Js.Promise.make((~resolve, ~reject as _) => | |
resolver := (a => resolve(. a)) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Alternative migration path for JSX 2 to JSX 3 Reason React | |
https://bloodyowl.github.io/blog/2019-04-19-an-alternative-migration-path-for-reason-react/ | |
https://github.com/bloodyowl/reason-react-update | |
https://bloodyowl.github.io/blog/2019-01-24-orchestrating-requests-at-component-level/ | |
This migration was really slick. We just ran it on the files we needed migrated (you can’t just pass files as args to the executable, you’ve got to pipe the names in) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Gift = | |
Email_Template.Make({ | |
let name = "gift"; | |
type data = { | |
quantity: int, | |
total: string, | |
year: int, | |
code: string, | |
}; |
NewerOlder