Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Focusing

Jesus Galvan jsgv

:octocat:
Focusing
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am jsgv on github.
  • I am jsgv (https://keybase.io/jsgv) on keybase.
  • I have a public key ASDbYVEwwlQ6ZIU7-aHu6BLwZGstX90G6FwuGSyAFD62SQo

To claim this, I am signing this object:

View Vue-Plugin.js
import UserContainer from './UserContainer'
const Plugin = {
install (Vue, options) {
// <g-user-container> component will be globally available
Vue.component('GUserContainer', UserContainer)
Vue.mixin({
computed: {
// `users` will be available globally
View UserList.vue
<template lang="html">
<div>
<user-container v-for="u in users">
<p>{{ sayHello(u.name) }}</p>
</user-container>
</div>
</template>
<script>
import UserContainer from './UserContainer'
View MyCounter.vue
<template lang="html">
<div>
<div>{{ count }}</div>
<button @click="add()">Increment</button>
</div>
</template>
<script>
export default {
data () {
View my-counter.js
Vue.component('my-counter', {
data () {
return {
count: 0
}
},
methods: {
add () {
this.count += 1;
}
View person-arrow.js
function Person () {
this.age = 0;
setInterval(() => {
this.age += 1;
}, 1000)
}
View person-bind.js
// store the `this` scope in
// a variable to reuse
function Person () {
var that = this;
that.age = 0;
setInterval(function growUp () {
that.age += 1;
}, 1000)
}
View person.js
function Person () {
this.age = 0;
setInterval(function growUp () {
// `this.age` is undefined
// this function has declared its own scope
// different from the Person scope
this.age += 1;
}, 1000)
}
@jsgv
jsgv / install-go-gvm.sh
Last active Jul 19, 2016
Install latest Go with GVM
View install-go-gvm.sh
# Install GVM (Go Version Manager) with ZSH
zsh < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# Install Go 1.4
gvm install go1.4
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
# Install Go 1.6.2
gvm install go1.6.2
@jsgv
jsgv / go-resources.md
Last active Jan 13, 2017
Go resources for beginning developers
View go-resources.md

Setup

Go Version Manager

https://github.com/moovweb/gvm

  • follow the install instructions. especially if using a different shell other than bash

Learning

Effective Go

You can’t perform that action at this time.