Skip to content

Instantly share code, notes, and snippets.

William Oliveira williamoliveira

Block or report user

Report or block williamoliveira

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View VueVsReact.md

Vue

// ./Greeter.vue
<template>
    <div>
        <span>{{greet}}, {{who}}</span>
        <button @click="$emit('click')">Click me</button>
    </div>
</template>
<script>
View 2017-04-15T10_24_13_685Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'build-main' ]
2 info using npm@4.5.0
3 info using node@v7.8.0
4 verbose run-script [ 'prebuild-main', 'build-main', 'postbuild-main' ]
5 info lifecycle myappname@0.1.0~prebuild-main: myappname@0.1.0
6 silly lifecycle myappname@0.1.0~prebuild-main: no script for prebuild-main, continuing
7 info lifecycle myappname@0.1.0~build-main: myappname@0.1.0
8 verbose lifecycle myappname@0.1.0~build-main: unsafe-perm in lifecycle true
9 verbose lifecycle myappname@0.1.0~build-main: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/william/Projects/myappname/node_modules/.bin:/home/william/Projects/myappname/node_modules/.bin:/home/william/.config/yarn/link/node_modules/.bin:/home/william/Projects/myappname/node_modules/.bin:/home/william/.config/yarn/link/node_modules/.bin:/usr/share/yarn/bin/node-gyp-bin:/home/william/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/u
@williamoliveira
williamoliveira / validation.js
Last active Dec 15, 2016
Simple object validation code. Loosely based on https://medium.com/javascript-inside/form-validation-as-a-higher-order-component-pt-1-83ac8fd6c1f0#.6yiftk939, writen in a more easy to understand manner
View validation.js
const getErrors = (inputData, validationRules, globalOptions) => {
const errors = {}
const addError = (key, errorMessage) => {
if(!(key in errors)) errors[key] = []
errors[key].push(errorMessage)
}
View redux-act-inspired.md
const createAction = (type) => {
  const actionCreator = (payload) => ({
    type,
    payload,
  })

  actionCreator.type = type
View app_Http_Middleware_ActionCache.php
<?php
namespace App\Http\Middleware;
use Closure;
use App\Services\Cache\ActionCacheManager;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
/**
* Middleware that will cache controller action responses
View install.sh
Moved: https://github.com/williamoliveira/install.sh
@williamoliveira
williamoliveira / AbstractRepository.php
Last active Oct 29, 2015
AbstractRepository com um exemplo de UserRepostory
View AbstractRepository.php
<?php namespace App\Repositories\Eloquent;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Http\Request;
abstract class AbstractRepository
{
protected $modelClass;
You can’t perform that action at this time.