Skip to content

Instantly share code, notes, and snippets.

View Juraci's full-sized avatar
🏠
Working from home

Juraci de Lima Vieira Neto Juraci

🏠
Working from home
  • Lagoa Vermelha - Brazil
View GitHub Profile
@Juraci
Juraci / await-promises.js
Last active October 13, 2016 20:07
Points to consider before using async await
// - It will be one more preset as dependency
// - Await doesn't replace promises it works with promises so we will still use promises
// - It's another concept for an already complex project (think about the onboarding)
// - With promise we have error handling out of the box 'catch', with await we need to add try catch everywhere
// This will be in parallel
getFoo().then((message) => {
console.log(message);
});
@Juraci
Juraci / components.games-list.js
Last active September 28, 2016 18:19
Components
import Ember from 'ember';
export default Ember.Component.extend({
amountOfgames: Ember.computed('games', function() {
return this.get('games.length');
})
});
@Juraci
Juraci / router.js
Created September 28, 2016 00:52
Route
import Ember from 'ember';
import config from './config/environment';
const Router = Ember.Router.extend({
location: 'none',
rootURL: config.rootURL
});
Router.map(function() {
this.route('games');
import Ember from 'ember';
export default Ember.Controller.extend({
firstName: 'Juraci',
lastName: 'Neto',
fullName: Ember.computed('firstName', 'lastName', function() {
return `${this.get('firstName')} ${this.get('lastName')}`;
})
});
@Juraci
Juraci / controllers.application.js
Created September 26, 2016 13:30
Computed Property 1
import Ember from 'ember';
export default Ember.Controller.extend({
firstName: 'Juraci',
lastName: 'Neto',
fullName: Ember.computed('firstName', 'lastName', function() {
return `${this.get('firstName')} ${this.get('lastName')}`;
}),
@Juraci
Juraci / json-schema
Last active September 15, 2016 21:18
json-schema
{
"type": "object",
"properties": {
"interval": {
"type": "number"
},
"data": {
"type": "array",
"items": {
"type": "object",
@Juraci
Juraci / node_and_npm_from_souce_all_the_way.txt
Created April 7, 2016 15:18
My preferred way to install node and npm on Linux
Node from source
mkdir ~/local
git clone [email protected]:nodejs/node.git
cd node
git checkout <lastest release tag here>
./configure --prefix=~/local
make install
echo export 'PATH="$HOME/local/bin:$PATH"' >> ~/.zshrc (replace .zshrc with your shell config file)
npm from source
var HIGHLIGHT = (function(){
var boxShadow = "0 0 15px rgba(81, 250, 200, 1)";
var border = "1px solid rgba(81, 250, 200, 1)";
return {
glow: function(element) {
var originalBoxShadow = element.style.boxShadow;
var originalBorder = element.style.border;
setInterval(function(){
@Juraci
Juraci / sync-upstream.sh
Created December 11, 2015 17:16
Bash script to sync a forked project with its upstream repository
#/bin/bash
red=`tput setaf 1`
green=`tput setaf 2`
yellow=`tput setaf 3`
upstream=$1
branch=$2
# checks if there is a remote repo called upstream
check_upstream() {
@Juraci
Juraci / Vagrantfile.rb
Last active August 29, 2015 14:26
Ansible Session
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.define :web do |web_config|