This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component} from "angular2/core"; | |
import {Store, Reducer} from "@ngrx/store"; | |
import {Observable} from "rxjs/Observable"; | |
interface AppState { | |
counter: number; | |
} | |
interface ICounter { | |
id: number, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```html+jinja | |
file:./some_file.py | |
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### In all of these cases, *we* make the pyglet window, store it | |
### "somewhere" (class variable, closure, thread local), and provide | |
### it as an argument to registered stuff that we (not pyglet) are | |
### responsible for calling. | |
### Imperative example. draw_point is an API which adds the arguments | |
### to a list of draw_point things to run. game.run() makes a window, | |
### starts render, and calls all the things queued up. In *theory* we | |
### could implicitly do batching. | |
from arcade import game, color |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I'm a contributor to Arcade: http://arcade.academy | |
# His tests are currently done as doctests: cumbersome and slow. I'm | |
# converting them to pytest. But they are...easy and slow. :) Because | |
# a pyglet GUI window is created/destroyed for every test. I'm pretty | |
# good at pytest and mediocre at pytest-mock. | |
# Here's an example of a test that make a window: | |
from arcade import Window |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import reg | |
from examples.request import Request | |
class Document(object): | |
def __init__(self, docid, text): | |
self.docid = docid | |
self.text = text | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have a system built on Sphinx (Python docs generation tool, used by ReadTheDocs.) It's a static-site generator, | |
like Jekyll. I'd like to retain the idea that all initial page views can be done WITHOUT js. | |
Fictional Scenario | |
===================== | |
Imagine a widget that shows one song at a time from an album. I'd like Sphinx to render a <div> showing the | |
song. Click a button, fetch some JSON, show the next. (What I actually want is faceted drilldown of a big | |
a thousand articles.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ActionsType } from "hyperapp"; | |
interface IState { | |
url: string; | |
} | |
/* | |
I'm trying to do Jest tests on actions without creating a document | |
and an app. But the first line in the test gives a TypeScript error: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ .venv/bin/python ./main.py | |
Traceback (most recent call last): | |
File "./main.py", line 12, in <module> | |
player = sound.play() | |
File "/private/tmp/f2/.venv/src/pyglet/pyglet/media/codecs/base.py", line 273, in play | |
player.play() | |
File "/private/tmp/f2/.venv/src/pyglet/pyglet/media/player.py", line 238, in play | |
self._set_playing(True) | |
File "/private/tmp/f2/.venv/src/pyglet/pyglet/media/player.py", line 190, in _set_playing | |
self._create_audio_player() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person: | |
name = 'person' | |
@pytest.fixture() | |
def person_one(): | |
return Person() | |
@pytest.fixture() |