Skip to content

Instantly share code, notes, and snippets.

View kristianmandrup's full-sized avatar

Kristian Mandrup kristianmandrup

  • Freelancer
  • Copenhagen
View GitHub Profile
@kristianmandrup
kristianmandrup / app-alt.ts
Last active August 1, 2016 22:31
Indexable routes
// alternative way
ChildRouteLocator.prototype.convertInstructionToConfigurationUrl = (instruction) => {
};
@kristianmandrup
kristianmandrup / React Reactive Component Styles.md
Last active March 31, 2016 14:28
Reactive Component Styles for React
export default Styles {
    constructor(props, state) {
        this.props = props;
        this.state = state;
        this.createGeneric()
    }

    generic() {
        return [];
@kristianmandrup
kristianmandrup / aurelia-started.md
Last active February 22, 2017 16:15
Aurelia Getting started - walk through

Aurelia

Recipe

  • Install NVM
  • Install IO.js
  • Install global Node.js utility modules (gulp, jspm, yo)
  • Install RethinkDB
  • Install Koa.js
  • Install Aurelia generator
  • Create Aurelia app via generator
@kristianmandrup
kristianmandrup / designer.html
Last active August 29, 2015 14:10
designer
<link rel="import" href="../ace-element/ace-element.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<polymer-element name="my-element">
<template>
<style>
@kristianmandrup
kristianmandrup / mercury-macro.sjs
Last active August 29, 2015 14:09
Mercury macro
Trying to get from sth like:
'<cmp:sideBySideEditor />'
// '<div><cmp:MdEditor state="sideBySideEditor"/></div>'
And have the macro output:
"sideBySideEditor.render(state.sideBySideEditor)"
// "h('div', MdEditor.render(state.sideBySideEditor))",
@kristianmandrup
kristianmandrup / package.json
Created October 2, 2014 12:46
Ember-CLI package config for jspm integration :)
"jspm": {
"directories": {
"jspmPackages": "vendor"
},
"configFile": "config/jspm.js",
"dependencies": {
"handlebars": "handlebars.js@1.3.0",
"jquery": "^1.11.0",
"qunit": "github:jquery/qunit@^1.12.0",
"ember-qunit": "github:rwjblue/ember-qunit@0.1.5",
@kristianmandrup
kristianmandrup / Converting libraries to Ember CLI addons.md
Last active April 21, 2023 17:14
Guide to Developing Addons and Blueprints for Ember CLI

Converting libraries to Ember CLI addons

In this guide we will cover two main cases:

  • Ember specific library
  • vendor library

Ember library

The Ember library will assume that Ember has already ben loaded (higher in the loading order) and thus will assume it has access to the Ember API.

@kristianmandrup
kristianmandrup / DSL-usage.js
Last active August 29, 2015 14:06
Ember DSL idea for ES6 modules
# models/post.js
import model from 'model-dsl'
Post = model
title: attr('string')
count: attr('integer')
# controllers/post.js
@kristianmandrup
kristianmandrup / AppjsEmber.md
Created September 18, 2014 23:11
Using AppJs Mobile framework with Ember.js

Usage

$ bower install appjs --save

Reference app.js and app.css from your application, f.ex from index.html

<script type="text/javascript" src="/bower_components/appjs/kik-app.js"></script>
<script type="text/javascript" src="/bower_components/appjs/dist/app.css"></script>
@kristianmandrup
kristianmandrup / ember-ratchet-components.txt
Last active August 29, 2015 14:06
Experiments with Ember Ratchet components
// From http://goratchet.com/components/
<script type="text/x-handlebars" id="components/ra-title">
<h1 class="title">{{yield}}</h1>
</script>
<script type="text/x-handlebars" id="components/ra-btn">
<button class="btn pull-{{pos}}">
{{yield}}