Skip to content

Instantly share code, notes, and snippets.

Patrik Johnson orbitbot

  • Helsinki, Finland
Block or report user

Report or block orbitbot

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 Flems for mithril blog testing
orbitbot / lenses-chat.txt
Last active Mar 15, 2017
the Mithril dialogues - insightful exchanges in the chatroom
View lenses-chat.txt
dontwork @dontwork Feb 07 12:22
export function getUserFormData() {
var form = Object.assign({}, store.getState().users.form)
return form
that should return a copy of the form object right
Magnus Leo @magnusleo Feb 07 12:37
Object.assign is not available in IE11 if you must support that.
orbitbot / utils.js
Created Jan 11, 2017
Set object property util, for convenience with mithril.js m.withAttr
View utils.js
const set = (obj, prop, modify = (v) => v) => (value) => obj[prop] = modify(value)
exports default set
orbitbot / http.js
Last active May 26, 2017
Ergonomic Mithril.js 1.x requests
View http.js
// data becomes querystring on GET requests
class Http {
constructor() {
let methods = ['get', 'post', 'put', 'patch', 'delete', 'head', 'options']
methods.forEach((method) => {
this[method] = (url, data, opts) => m.request(Object.assign({ method, url, data }, opts, this.eval(), this.defaults))
orbitbot / breadcrumbs.js
Created Aug 4, 2016 — forked from WreckedAvent/breadcrumbs.js
basic data flow example
View breadcrumbs.js
import * as m from 'mithril'
// this is a "presentation" component and knows nothing about the world
export const view = (_, { link }) => m('.nav', m('.breadcrumbs', [
m('a', { href: link })
orbitbot / 404.html
Created May 14, 2016
GH Pages SPA hack
View 404.html
sessionStorage.redirect = location.href;
<meta http-equiv="refresh" content="0;URL=''"></meta>
orbitbot / .gitignore
Last active Nov 15, 2015
karma-electron-launcher issue with require
View .gitignore
orbitbot / .gitignore
Last active Nov 9, 2015
karma-electron-launcher require fails example
View .gitignore
orbitbot / app.js
Created Oct 31, 2015 — forked from ilsenem/app.js
Mithril Dependency Injector #.editorconfig
View app.js
// Example
// app.js
document.addEventListener("DOMContentLoaded", function (e) {
m.route.mode = "hash";
m.route(document.getElementById("application"), "/", {
"/": m.resolve("pages.home"),
"/findus": m.resolve("pages.findus")
orbitbot / index.html
Created Oct 30, 2015
Autoload js script stored in localStorage
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
You can’t perform that action at this time.