Skip to content

Instantly share code, notes, and snippets.

View falexandre's full-sized avatar
😎

Fábio Luis Alexandre falexandre

😎
View GitHub Profile
@falexandre
falexandre / installation and configuration
Last active March 7, 2018 10:22
Test com Mocha and Chai
> npm i -D mocha chai
> package.js
"test" : "./node_modules/.bin/mocha/ {PASTA_TESTES}/**/*.spec.js -b -R strip"
mocha -b -r babel-polyfill -r babel-core/register -R landing tests/**/**.spec.js
https://mochajs.org/#usage
-b para no primeiro erro que acontecer
-R tipo aviazinho progress
@falexandre
falexandre / Dockerfile
Created February 28, 2018 05:14 — forked from damien-biasotto/Dockerfile
Docker Compose CakePHP 3 Nginx + PHP-FPM + MailHog + Phpmyadmin
FROM php:fpm-alpine
RUN apk add --no-cache --update icu-libs icu icu-dev
RUN docker-php-ext-install intl pdo pdo_mysql
@falexandre
falexandre / default.conf
Created January 9, 2018 08:43
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@falexandre
falexandre / nginx.conf
Created January 8, 2018 13:57 — forked from micho/nginx.conf
nginx config for http/https proxy to localhost:3000
First, install nginx for mac with "brew install nginx".
Then follow homebrew's instructions to know where the config file is.
1. To use https you will need a self-signed certificate: https://devcenter.heroku.com/articles/ssl-certificate-self
2. Copy it somewhere (use full path in the example below for server.* files)
3. sudo nginx -s reload
4. Access https://localhost/
Edit /usr/local/etc/nginx/nginx.conf:
@falexandre
falexandre / app.module.ts
Last active November 13, 2017 23:35
Store Angular
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { StoreModule } from '@ngrx/store';
import { counterReducer } from './store/counter';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
@Component({
selector: 'add-story-form',
template: `
<div class="container">
<h1>New Story</h1>
<form [formGroup]="newStory"
(submit)="submit($event)"
(success)="onSuccess()"
(error)="onError($event)"
connectForm="newStory">
@falexandre
falexandre / .htaccess
Last active October 30, 2017 23:39
Docker-nginx
RewriteEngine on
### Não permite exibir o mapa dos diretorios
Options -Indexes
# Don't rewrite files or directories
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
@falexandre
falexandre / comandos.txt
Created October 5, 2017 23:12
generator-generator
npm install -g generator-generator
npm install -g yo
yo generator
// dentro da pasta do gerador, esse comando serve para poder ser acessivel de qualquer lugar
yo link
//chamando o gerador de qualquer lugar
@falexandre
falexandre / stripHTML
Created September 21, 2017 10:20
Prototype remove html tag javascript
String.prototype.stripHTML = function() {return this.replace(/<.*?>/g, '');}
@falexandre
falexandre / angular-strLimit
Last active September 21, 2017 10:19
angular strLimit
phoneCat.filter('strLimit', ['$filter', function($filter) {
return function(input, limit) {
if (! input) return;
if (input.length <= limit) {
return input;
}
return $filter('limitTo')(input, limit) + '...';
};
}]);