Skip to content

Instantly share code, notes, and snippets.

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

PHPS pablohpsilva

🏠
Working from home
View GitHub Profile
[
{ "id": "01coin", "symbol": "zoc", "name": "01coin" },
{
"id": "0-5x-long-algorand-token",
"symbol": "algohalf",
"name": "0.5X Long Algorand"
},
{
"id": "0-5x-long-altcoin-index-token",
"symbol": "althalf",
@pablohpsilva
pablohpsilva / uiavatar.tsx
Created September 11, 2019 20:26
sample medium 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 September 11, 2019 20:10
sample medium client dh-apollo-entities
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({
...
})
@pablohpsilva
pablohpsilva / lj.md
Created August 29, 2019 06:25
livejasmin

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 );

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;
/*
// Ideia de uso:
const fmongo = FunctionalMongo('mongodb://0.0.0.0:27017/yhub')
.collect('User')
.byId({ id })
*/
import { curry, objOf } from 'ramda'

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 April 15, 2018 13:49
An example using x-resources
//
// 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'
@pablohpsilva
pablohpsilva / download.js
Created April 5, 2018 11:56
Download PDF from any url using https://www.web2pdfconvert.com/
// 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 March 21, 2018 19:37
Creating axios resources
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' },