Skip to content

Instantly share code, notes, and snippets.

View fimars's full-sized avatar
🍥

fimars

🍥
View GitHub Profile

Hi!

This is an example of how to use [Rollup] with external dependencies, without hard-coding them.

It reads your installed NPM dependencies and treats them as external to Rollup. They still get bundled, but not as ES2015.

Make sure you have a .babelrc or a "babel":{} section in your package.json.

update

@fimars
fimars / _Webpack HotServer Quick Start.md
Last active August 24, 2017 10:45
Webpack HotServer Quick Start

Hi!

This is an example of how to quick start [Webpack Hot Server], without hard-coding them.

Use

node serve.js enjoy it !

Todo

  • XO Support [✔️]
@fimars
fimars / alert.js
Created November 27, 2017 09:42
A Vue Alert Demo
const alert = () => {
const VmConstructor = Vue.extend({
template: `
<div>
<button @click="$emit('yes')">yes</button>
<button @click="$emit('no')">no</button>
</div>
`
})
const instance = getAnInstance(VmConstructor)
@fimars
fimars / npm.runkit.icls
Last active January 17, 2018 10:34
`npm.runkit` code mirror theme in JetBrains products.
<scheme name="npm.runkit" version="142" parent_scheme="Default">
<option name="FONT_SCALE" value="1.0" />
<metaInfo>
<property name="created">2018-01-17T18:33:19</property>
<property name="ide">WebStorm</property>
<property name="ideVersion">2017.3.2.0.0</property>
<property name="modified">2018-01-17T18:33:21</property>
<property name="originalScheme">npm.runkit</property>
</metaInfo>
<console-font>
@fimars
fimars / assert.exs
Last active March 29, 2018 03:38
Elixir Meta PG
# Further Exploration
#
# We journeyed from simple control flow transformations all the way through a mini testing framework. Along the way,
# you learned all the tools necessary to define your own macros and perform AST transformations in a responsible way.
# Next, we’ll discover a few advanced compile-time code-generation tech- niques to create highly performant and
# maintainable programs.
#
# On your own, explore ways you can enhance your Assertion test framework and define new macro constructs. Here are a few
# basic experiments to get you started:
# • Implement assert for every operator in Elixir.
@fimars
fimars / Input.vue
Last active December 4, 2018 01:48
Vue Component Base Native Element Example
<script>
export default {
name: 'UInput',
render () {
// TODO: abstract node render useful function.
const attrs = this.$attrs;
const on = Object.keys(this.$listeners).reduce((events, key) => {
events[key] = (ev) => {
this.$emit(key, ev);
};
// @ts-nocheck
import Plan from 'src/store/plan'
import packagePrivileges from 'src/common/constants/packagePrivileges'
import objectExt from 'src/utils/objectExt'
import { Box, Button } from '@vec6/next-ui'
import links from 'src/common/constants/links'
import User from 'src/store/user'
export default {
const stylesheets = {};
export const injectStyles = ({ fileScopeId, css, mountNode = document.head }) => {
let stylesheet = stylesheets[fileScopeId];
if (!stylesheet) {
const styleEl = document.createElement('style');
styleEl.setAttribute('type', 'text/css');
stylesheet = stylesheets[fileScopeId] = styleEl;
❯ pnpm dlx @biomejs/biome format --write
@fimars
fimars / unique_symbol.ts
Created October 25, 2024 03:11
FIX `A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.ts(1170)`
type PlanName = 'free' | 'starter' | 'growth' | 'plus'
type PlanDuration = 'monthly' | 'annually'
type BillingPlanEvent = `billing_${PlanName}_${PlanDuration}_click`
type GuidacneStep = 1 | 2 | 3
type GuidanceEvent = `guidance_step${GuidacneStep}_next_click`
// A computed property name in a type literal must refer to an expression whose type is a literal type or a 'unique symbol' type.ts(1170)
// Fix?