Skip to content

Instantly share code, notes, and snippets.

View hpneo's full-sized avatar

Gustavo Leon hpneo

View GitHub Profile
@hpneo
hpneo / Gemfile
Created November 20, 2020 17:57
Partidos políticos inscritos
source "https://rubygems.org"
ruby "2.7.2"
gem "scrap_kit"
gem "active_worksheet"
gem "dry-cli"
gem "tty-table"
@hpneo
hpneo / gist:a5c0a5d42eb9d12c92c86588988803c2
Created November 20, 2020 16:18
Congresistas electos 2020-2021
Zk2S7uS8rvQ%3d
bpzQiAWy%2fdc%3d
hZnu%2bV8rX7k%3d
srmnJ85M7o8%3d
%2fiG4Gn0A5oE%3d
mu6bNwYfvjM%3d
0QU0xWgltTY%3d
nhJ9ZJcBdMY%3d
D596D8iStOE%3d
djnJehpykio%3d
@hpneo
hpneo / application.js
Created October 7, 2020 18:27
Many to Many in Overpass
const resources = defineResources(({ resource, belongsTo, hasMany }) => {
resource("users", () => hasMany("savedProperties"));
resource("properties"); // Could be `resource("properties", () => hasMany("savedProperties"));`
resource("savedProperties", () => belongsTo("property"));
});
return (
<OverpassProvider
api={{
apiHost: location.host,

For both:

  • https://fino.able.co/api/products/:product_id/items
  • https://fino.able.co/api/products/:product_id/items/search

Response should include cycle_time for each item:

[
 {
@hpneo
hpneo / gist:98b38776f1f7a5f1ccf0827750854019
Created September 17, 2019 20:57
PivotalTracker API description

Models

  • PivotalTrackerProject:
    • id
    • name
    • memberships (list of users assigned to that project, could be a list of e-mails)
  • PivotalTrackerStory:
    • pivotal_tracker_project_id
    • id
    • name
  • kind

From: https://www.codewars.com/kata/whos-online

You have a group chat application, but who is online!?

You want to show your users which of their friends are online and available to chat!

Given an input of an array of objects containing usernames, status and time since last activity (in mins), create a function to work out who is online, offline and away.

If someone is online but their lastActivity was more than 10 minutes ago they are to be considered away.

@hpneo
hpneo / preact-forms-with-linkstate.js
Last active June 14, 2019 22:04
PoC Forms in Preact using Higher-Order Components
import { h, cloneElement, Component } from 'preact';
import linkState from 'linkstate';
const injectFormProps = (child, { component }) => {
const childChildren = (child.children || []).map(childrenChild => injectFormProps(childrenChild, { component }));
if (child.nodeName === 'form') {
const childAttributes = {
...child.attributes,
onSubmit(event) {
{
"trailingComma": "all"
}
const path = require("path");
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
jest: true
},
---
AllCops:
DisabledByDefault: true
Exclude:
- bin/**/*
- node_modules/**/*
- log/**/*
- tmp/**/*
- vendor/**/*
- db/migrate/*