Skip to content

Instantly share code, notes, and snippets.

@simenbrekken
simenbrekken / index.html
Created November 22, 2017 06:54
Field-error-handling
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta -->
<meta charset="UTF-8" />
<title>My New Pen!</title>
<!-- Styles -->
<link rel="stylesheet" href="style.css">
@simenbrekken
simenbrekken / firebase-decorator-api.jsx
Last active December 16, 2015 09:04 — forked from danielmahal/firebase-decorator-api.jsx
Firebase decorator api
// Alternative 1
// One function at top-level that returns whatever it needs.
// Can be run multiple times, and return different things
@firebase(props => {
if (!props.projectIndex) {
return {
projectIndex: `users/${props.authId}/projects`,
};
}
@simenbrekken
simenbrekken / echoHttpRequest.js
Last active September 7, 2015 03:32 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
console.log("Console messages are sent to /logs");
console.log(hook.params);
console.log(hook.req.path);
console.log(hook.req.method);
@simenbrekken
simenbrekken / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
var DeliveryAddress = React.createClass({
render: function() {
var presets,
newAddress
if(this.props.user) {
presets = <RadioGroup handleChange={this.changePreset}>
<Radio name="deliveryPreset" key="2" checked>John Doe</Radio>
<Radio name="deliveryPreset" key="new">Other address</Radio>
</RadioGroup>