This file contains hidden or 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
import qs from "qs"; | |
import { useEffect, useMemo, useState } from "react"; | |
import { useRouter } from "../routing"; | |
const identity = a => a; | |
const defined = a => typeof a !== "undefined"; | |
const fromQueryString = query => qs.parse(query, { ignoreQueryPrefix: true }); | |
const toQueryString = object => qs.stringify(object, { addQueryPrefix: true }); | |
export default function useQueryParam( |
This file contains hidden or 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
// ---- | |
// Sass (vundefined) | |
// Compass (vundefined) | |
// dart-sass (v1.6.2) | |
// ---- | |
.foo { | |
color: blue; | |
& > .bar { color: red; } | |
} |
This file contains hidden or 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
/*global ReactDOM, flyd*/ | |
// -- Utility code | |
const nestUpdate = (update, prop) => func => | |
update(model => ({ ...model, [prop]: func(model[prop]) })); | |
const nest = (create, update, prop) => { | |
const component = create(nestUpdate(update, prop)); | |
const result = { ...component }; |
This file contains hidden or 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
const keyChange = (oldProps, newProps, propsHandlersMap = {}) => | |
R.forEachObjIndexed((handler, keysString) => { | |
const keys = keysString.split(','); | |
if (!R.equals(R.pick(keys)(oldProps), R.pick(keys)(newProps))) { | |
handler(newProps); | |
} | |
})(propsHandlersMap); | |
// This little baby will(combined with those R utility functions) help | |
// reduce your componentWillReceiveProps methods like so: |
This file contains hidden or 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
const albums = new ReactiveVar([]); | |
export default createContainer(() =>{ | |
HTTP.get('https://graph.facebook.com/' + this.props.clubId + "/albums?fields=id,name" + token, function(err, resp) { | |
albums.set(resp.data.data.map(c => <a key={c.id} href={'../gallery/' + c.id}>{c.name}</a>)) | |
}); | |
return {albums : albums.get()}; | |
}, App); |
This file contains hidden or 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
const albums = new ReactiveVar([]); | |
export default createContainer(() =>{ | |
HTTP.get('https://graph.facebook.com/' + this.props.clubId + "/albums?fields=id,name" + token, function(err, resp) { | |
albums.set(resp.data.data.map(c => <a key={c.id} href={'../gallery/' + c.id}>{c.name}</a>)) | |
}); | |
return {albums : albums.get()}; | |
}, App); |
This file contains hidden or 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 gulp = require('gulp'); | |
var babel = require('gulp-babel'); | |
var sass = require('gulp-sass'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var sourcemaps = require('gulp-sourcemaps'); | |
var cssnano = require('gulp-cssnano'); | |
var livereload = require('gulp-livereload'); | |
var uglify = require('gulp-uglify'); | |
var requirejsOptimize = require('gulp-requirejs-optimize'); |
This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am klarstrup on github. | |
* I am klarstrup (https://keybase.io/klarstrup) on keybase. | |
* I have a public key whose fingerprint is 9129 7D8F BCB7 5415 EFB3 E745 FB89 | |
498E 9466 6C27 | |
To claim this, I am signing this object: |