Skip to content

Instantly share code, notes, and snippets.

View jxskiss's full-sized avatar

Shawn Wang jxskiss

  • ByteDance Inc.
  • Beijing
View GitHub Profile
@jxskiss
jxskiss / assert.go
Created December 19, 2021 02:04
Opinionted and simple Golang assertion helpers.
package assert
import (
"bytes"
"fmt"
"reflect"
"regexp"
"strings"
"testing"
)
@jxskiss
jxskiss / example.py
Last active May 23, 2022 07:55
Use "fysom" state machine as global machine
from django.db import models
from fysom_singleton import *
class ItemStatus(object):
NEW = 'new'
NEED_INFO = 'need_info'
REVIEWING = 'reviewing'
REDOING = 'redoing'
CONFLICT = 'conflict'
@jxskiss
jxskiss / app.py
Last active November 3, 2021 10:29
Get celery task results within tornado, celery [issues#3577](https://github.com/celery/celery/issues/3577)
# Tornado app.py
from tornado import web, options
from tornado.platform.asyncio import AsyncIOMainLoop
import asyncio
AsyncIOMainLoop().install()
import tasks
from celery_task_utils import CeleryTaskProxy