Skip to content

Instantly share code, notes, and snippets.

View allysonsilva's full-sized avatar
🌎
Working from anywhere

Alyson Silva allysonsilva

🌎
Working from anywhere
View GitHub Profile
@allysonsilva
allysonsilva / [Vue.js]_event-emit-on.js
Created December 2, 2017 03:31
Vue.js ⚡️ Eventos - Enviar e Escutar
new Vue({
el: '#app',
data: {
votes: 0
},
methods:
{
vote: function(writer) {
this.$emit('voted')
},
@allysonsilva
allysonsilva / [Vue.js]_event-communication-between-father-son.js
Created December 2, 2017 03:36
Vue.js ⚡️ Eventos - Comunicação entre Pai e Filho
Vue.component('food', {
template: '#food',
props: ['name'],
methods: {
vote: function() {
this.$emit('voted')
}
},
});
@allysonsilva
allysonsilva / [Vue.js]_event-passing-arguments.js
Created December 2, 2017 03:53
Vue.js ⚡️ Eventos - Passando Argumentos - [vm.$emit]
Vue.component('food', {
template: '#food',
props: ['name'],
data: function() {
return {
votes: 0
}
},
methods: {
vote: function(event) {
@allysonsilva
allysonsilva / [Vue.js]_event-bus.js
Created December 2, 2017 04:15
Vue.js ⚡️ Event Bus
var bus = new Vue();
Vue.component('food', {
template: '#food',
props: ['name'],
data: function() {
return {
votes: 0
}
},
@allysonsilva
allysonsilva / [Vue.js]_example-stories-and-favorites.js
Last active December 2, 2017 14:20
Vue.js ⚡️ Example - Events
Vue.component('story', {
template: "#story-template",
props: ['story', 'favorite'],
methods: {
upvote: function() {
this.story.upvotes += 1;
this.story.voted = true;
},
markAsFavorite: function() {
// 'update' is just the name of the custom event
@allysonsilva
allysonsilva / [Vue.js]_example-horses-chariot.js
Created December 2, 2017 14:19
Vue.js ⚡️ Example - Events
Vue.component('chariot', {
props: ['chariot', 'current'],
template: "#chariot-template",
methods: {
rideChariot: function(chariot) {
this.$emit('select', chariot)
},
},
computed: {
//is true when the chariot has more horses than the current one
@allysonsilva
allysonsilva / .editorconfig
Created December 26, 2017 00:16
[.editorconfig]
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
@allysonsilva
allysonsilva / .prettierrc
Last active December 26, 2017 18:12
[.prettierrc]
{
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
"semi": false,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"overrides": [
@allysonsilva
allysonsilva / custom-workbench-vscode.css
Created December 27, 2017 15:26
Customizing workbench [VS Code]
.monaco-icon-label[title~="Deleted"]::after {
content: "D";
color: #FFF !important;
background-color: rgb(173, 7, 7);
}
.monaco-icon-label[title~="Untracked"]::after {
content: "U";
color: #FFF !important;
background-color: rgb(1, 144, 1);
@allysonsilva
allysonsilva / Initial-Environment-Setup.sh
Last active April 28, 2018 14:43
macOS⚡️Simple Development Environment
######
# Colors
######
GREEN='\033[0;32m'
LIGHTGREEN='\033[1;32m'
LIGHTBLUE='\033[01;34m'
NC='\033[0m'
main() {