Skip to content

Instantly share code, notes, and snippets.

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

Fabio Elisio felisio

🏠
Working from home
  • Vila Nova de Gaia - Porto - Portugal
View GitHub Profile
@felisio
felisio / calendar-events.js
Created October 10, 2018 11:45
Helpers Collection
export function dateTimeFormatter (date ,format) {
// date: format:'yyyy-MM-dd hh:mm:ss'
if (!date || date == "") {
return ""
}
if (typeof date === "string") {
var mts = date.match(/(\/Date\((\d+)\)\/)/)
if (mts && mts.length >= 3) {
date = parseInt(mts[2])
<template>
<!-- BEGIN FormFullscreen -->
<form-fullscreen>
<!-- HEADER -->
<header-form title="Cadastro de Aula" />
<!-- BEGIN CONTEUDO FORM -->
<div class="content">
<div class="ui container">
<!-- BEGIN Form -->
<form class="dg_form ui form" novalidate @submit.prevent="save">
@felisio
felisio / apolloConection.js
Created July 11, 2018 17:28
Default connect for Apollo GraphQl
import ApolloClient, {InMemoryCache, ApolloLink} from "apollo-boost";
const PATH_URL = 'http://URL'
const TOKEN = 'TOKEN'
const getApolloClient = () => {
const cache = new InMemoryCache()
return new ApolloClient({
uri: `${PATH_URL}graphql`,
@felisio
felisio / alis.md
Created June 8, 2018 22:44
Alias to react native for Android

Alias to react native for android

alias rn-opt='adb shell input keyevent 82'
alias rn-reload='adb shell input keyevent 82 && adb shell input keyevent 20 && adb shell input keyevent 66'
alias rn-start='react-native run-android'
alias rn-log='react-native log-android'
alias rn-rm-apk='rm -r android/app/build/outputs'
alias rn-release='cd android && ./gradlew assembleRelease && cd .. || cd ..'
alias rn-deb='adb reverse tcp:9090 tcp:9090'
import { notify } from 'src/helpers/notify'
class DGError extends Error {
constructor (message = '') {
super (message)
this.message = message
this.name = 'DGError'
if (Error.hasOwnProperty('captureStackTrace')) {
Error.captureStackTrace(this, this.constructor)
}
@felisio
felisio / manifest.json
Created September 7, 2017 09:59
example manifest json
{
"name": "My Progressive Web App",
"short_name": "PWA",
"start_url": "/index.html", // qual pagina sera iniciada
"scope": ".", // quais paginas serão incluidas na experiencia do PWA
"display": "standalone", // seu pwa ira funcionar de forma autonoma
"background_color": "#fff", // qual a cor sera usada enquanto estiver carregando (ou coloque o splashscreen)
"theme_color": "#3f51b5", // cor do tema ( customiza a barra de cima do celular )
"description": "Pwa de estudo", // desrição
"dir": "ltr", // indica a direção de laitura do seu app ltr - leftToRight
@felisio
felisio / service_angular1.js
Created June 20, 2017 13:50
esqueleto do service para angular 1
/*
* servicos para o site
*/
var $service = angular.module('app.services', []);
//-----------processo de Autenticação do usuario ----------------------------------//
//Factory para autenticação
$service.factory('AuthService', function ($rootScope, $http, Session) {
@felisio
felisio / AnimatedScrollView.js
Last active June 3, 2017 23:35
R.N. AnimatedScrollView
import React, { PureComponent } from 'react';
import { View, Image, ListView, Text, Animated } from 'react-native';
import styles from './styles';
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});
export default class AnimatedScrollView extends PureComponent {
constructor(props) {
super(props);
this.state = {
@felisio
felisio / gulpfile.js
Created February 17, 2017 13:04
Gulp Generate
const gulp = require('gulp');
const template = require('gulp-template');
const rename = require('gulp-rename');
const path = require('path');
const yargs = require('yargs');
const appRoot = require('app-root-path');
const loadsh = require('lodash');
require('./contains');
/*
@felisio
felisio / styles.less
Created January 6, 2017 14:52
Atom Styles
atom-workspace {
font-family: 'Fira Code';
font-size: 12px;
}
atom-text-editor {
font-family: 'Fira Code';
font-style: normal;
text-rendering: optimizeLegibility;
}