Skip to content

Instantly share code, notes, and snippets.

:)owen@dashie:Development$ git init pyc-problem
Initialized empty Git repository in /Users/owen/Development/pyc-problem/.git/
:)owen@dashie:Development$ cd pyc-problem/
:)owen@dashie:pyc-problem (master #)$ echo 'value = "before"' > foo.py
:)owen@dashie:pyc-problem (master #)$ cat > script <<'SCRIPT'
> #!/usr/bin/env python
>
ps1_status() {
if [ $? -ne 0 ]; then
echo ":("
else
echo ":)"
fi
}
function configure_prompt() {
local PS_RESET="\[\e[00m\]"
def jsonizable(atoms=(), lists=(), objects=()):
"""Adds a `to_json` method to decorated classes:
>>> @jsonizable(atoms=['name', 'age'])
... class Example(object):
... def __init__(self, name, age):
... self.name = name
... self.age = age
...
>>> e = Example('bob', 37)
:)owen@dashie:surprise$ git init
Initialized empty Git repository in /Users/owen/Development/FreshBooks/schemata/surprise/.git/
:)owen@dashie:surprise (master #)$ git fetch git://github.com/idcmp/pyd.git master
remote: Counting objects: 379, done.
remote: Compressing objects: 100% (228/228), done.
remote: Total 379 (delta 192), reused 324 (delta 140)
Receiving objects: 100% (379/379), 65.66 KiB | 31 KiB/s, done.
Resolving deltas: 100% (192/192), done.
From git://github.com/idcmp/pyd
@ojacobson
ojacobson / Clock.java
Created November 27, 2012 02:41 — forked from azuby/Job.java
public class Model {
JSONClient clientFactory;
private final String resource;
protected Model(String resource, Activity activity) {
this.resource = resource;
clientFactory = new JSONClient(activity);
}
def jsonizable(atoms=(), lists=(), objects=()):
"""Adds a `to_json` method to decorated classes:
>>> @jsonizable(atoms=['name', 'age'])
... class Example(object):
... def __init__(self, name, age):
... self.name = name
... self.age = age
...
>>> e = Example('bob', 37)
You can, additionally, overlay values or computed values onto the JSON
representation by passing the optional `overlay` parameter as a dictionary
of callables:

    >>> @jsonizable(atoms=['name'])
    ... class Person(object):
    ...     def __init__(self, name):
    ...         self.name = name
    ... 

>>> @jsonizable(lists=['students'], objects=['teacher'])

def jsonizable(atoms=(), lists=(), objects=()):
"""Adds a `to_json` method to decorated classes:
>>> @jsonizable(atoms=['name', 'age'])
... class Example(object):
... def __init__(self, name, age):
... self.name = name
... self.age = age
...
>>> e = Example('bob', 37)
public class QuizQuestion {
private final JLabel question;
public QuizQuestion(String question) {
this.question = new JLabel(question);
}
public void addToContainer(JComponent container) {
container.add(question);
}
WEB_HOST ?= alchemy.grimoire.ca
WEB_ROOT ?= /home/owen/bliki
BROWSER ?= open
.html: clean
markdoc build
.PHONY: html
html: .html