Skip to content

Instantly share code, notes, and snippets.

Pablo Henrique pablohpsilva

  • Docler Holding
  • 6 rue des residence 2434 Senningerberg, Luxembourg
Block or report user

Report or block pablohpsilva

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
@pablohpsilva
pablohpsilva / uiavatar.tsx
Created Sep 11, 2019
sample medium UiAvatar.tsx
View uiavatar.tsx
import React, { useContext, useCallback } from 'react'
import { useQuery } from 'react-apollo'
import { SomeEntity } from 'dh-apollo-entities'
import { UiAvatar } from 'dh-react-ui'
import { OurContextAPI } from '@/context'
const SmartAvatar = (props) => {
const { data, loading } = useQuery(SomeEntity.req, { variables: { d: props.d } })
const { Link, generateContextLinks } = useContext(OurContextAPI)
@pablohpsilva
pablohpsilva / client.ts
Created Sep 11, 2019
sample medium client dh-apollo-entities
View client.ts
import { ApolloClient } from 'apollo-client'
import { ApolloLink } from 'apollo-link'
import { InMemoryCache } from 'apollo-cache-inmemory'
import { ApiGw, User } from 'dh-apollo-entities'
const cache = new InMemoryCache()
const ApiGwLink = ApiGw.link({
...
})
View lj.md

Feature Enhancements

Snapshot

To open any snapshots taken, the user has to follow these steps:

  1. Click on the menu;
  2. My content;
  3. My snapshots;
  4. Click on the model;
  5. Search for the gallery icon (if I deduce I should click there );
View web5.md

Okay, this is where I leave you.

Improvements

Infinite Scroll

We have a few issues with our current Infinite Scroll:

  1. It will attach infinite elements into the DOM as is being scrolled;
  2. The code for handling it is being copy/pasted in different files to do the same thing;
  3. Some files has extra handling for no apparent reason;
View functionalmongo.js
/*
// Ideia de uso:
const fmongo = FunctionalMongo('mongodb://0.0.0.0:27017/yhub')
.collect('User')
.byId({ id })
*/
import { curry, objOf } from 'ramda'
View iview-google-charts-readme.md

Como instalar

importa o arquivo iview-google-chart.min.js no seu projeto. Nao pense demais, pode por no HTML mesmo (especialmente se estiver usando projetos legados).

<script src="path/to/lib/iview-google-charts.min.js"></script>

Como usar

Essa lib tem uma unica tag: <google-chart>.

@pablohpsilva
pablohpsilva / x-resources-example.js
Created Apr 15, 2018
An example using x-resources
View x-resources-example.js
//
// Create a resource file, for example: 'resources/user.js'.
// Create your resource-actions and export your custom resource
//
// File: resources/user.js
import { resources } from 'x-resources'
const baseURL = 'https://api.github.com'
View download.js
// https://www.web2pdfconvert.com/
var pages = [
"http://pegasus.portal.nom.br/introducao/",
"http://pegasus.portal.nom.br/o-portal/",
"http://pegasus.portal.nom.br/fotos-analisadas/",
"http://pegasus.portal.nom.br/simbologias/",
"http://pegasus.portal.nom.br/livros/",
"http://pegasus.portal.nom.br/livros/da-terra-para-o-cosmo/",
"http://pegasus.portal.nom.br/livros/no-coracao-da-terra/",
@pablohpsilva
pablohpsilva / axios-resource.js
Last active Mar 21, 2018
Creating axios resources
View axios-resource.js
import axios from "axios"
axios.defaults.headers.put['Content-Type'] = 'application/json';
axios.defaults.headers.post['Content-Type'] = 'application/json';
const getDefaultActions = () => ({
get: { method: 'GET' },
save: { method: 'POST' },
query: { method: 'GET' },
update: { method: 'PUT' },
remove: { method: 'DELETE' },
View import-specific-vs-import-deconstructor--example.js
// He said that importing like this:
import Comp1 from './dummy/Comp1'
// is faster than importing like this:
import { Comp1 } from './dummy'
You can’t perform that action at this time.