Skip to content

Instantly share code, notes, and snippets.

View znck's full-sized avatar
🎯
Focusing

Rahul Kadyan znck

🎯
Focusing
View GitHub Profile
@znck
znck / state-of-vue-compilers.md
Last active April 11, 2017 21:41
Feature Comparison - vue-loader vs vueify vs rollup-plugin-vue
Feature vue-loader vueify rollup-plugin-vue
Support for Vue 1.x Version 8.x Version 8.x Version 2.x
Support for Vue 2.0 Version 9.0+ Version 9.0+ Version 2.x
ES2015 With buble-loader or babel-loader Preconfigured to use babel With rollup-plugin-buble or rollup-plugin-babel
Scoped CSS -
CSS Modules -
PostCSS -
Hot Reload ✓ ✓

Keybase proof

I hereby claim:

  • I am znck on github.
  • I am znck (https://keybase.io/znck) on keybase.
  • I have a public key whose fingerprint is 4960 41D2 4381 8206 D62C C2DF 21AF 5D4A 08BA 995B

To claim this, I am signing this object:

@znck
znck / webpack.config.js
Created June 9, 2017 19:46
Webpack Chunks
// ----- Extracting Chunks -----
exports.entry['vendor/vue'] = ['vue', 'vuex', 'vue-resource', 'vue-router']
exports.entry['vendor/bootstrap'] = ['jquery', 'bootstrap', 'tether']
exports.entry['vendor/components'] = ['bootstrap-for-vue']
exports.entry['vendor/plugins'] = ['moment', 'sifter']
exports.entry['vendor/echo'] = ['pusher-js', 'laravel-echo', 'echo-for-vue']
exports.plugins.push(
new webpack.optimize.CommonsChunkPlugin({
name: 'manifest'
}),
@znck
znck / index.html
Last active July 14, 2017 19:55
jquery demo: JS Bin// source https://jsbin.com/meximo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.group {
display: block;
margin: 0 15px 15px;
@znck
znck / aliasthat.sh
Created June 13, 2017 07:23
Create an alias for last command.
function aliasthat {
if [ -n ${1} ]; then
fc -e "sed -i -e \"s/^.*/echo alias $1=\\\"'\\\"\'&\'\\\"'\\\" >> ~\/.bash_alias/\""
. ~/.bash_alias
fi
}
@znck
znck / Hello.vue
Last active October 29, 2017 14:16
vue component compiler source map issue
<template>
<h2 class="red">{{msg}}</h2>
</template>
<script>
export default {
data () {
return {
msg: 'Hello from Component A!'
}
import { mount } from 'vue-test-utils'
import { createRenderer } from 'vue-server-renderer'
import MyComponent from './MyComponent.vue'
const renderer = createRenderer()
renderer.renderToString(
mount(MyComponent).vm,
(error, html) => {
@znck
znck / Vue component module
Last active November 26, 2018 01:18
Example for `rollup-plugin-vue`
Create a module for vue component.
@znck
znck / begin-again.md
Last active January 29, 2019 13:13
VueBLR - Begin Again Workshop

# Initial Commit

# Create new npm project

  • Create new project
    npm init
@znck
znck / promised.ts
Last active August 14, 2019 15:22
Moved to https://github.com/znck/promised | A utility to convert callbacks to promises.
import {promisify, CustomPromisify} from 'util'
export type FunctionProxy<T extends Function> = CustomPromisify<T>
export type PackageProxy<P extends { [key: string]: Function }> = {
[K in keyof P]: FunctionProxy<P[K]>
}
export function promised<T extends { [key: string]: Function | any }>(target: T): PackageProxy<T> {