Skip to content

Instantly share code, notes, and snippets.

Eirik Brandtzæg eirikb

Block or report user

Report or block eirikb

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
@eirikb
eirikb / mdl-vue.js
Last active May 24, 2017
Add MDL to all elements with "mdl-js"-class in Vue
View mdl-vue.js
import 'material-design-lite'
Vue.mixin({
mounted() {
if (!this.$el || !this.$el.querySelectorAll) return;
componentHandler.upgradeElement(this.$el);
for (const el of this.$el.querySelectorAll('[class*=mdl-js-]')) {
if (!el.dataset.upgraded) {
componentHandler.upgradeElement(el);
@eirikb
eirikb / main.js
Created Apr 26, 2017
MDL in Vue2 hack
View main.js
import Vue from 'vue';
import 'material-design-lite';
Vue.mixin({
mounted() {
for (const el of this.$el.querySelectorAll('[class*=mdl-js-]')) {
if (!el.dataset.upgraded) {
componentHandler.upgradeElement(el);
}
}
@eirikb
eirikb / Chart.vue
Created Apr 26, 2017
Chart.js in Vue2
View Chart.vue
<template>
<canvas ref="chart"></canvas>
</template>
<script>
import chart from 'chart.js'
export default {
props: ['options', 'data'],
@eirikb
eirikb / App.vue
Last active Jan 10, 2019
Add MDL to Vue
View App.vue
<style lang="scss">
@import "~material-design-lite/material.css";
</style>
View readme.md
npm i
npm start

Result:
Result

View vuetwo.md

vuetwo

Proof of concept library for building vue apps.
Basically a hacked together wrapper around rollup + rollup-watch with predefined setup.
vue template plugin is a slightly modified version of the new vue-template-compiler.

@eirikb
eirikb / vuetwo.md
Last active Jul 28, 2016
vuetwo - demo
View vuetwo.md

vuetwo demo

Proof of concept vue for the lazy

Usage

  1. Download zip
  2. npm install
  3. npm start
@eirikb
eirikb / demo.md
Last active Jan 28, 2017
Demo of clicktest.sh
View demo.md

#Demo

##About The demo is meant to show how to make an automated answer to a hn comment, translated from Norwegian to English with these steps:

  1. Click on Chrome address bar.
  2. Type translate.google.com and press enter.
  3. Click on input field.
  4. Type the text for translation and wait for it to translate.
@eirikb
eirikb / clicktest.md
Last active Jun 14, 2018
Automated click testing in bash
View clicktest.md

About

This is a bash script, as an example, on how to do click-testing GUI based on finding components based on how they look.

Dependencies

You can’t perform that action at this time.