Skip to content

Instantly share code, notes, and snippets.

app.factory('CampaignAccount', ['$scope', '$resource', function($scope, $resource) {
return $resource('/campaign_accounts/:id', {
id: '@id'
}, {
update: {
method: 'PATCH'
}
});
}]);
@geekbuntu
geekbuntu / gist:1034659
Created June 19, 2011 19:52 — forked from w0rm/gist:1034547
Saving form state between requests in webpy
class Form(web.form.Form, object):
def __init__(self, name, *inputs, **kw):
super(Form, self).__init__(*inputs, **kw)
self.name = name
def save_state(self):
session.forms[self.name] = dict(
notes = dict((i.name, i.note) for i in self.inputs if i.note ),
values = dict((i.name, i.get_value()) for i in self.inputs ),
@geekbuntu
geekbuntu / sidebar.php
Created May 1, 2011 04:05 — forked from jgv/sidebar.php
cleaning sloppy rss feed. requires magpie
<div id="sidebar">
<div class="events">
<h2>Public Programs</h2>
<?php
ob_start();
$rss = fetch_rss("http://feeds.feedburner.com/NewMuseumEvents");
$count = 1;
foreach ($rss->items as $item){
if ($count > 3) {
continue;
import web
from controllers import blog
urls = (
'/blog', blog.app
)
app = web.application(urls, locals())
if __name__ == "__main__":