Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Renoir Boulanger renoirb

View GitHub Profile
View render-helpers.js
/**
* Copy-Pasta from Vue.js transpiled source (!).
*
* NOT TO USE, just to point out cool parts.
*
* https://github.com/vuejs/vue/blob/2.6/dist/vue.runtime.esm.js
*/
import {
extend,
@renoirb
renoirb / hooks-index.js
Last active Nov 15, 2018
Nuxt 'render:setupMiddleware' hook example
View hooks-index.js
// file: hooks/index.js
import render from './render'
// 'render:context'
export default (nuxtConfig) => ({
render: render(nuxtConfig),
})
@renoirb
renoirb / Makefile
Last active Jan 24, 2019
Vue Component Library Build
View Makefile
src=$(shell ls src/*.vue)
out=$(subst src,dist,$(subst .vue,,$(src)))
ifndef OUTPUT
OUTPUT = lib
endif
all: dist/index.js $(out)
@renoirb
renoirb / nuxt-apollo-graphql-stash.patch
Last active Oct 30, 2018
Attempt at making local module for Apollo GraphQL for Vue on Nuxt
View nuxt-apollo-graphql-stash.patch
From f1cf052838fa56c305f57e02f039bea5d957d81f Mon Sep 17 00:00:00 2001
From: Renoir Boulanger <hello@renoirboulanger.com>
Date: Mon, 29 Oct 2018 23:58:40 -0400
Subject: [PATCH] Attempt adding own Vue Apollo
---
modules/graphql.js | 73 ++++++++++++++++++++++++++++++++++
nuxt.config.js | 1 +
package.json | 14 +++++--
plugins/graphql-client.js | 41 +++++++++++++++++++
View components.js
/*!
* Vue.js v2.5.17
* (c) 2014-2018 Evan You
* Released under the MIT License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.Vue=t()}(this,function(){"use strict";var y=Object.freeze({});function M(e){return null==e}function D(e){return null!=e}function S(e){return!0===e}function T(e){return"string"==typeof e||"number"==typeof e||"symbol"==typeof e||"boolean"==typeof e}function P(e){return null!==e&&"object"==typeof e}var r=Object.prototype.toString;function l(e){return"[object Object]"===r.call(e)}function i(e){var t=parseFloat(String(e));return 0<=t&&Math.floor(t)===t&&isFinite(e)}function t(e){return null==e?"":"object"==typeof e?JSON.stringify(e,null,2):String(e)}function F(e){var t=parseFloat(e);return isNaN(t)?e:t}function s(e,t){for(var n=Object.create(null),r=e.split(","),i=0;i<r.length;i++)n[r[i]]=!0;return t?function(e){return n[e.toLowerCase()]}:function(e){return n[e]}}var c=s("slot,component",!0),u=
@renoirb
renoirb / foo.js
Created Aug 27, 2018
Vue component in a Gist
View foo.js
// const render = Vue.compile('<h1>Hello {{what}}</h1>')
const HelloComponent = Vue.component('greet-component', {template: '<h1>Hello {{what}}</h1>', props: ['what']})
const app = new Vue({template: '<div><greet-component :what="name" /></div>', components: { HelloComponent }, data: {name: 'World'}})
app.$mount()
app.$children[0].$el.textContent // "Hello World"
@renoirb
renoirb / time.js
Last active Aug 9, 2018
JavaScript Time Range Functions when using UNIX Epoch
View time.js
class DateEpoch {
constructor (epoch = {}) {
const typeCheckFinite = e => isFinite(e)
const typeCheckDate = e => 'getUTCDate' in e
switch (true) {
case typeCheckFinite(epoch):
this.epoch = toMilliseconds(parseInt(epoch))
break
case typeCheckDate(epoch):
this.epoch = epoch.getTime()
@renoirb
renoirb / en.json
Last active Jun 14, 2018
translations
View en.json
{"welcome": "Welcome! 😊","howmany": "How many {what} do you own","hello": "Hello","userRequired": "User Name is required","userPlaceholder": "User Name","pwdRequired": "Password is required","pwdPlaceholder": "Password","captchaRequired": "Captcha is required","captchaPlaceholder": "Captcha","bravo": "😊"}
@renoirb
renoirb / datepicker.css
Created Jun 4, 2018
WebComponent Host Gist
View datepicker.css
ul[data-v-0b1b89fc]{padding:0;margin:0;list-style:none}.date-picker[data-v-0b1b89fc]{position:relative;height:32px}.input-wrapper[data-v-0b1b89fc]{border:1px solid #ccc;border-radius:2px;vertical-align:middle;display:flex;justify-content:space-between;flex-flow:row nowrap;align-items:center;padding:6px 10px 6px 4px;height:32px;box-sizing:border-box}.input[data-v-0b1b89fc]{height:100%;width:100%;font-size:inherit;padding-left:4px;box-sizing:border-box;outline:none}.cancel-btn[data-v-0b1b89fc]{height:14px;width:14px}.date-panel[data-v-0b1b89fc]{position:absolute;z-index:5000;border:1px solid #eee;width:320px;padding:5px 10px 10px;box-sizing:border-box;background-color:#fff;transform:translateY(4px)}.panel-header[data-v-0b1b89fc]{display:flex;flex-flow:row nowrap;width:100%}.arrow-left[data-v-0b1b89fc],.arrow-right[data-v-0b1b89fc]{flex:1;font-size:20px;line-height:2;background-color:#fff;text-align:center;cursor:pointer}.year-range[data-v-0b1b89fc]{font-size:20px;line-height:2;flex:3;display:flex;justify-conten
View code.js
const items = [
{
value: false,
name: "Frozen Yogurt",
calories: 159,
fat: 6.0,
carbs: 24,
protein: 4.0,
iron: "1%"
},
You can’t perform that action at this time.