Skip to content

Instantly share code, notes, and snippets.

View gbuszmicz's full-sized avatar

Gonzalo F. Buszmicz gbuszmicz

  • Rosario, Argentina
View GitHub Profile
Messages Flow
idle
FETCHING -> fetching
fetching
FETCH_SUCCESS -> success
FETCH_ERROR -> error
FETCH_EMPTY -> empty
success
FETCHING -> fetching
error
idle
FETCHING -> fetching
fetching
FETCH_SUCCESS -> resolve
FETCH_ERROR -> reject
FETCH_EMPTY -> empty
resolve
ready
OPEN_ZOOM_MODAL -> zoomModal
OPEN_OFFER_MODAL -> offerModal
idle
FETCHING -> fetching
fetching
FETCH_SUCCESS -> resolve
FETCH_ERROR -> reject
FETCH_EMPTY -> empty
resolve
ready
OPEN_ZOOM_MODAL -> zoomModal
OPEN_OFFER_MODAL -> offerModal
idle
FETCHING -> fetching
fetching
FETCH_SUCCESS -> resolve
FETCH_ERROR -> reject
FETCH_EMPTY -> empty
resolve
ready
OPEN_ZOOM_MODAL -> zoomModal
OPEN_OFFER_MODAL -> offerModal
@gbuszmicz
gbuszmicz / react-pixi-slider-implementation.js
Created April 16, 2019 02:19
Pixi slider component for React
import React, { Component } from 'react'
import { Container, Text } from 'react-pixi-fiber'
import Slider from 'components/Slider'
class MyComponent extends Component {
constructor(props) {
super(props)
this.state = {
text: '5.0'
@gbuszmicz
gbuszmicz / react-pixi-slider-index.js
Last active April 16, 2019 02:12
Pixi slider component for React
import React, { Component } from 'react'
import { Container } from 'react-pixi-fiber'
import Background from './Background'
import Button from './Button'
class Slider extends Component {
constructor(props) {
super(props)
this.state = {
@gbuszmicz
gbuszmicz / react-pixi-slider-button.js
Last active April 16, 2019 23:33
Pixi slider component for React
import { CustomPIXIComponent } from 'react-pixi-fiber'
import * as PIXI from 'pixi.js'
const TYPE = 'Button'
export const behavior = {
customDisplayObject: props => new PIXI.Graphics(),
customApplyProps: (instance, oldProps, newProps) => {
const {
fill,
width,
@gbuszmicz
gbuszmicz / react-pixi-slider-background.js
Created April 16, 2019 01:30
Pixi slider component for React
import { CustomPIXIComponent } from 'react-pixi-fiber'
import * as PIXI from 'pixi.js'
const TYPE = 'Background'
export const behavior = {
customDisplayObject: props => new PIXI.Graphics(),
customApplyProps: function(instance, oldProps, newProps) {
const { fill, x, y, width, height, onClick } = newProps
const onPointerDown = event => {
onClick(event.data.getLocalPosition(instance.parent))
@gbuszmicz
gbuszmicz / worker.js
Created September 17, 2018 19:50
Heroku worker process
const amqp = require('amqp-connection-manager')
const AMQP_URL = process.env.CLOUDAMQP_URL || 'amqp://localhost';
if (!AMQP_URL) process.exit(1)
const WORKER_QUEUE = 'worker-queue'
// Create a new connection manager from AMQP
var connection = amqp.connect([AMQP_URL])
@gbuszmicz
gbuszmicz / clock.js
Last active September 14, 2022 02:20
Heroku clock.js process
const CronJob = require('cron').CronJob
const amqp = require('amqp-connection-manager')
const AMQP_URL = process.env.CLOUDAMQP_URL || 'amqp://localhost';
if (!AMQP_URL) process.exit(1)
const WORKER_QUEUE = 'worker-queue' // To consume from worker process
const CLOCK_QUEUE = 'clock-queue' // To consume from clock process
const JOBS = [{ // You could store these jobs in a database
name: "Cron process 1",